FotoSHOCK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
FotoSHOCKcore::ImageOperationDescriptor Class Referenceabstract

Class describing an ImageOperation. More...

#include <ImageOperation.hpp>

Inheritance diagram for FotoSHOCKcore::ImageOperationDescriptor:
AddOneDescr AverageDescr BWconversionDescr BWconversionDescr CurveOperationDescr FotoSHOCKcore::ConvertPixelFormatDescr FotoSHOCKcore::RootCreateImage FotoSHOCKcore::RootLoadImageDescriptor MathOperationDescr QGLPreviewOperationDescr RootLoadImageDescriptor

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 ImageOperationoperation ()=0
 Create a new ImageOperation object. More...
 

Detailed Description

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().

Examples:
BWconversion/BWconversion.hpp, BWconversion_direct/BWconversion_direct.hpp, and graph/example.cpp.

Member Enumeration Documentation

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.

Member Function Documentation

virtual const char* FotoSHOCKcore::ImageOperationDescriptor::description ( )
pure virtual
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.

InputProto FotoSHOCKcore::ImageOperationDescriptor::inputPrototype ( )
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.

Returns
description of inputs

Reimplemented in AverageDescr, MathOperationDescr, FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, QGLPreviewOperationDescr, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.

virtual const char* FotoSHOCKcore::ImageOperationDescriptor::name ( )
pure virtual
virtual ImageOperation* FotoSHOCKcore::ImageOperationDescriptor::operation ( )
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.

Returns
new ImageOperation object

Implemented in AverageDescr, AddOneDescr, CurveOperationDescr, QGLPreviewOperationDescr, MathOperationDescr, BWconversionDescr, FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, BWconversionDescr, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.

ImageOperationDescriptor::ImageOperationType FotoSHOCKcore::ImageOperationDescriptor::operationType ( )
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.

Returns
the type of the operation

Reimplemented in FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, QGLPreviewOperationDescr, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.

OutputProto FotoSHOCKcore::ImageOperationDescriptor::outputPrototype ( )
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

Returns
description of outputs

Reimplemented in QGLPreviewOperationDescr, FotoSHOCKcore::RootCreateImage, FotoSHOCKcore::RootLoadImageDescriptor, FotoSHOCKcore::ConvertPixelFormatDescr, and RootLoadImageDescriptor.


The documentation for this class was generated from the following files: