Spinnaker C++
4.0.0.116
Public Member Functions | Protected Member Functions | Friends | List of all members
ImageProcessor Class Reference

Image post processing class for converting a source image to another pixel format. More...

Inheritance diagram for ImageProcessor:
IImageProcessor

Public Member Functions

 ImageProcessor ()
 Default constructor. More...
 
virtual ~ImageProcessor ()
 Default destructor. More...
 
 ImageProcessor (const ImageProcessor &iface)
 Copy constructor. More...
 
ImageProcessoroperator= (const ImageProcessor &iface)
 Assignment operator. More...
 
void SetColorProcessing (ColorProcessingAlgorithm colorAlgorithm)
 Sets the color processing algorithm used at the time of the Convert() call, therefore the most recent execution of this function will take precedence. More...
 
ColorProcessingAlgorithm GetColorProcessing ()
 Gets the default color processing algorithm. More...
 
void SetNumDecompressionThreads (unsigned int numThreads)
 Sets the default number of threads used for image decompression during Convert(). More...
 
unsigned int GetNumDecompressionThreads ()
 Gets the number of threads used for image decompression during Convert(). More...
 
ImagePtr Convert (const ImagePtr &srcImage, PixelFormatEnums destFormat) const
 Converts the source image buffer to the specified destination pixel format and returns the result in a new image. More...
 
void Convert (const ImagePtr &srcImage, ImagePtr &destImage, PixelFormatEnums destFormat) const
 Converts the source image buffer to the specified destination pixel format and stores the result in the destination image. More...
 
ImagePtr Convert (const ImageList &srcImageList, PixelFormatEnums destFormat) const
 Converts the source list of image buffers to the specified output pixel format and returns the result in a new image. More...
 
void Convert (const ImageList &srcImageList, ImagePtr &destImage, PixelFormatEnums destFormat) const
 Converts the source list of image buffers to the specified output pixel format and returns the result in a new image. More...
 
ImagePtr ApplyGamma (const ImagePtr &srcImage, float gamma, bool applyGammaInverse=false) const
 Applies gamma correction to the source image and returns a new image. More...
 
void ApplyGamma (const ImagePtr &srcImage, ImagePtr &destImage, float gamma, bool applyGammaInverse=false) const
 Applies gamma correction to the source image and stores the result in the destination image. More...
 
- Public Member Functions inherited from IImageProcessor
virtual ~IImageProcessor (void)
 

Protected Member Functions

void Convert (const Image *pSrcImage, Image *pDestImage, PixelFormatEnums destFormat) const
 
- Protected Member Functions inherited from IImageProcessor
 IImageProcessor ()
 
 IImageProcessor (const IImageProcessor &)
 
IImageProcessoroperator= (const IImageProcessor &)
 

Friends

class ImageFiler
 

Additional Inherited Members

- Protected Attributes inherited from IImageProcessor
ImageProcessorData * m_pImageProcessorData
 

Detailed Description

Image post processing class for converting a source image to another pixel format.

All supported input image pixel formats can be converted to supported output image pixel formats. If the input pixel format is a compressed format, the decompression will occur before converting to the output pixel format.

List of supported input image pixel formats:

List of supported output image pixel formats

Examples:
Acquisition.cpp, AcquisitionMultipleThread.cpp, AcquisitionUserBuffer.cpp, ChunkData.cpp, Compression.cpp, CounterAndTimer.cpp, DeviceEvents.cpp, Exposure.cpp, Exposure_QuickSpin.cpp, ImageEvents.cpp, ImageFormatControl.cpp, ImageFormatControl_QuickSpin.cpp, LogicBlock.cpp, LookupTable.cpp, SaveToAvi.cpp, Sequencer.cpp, Trigger.cpp, and Trigger_QuickSpin.cpp.

Constructor & Destructor Documentation

Default constructor.

virtual ~ImageProcessor ( )
virtual

Default destructor.

ImageProcessor ( const ImageProcessor iface)

Copy constructor.

Member Function Documentation

