This is an example of how to declare an ImageOperation that converts image to grayscale using a direct access to ImageBuffer.
#ifndef BWCONVERSIONDIRECT_H
#define BWCONVERSIONDIRECT_H
#include <ImageOperation.hpp>
#include <ImageBuffer.hpp>
using namespace FotoSHOCKcore;
public:
virtual void runOperation (
const Inputs& sources,
const Outputs& dest, vector<UpdateInfo>& ROI,
const long stamp);
private:
template <ValueType::Enum PixelFormat>
void convert(
MipMap* src,
MipMap* dest, vector<UpdateInfo>& ROIlist,
const long stamp);
};
public:
virtual const char* name() {return "B/W Conversion.";}
virtual const char* description() {return "Converts an image to grayscale.";}
};
#endif