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

Load a new image. More...

#include <RootCreateImage.hpp>

Inheritance diagram for FotoSHOCKcore::RootCreateImage:
FotoSHOCKcore::ImageOperationDescriptor FotoSHOCKcore::ImageOperation

Public Member Functions

 RootCreateImage (FotoSHOCKcore::PixelData format, unsigned int width, unsigned int height, const std::string color)
 
void prepare (FotoSHOCKcore::PixelData format, unsigned int width, unsigned int height, const std::string color)
 
virtual const char * name ()
 Name of the operation. More...
 
virtual const char * description ()
 Description of the operation. More...
 
virtual ImageOperationoperation ()
 Create a new ImageOperation object. More...
 
virtual InputProto inputPrototype ()
 Description of inputs. More...
 
virtual ImageOperationType operationType ()
 Return a type of the ImageOperation. More...
 
virtual OutputProto outputPrototype ()
 Description of outputs. More...
 
virtual void runOperation (const Inputs &sources, const Outputs &dest, vector< UpdateInfo > &ROI, const long int stamp)
 
virtual bool isPrepared ()
 Tell whether the operations is prepared to process image data. More...
 
virtual void serialize (XmlSerializer &serializer)
 Serialize the operation using the specified serializer. More...
 
- Public Member Functions inherited from FotoSHOCKcore::ImageOperationDescriptor
 ImageOperationDescriptor ()
 Default constructor.
 
virtual ~ImageOperationDescriptor ()
 A destructor.
 
uint64_t id ()
 Unique identifier of the operation descriptor. More...
 
- Public Member Functions inherited from FotoSHOCKcore::ImageOperation
 ImageOperation ()
 A constructor. More...
 
virtual ~ImageOperation ()
 A destructor.
 
GraphNodegetOwnerNode () const
 Get the node containing the operation. More...
 
virtual void initialize ()
 Set up the internal data which depends on the information from the GraphNode class. More...
 
virtual void runOperation (const Inputs &sources, const Outputs &dest, vector< UpdateInfo > &ROI, const long stamp)=0
 Apply the operation. More...
 
virtual bool updateROI (UpdateInfo &currentROI, UpdateInfo &parentROI)
 Update ROI in parent to fit the needs of a new ROI. More...
 
boost::shared_ptr< UpdateInforequestROI (boost::shared_ptr< UpdateInfo > currentROI)
 Get the required ROI of an input. More...
 
virtual void deserialize (XmlSerializer &serializer)
 Deserialize the operation using the specified serializer. More...
 

Additional Inherited Members

- Public Types inherited from FotoSHOCKcore::ImageOperationDescriptor
enum  ImageOperationType {
  TypeNone, TypeRoot, TypeNorm, TypePreview,
  TypeConvertFormat
}
 Possible types of ImageOperation s. More...
 
- Protected Member Functions inherited from FotoSHOCKcore::ImageOperation
void setOwnerNode (GraphNode *node)
 Sets the node, that contains the operation. More...
 

Detailed Description

Load a new image.

Loads an image.

The format used is the same as the format of the input image.

Parameters
fileNamepath to the image

Member Function Documentation

virtual const char* FotoSHOCKcore::RootCreateImage::description ( )
inlinevirtual

Description of the operation.

Returns
description of the operation

Implements FotoSHOCKcore::ImageOperationDescriptor.

virtual InputProto FotoSHOCKcore::RootCreateImage::inputPrototype ( )
inlinevirtual

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 from FotoSHOCKcore::ImageOperationDescriptor.

bool FotoSHOCKcore::RootCreateImage::isPrepared ( )
virtual

Tell whether the operations is prepared to process image data.

The isPrepared() function is used to check whether all preconditions needed by the ImageOperation to work. These preconditions includes eg. initial setup from a user interface. This does not include setup done by the initialize() function.

The default implementation always returns true, ie. the ImageOperation is prepared to process image data without needing any additional setup.

Returns
true if the operation is prepared to run, false if it still needs some setup.

Reimplemented from FotoSHOCKcore::ImageOperation.

virtual const char* FotoSHOCKcore::RootCreateImage::name ( )
inlinevirtual

Name of the operation.

The name of operation will be shown in a graph.

Returns
name of the operation

Implements FotoSHOCKcore::ImageOperationDescriptor.

ImageOperation * FotoSHOCKcore::RootCreateImage::operation ( )
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

Implements FotoSHOCKcore::ImageOperationDescriptor.

virtual ImageOperationType FotoSHOCKcore::RootCreateImage::operationType ( )
inlinevirtual

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 from FotoSHOCKcore::ImageOperationDescriptor.

virtual OutputProto FotoSHOCKcore::RootCreateImage::outputPrototype ( )
inlinevirtual

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 from FotoSHOCKcore::ImageOperationDescriptor.

void FotoSHOCKcore::RootCreateImage::serialize ( XmlSerializer serializer)
virtual

Serialize the operation using the specified serializer.

Implement this function when the operation has custom settings that should be saved in the project. The operation must use the serializer that is passed as a parameter to seriaze its data, as it guarantees, that the data are stored at a proper place in the project file.

If the operation implements this function, it must implement its counterpart, the deserialize() function.

Parameters
serializerreference to OperationSerializer that is used for serializing data

Reimplemented from FotoSHOCKcore::ImageOperation.


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