ImagePtr ApplyGamma ( const ImagePtr srcImage,
float  gamma,
bool  applyGammaInverse = false 
) const
virtual

Applies gamma correction to the source image and returns a new image.

Parameters
srcImageThe source image from which to apply gamma on.
gammaGamma value to apply. A value between 0.5 and 4 is acceptable. (Default assuming image-to-screen)
applyGammaInverseConverts a gamma corrected source image back to the original image using the inverse of the gamma value (used for applying screen-to-image gamma)

Implements IImageProcessor.

void ApplyGamma ( const ImagePtr srcImage,
ImagePtr destImage,
float  gamma,
bool  applyGammaInverse = false 
) const
virtual

Applies gamma correction to the source image and stores the result in the destination image.

Parameters
srcImageThe source image from which to apply gamma on.
destImageThe destination image in which the gamma applied image data will be stored.
gammaGamma value to apply. A value between 0.5 and 4 is acceptable. (Default assuming image-to-screen)
applyGammaInverseConverts a gamma corrected source image back to the original image using the inverse of the gamma value (used for applying screen-to-image gamma)

Implements IImageProcessor.

ImagePtr Convert ( const ImagePtr srcImage,
PixelFormatEnums  destFormat 
) const
virtual

Converts the source image buffer to the specified destination pixel format and returns the result in a new image.

The destination image does not need to be configured in any way before the call is made.

Note that compressed images are decompressed before any further color processing or conversion during this call. Decompression is multi-threaded and defaults to utilizing one less than the number of concurrent threads supported by the system. The default number of decompression threads can be set with SetNumDecompressionThreads().

See Also
PixelFormatEnums
SetNumDecompressionThreads
Parameters
srcImageThe source image from which to convert the image from.
destFormatOutput format of the converted image.
Returns
The converted image.

Implements IImageProcessor.

Examples:
Acquisition.cpp, AcquisitionMultipleThread.cpp, AcquisitionUserBuffer.cpp, ChunkData.cpp, Compression.cpp, CounterAndTimer.cpp, DeviceEvents.cpp, Exposure.cpp, Exposure_QuickSpin.cpp, ImageFormatControl.cpp, ImageFormatControl_QuickSpin.cpp, LogicBlock.cpp, LookupTable.cpp, SaveToAvi.cpp, Sequencer.cpp, Trigger.cpp, and Trigger_QuickSpin.cpp.
void Convert ( const ImagePtr srcImage,
ImagePtr destImage,
PixelFormatEnums  destFormat 
) const
virtual

Converts the source image buffer to the specified destination pixel format and stores the result in the destination image.

The destination image needs to be configured to have the correct buffer size before calling this function. See ResetImage() to setup the correct buffer size according to specified pixel format.

Note that compressed images are decompressed before any further color processing or conversion during this call. Decompression is multi-threaded and defaults to utilizing one less than the number of concurrent threads supported by the system. The default number of decompression threads can be set with SetNumDecompressionThreads().

See Also
PixelFormatEnums
ResetImage
SetNumDecompressionThreads
Parameters
srcImageThe source image from which to convert the image from.
destImageThe destination image in which the converted image data will be stored.
destFormatOutput format of the converted image.

Implements IImageProcessor.

ImagePtr Convert ( const ImageList srcImageList,
PixelFormatEnums  destFormat 
) const
virtual

Converts the source list of image buffers to the specified output pixel format and returns the result in a new image.

The conversion could encompasses decompression, interleaving and conversion of image data depending on the source pixel format of images in the source image list. The destination image does not need to be configured in any way before the call is made.

Note that compressed images are decompressed before any further color processing, interleaving or conversion is performed. Decompression is multi-threaded and defaults to utilizing one less than the number of concurrent threads supported by the system. The default number of decompression threads can be set with SetNumDecompressionThreads().

Note not all the supported image pixel formats described in the class description are supported in this function.

