Class describing an ImageOperation. More...
#include <ImageOperation.hpp>
Public Types | |
enum | ImageOperationType { TypeNone, TypeRoot, TypeNorm, TypePreview, TypeConvertFormat } |
Possible types of ImageOperation s. More... | |
Public Member Functions | |
ImageOperationDescriptor () | |
Default constructor. | |
virtual | ~ImageOperationDescriptor () |
A destructor. | |
virtual const char * | name ()=0 |
Name of the operation. More... | |
virtual const char * | description ()=0 |
Description of the operation. More... | |
uint64_t | id () |
Unique identifier of the operation descriptor. More... | |
virtual InputProto | inputPrototype () |
Description of inputs. More... | |
virtual OutputProto | outputPrototype () |
Description of outputs. More... | |
virtual ImageOperationType | operationType () |
Return a type of the ImageOperation. More... | |
virtual ImageOperation * | operation ()=0 |
Create a new ImageOperation object. More... | |
Class describing an ImageOperation.
The ImageOperationDescriptor is used to describe the ImageOperation. When a new ImageOperation is implemented, it is necessary to implement also a corresponding ImageOperationDescriptor.
The class provides some "cosmetic" informations, eg. the name of the operation, but also it provides information essential for the GraphManager, such as the type of the operation and prototypes for inputs and outputs (described using InputProto and OutputProto classes).
The ImageOperationDescriptor must provide a function to create a new object of the corresponding ImageOperation class using the ImageOperationDescriptor::operation().
Possible types of ImageOperation s.
Enumerator | |
---|---|
TypeNone |
No operation. |
TypeRoot |
Root operation. The operation which loads or creates a new image. Root operations are never run. Instead they use ImageOperation::initialize() to create the image buffer. |
TypeNorm |
An ordinary operation. |
TypePreview |
Special kind of operation which does the preview. The operation copies the buffer pixels into the graphics memory and shows them. |
TypeConvertFormat |
The operation does the conversion between two formats of buffers. |
|
pure virtual |
Description of the operation.
Implemented in AverageDescr, AddOneDescr, CurveOperationDescr, MathOperationDescr, BWconversionDescr, FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, QGLPreviewOperationDescr, BWconversionDescr, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.
uint64_t FotoSHOCKcore::ImageOperationDescriptor::id | ( | ) |
Unique identifier of the operation descriptor.
ID used to identify the operation. It is used solely to determine what "class" it is rather than to determine which instance it is.
It is used internally by the deserialization code to determine what operation needs to be recreated.
: currently it uses hash from name and description, but this may change in the future.
|
virtual |
Description of inputs.
Describes inputs of the operation. This includes PixelData format, that is accepted by each input.
The default implementation returns prototype specifying one input, that accepts any kind of ValueType, with arbitrary bit depth and arbitrary color space.
Reimplemented in AverageDescr, MathOperationDescr, FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, QGLPreviewOperationDescr, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.
|
pure virtual |
Name of the operation.
The name of operation will be shown in a graph.
Implemented in AverageDescr, AddOneDescr, CurveOperationDescr, MathOperationDescr, BWconversionDescr, FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, QGLPreviewOperationDescr, BWconversionDescr, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.
|
pure virtual |
Create a new ImageOperation object.
This function is used to obtain a new instance of the associated ImageOperation. The object must be allocated on heap using new. The memory is freed automatically when the object is not needed anymore.
Implemented in AverageDescr, AddOneDescr, CurveOperationDescr, QGLPreviewOperationDescr, MathOperationDescr, BWconversionDescr, FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, BWconversionDescr, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.
|
virtual |
Return a type of the ImageOperation.
By default ImageOperationType::TypeNorm is returned. If the operation is one of the special operations the getImageOperationType() must be overloaded appropriately.
Reimplemented in FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, QGLPreviewOperationDescr, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.
|
virtual |
Description of outputs.
Describes outputs of the operation.This includes PixelData format, that is provided by each input.
The default implementation returns prototype specifying one output, that has the same format as the input.
NOTE: Currently only one output is supported
Reimplemented in QGLPreviewOperationDescr, FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.