List of supported image pixel formats for the source image list:

  • PixelFormat_R12
  • PixelFormat_GR12
  • PixelFormat_GB12
  • PixelFormat_B12
  • PixelFormat_R12_Jpeg
  • PixelFormat_GR12_Jpeg
  • PixelFormat_GB12_Jpeg
  • PixelFormat_B12_Jpeg
See Also
PixelFormatEnums
SetNumDecompressionThreads
Parameters
srcImageListList of images from which to convert the images from.
destFormatOutput format of the converted image.
Returns
The converted image.

Implements IImageProcessor.

void Convert ( const ImageList srcImageList,
ImagePtr destImage,
PixelFormatEnums  destFormat 
) const
virtual

Converts the source list of image buffers to the specified output pixel format and returns the result in a new image.

The conversion could encompasses decompression, interleaving and conversion of image data depending on the source pixel format of images in the source image list. The destination image needs to be configured to have the correct buffer size before calling this function. See ResetImage() to setup the correct buffer size according to specified pixel format.

Note that compressed images are decompressed before any further color processing, interleaving or conversion is performed. Decompression is multi-threaded and defaults to utilizing one less than the number of concurrent threads supported by the system. The default number of decompression threads can be set with SetNumDecompressionThreads().

Note not all the supported image pixel formats described in the class description are supported in this function.

List of supported image pixel formats for the source image list:

  • PixelFormat_R12
  • PixelFormat_GR12
  • PixelFormat_GB12
  • PixelFormat_B12
  • PixelFormat_R12_Jpeg
  • PixelFormat_GR12_Jpeg
  • PixelFormat_GB12_Jpeg
  • PixelFormat_B12_Jpeg
See Also
PixelFormatEnums
ResetImage
SetNumDecompressionThreads
Parameters
srcImageListList of images from which to convert the images from.
destImageThe destination image in which the converted image data will be stored.
destFormatOutput format of the converted image.

Implements IImageProcessor.

void Convert ( const Image pSrcImage,
Image pDestImage,
PixelFormatEnums  destFormat 
) const
protected
ColorProcessingAlgorithm GetColorProcessing ( )
virtual

Gets the default color processing algorithm.

See Also
SetColorProcessing()
Returns
The default color processing algorithm.

Implements IImageProcessor.

unsigned int GetNumDecompressionThreads ( )
virtual

Gets the number of threads used for image decompression during Convert().

See Also
SetNumDecompressionThreads()
Returns
Number of parallel image decompression threads set to run.

Implements IImageProcessor.

ImageProcessor& operator= ( const ImageProcessor iface)

Assignment operator.

void SetColorProcessing ( ColorProcessingAlgorithm  colorAlgorithm)
virtual

Sets the color processing algorithm used at the time of the Convert() call, therefore the most recent execution of this function will take precedence.

The DEFAULT algorithm is deprecated and should not be used in the ImageProcessor class.

Parameters
colorAlgorithmThe color processing algorithm to set.
See Also
GetColorProcessing()

Implements IImageProcessor.

Examples:
Acquisition.cpp, AcquisitionMultipleThread.cpp, AcquisitionUserBuffer.cpp, ChunkData.cpp, Compression.cpp, CounterAndTimer.cpp, DeviceEvents.cpp, Exposure.cpp, Exposure_QuickSpin.cpp, ImageFormatControl.cpp, ImageFormatControl_QuickSpin.cpp, LogicBlock.cpp, LookupTable.cpp, SaveToAvi.cpp, Sequencer.cpp, Trigger.cpp, and Trigger_QuickSpin.cpp.
void SetNumDecompressionThreads ( unsigned int  numThreads)
virtual

Sets the default number of threads used for image decompression during Convert().

The number of threads used is defaulted to be equal to one less than the number of concurrent threads supported by the system.

Parameters
numThreadsNumber of parallel image decompression threads set to run
See Also
Convert()

Implements IImageProcessor.

Examples:
Compression.cpp.

Friends And Related Function Documentation

friend class ImageFiler
friend

The documentation for this class was generated from the following file:
Contact Support Spinnaker® SDK Programmer's Guide and API Reference