Skip to content

Class Spinnaker::ImageProcessor

ClassList > Spinnaker > ImageProcessor

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

  • #include <ImageProcessor.h>

Inherits the following classes: Spinnaker::IImageProcessor

Public Functions

Type Name
virtual ImagePtr ApplyGamma (const ImagePtr & srcImage, float gamma, bool applyGammaInverse=false) const
virtual void ApplyGamma (const ImagePtr & srcImage, ImagePtr & destImage, float gamma, bool applyGammaInverse=false) const
virtual ImagePtr Convert (const ImagePtr & srcImage, PixelFormatEnums destFormat) const
virtual void Convert (const ImagePtr & srcImage, ImagePtr & destImage, PixelFormatEnums destFormat) const
virtual ImagePtr Convert (const ImageList & srcImageList, PixelFormatEnums destFormat) const
virtual void Convert (const ImageList & srcImageList, ImagePtr & destImage, PixelFormatEnums destFormat) const
virtual ColorProcessingAlgorithm GetColorProcessing ()
virtual unsigned int GetNumDecompressionThreads ()
ImageProcessor ()
ImageProcessor (const ImageProcessor & processor)
virtual void SetColorProcessing (ColorProcessingAlgorithm colorAlgorithm)
virtual void SetNumDecompressionThreads (unsigned int numThreads)
ImageProcessor & operator= (const ImageProcessor & processor)
virtual ~ImageProcessor ()

Public Functions inherited from Spinnaker::IImageProcessor

See Spinnaker::IImageProcessor

Type Name
virtual ImagePtr ApplyGamma (const ImagePtr & srcImage, float gamma, bool isGammaInverse=false) const = 0
virtual void ApplyGamma (const ImagePtr & srcImage, ImagePtr & destImage, float gamma, bool isGammaInverse=false) const = 0
virtual ImagePtr Convert (const ImagePtr & srcImage, PixelFormatEnums destFormat) const = 0
virtual void Convert (const ImagePtr & srcImage, ImagePtr & destImage, PixelFormatEnums destFormat) const = 0
virtual ImagePtr Convert (const ImageList & srcImageList, PixelFormatEnums destFormat) const = 0
virtual void Convert (const ImageList & srcImageList, ImagePtr & destImage, PixelFormatEnums destFormat) const = 0
virtual ColorProcessingAlgorithm GetColorProcessing () = 0
virtual unsigned int GetNumDecompressionThreads () = 0
virtual void SetColorProcessing (ColorProcessingAlgorithm colorAlgorithm) = 0
virtual void SetNumDecompressionThreads (unsigned int numThreads) = 0
virtual ~IImageProcessor (void)

Protected Attributes inherited from Spinnaker::IImageProcessor

See Spinnaker::IImageProcessor

Type Name
ImageProcessorData * m_pImageProcessorData

Protected Functions

Type Name
void Convert (const Image * pSrcImage, Image * pDestImage, PixelFormatEnums destFormat) const

Protected Functions inherited from Spinnaker::IImageProcessor

See Spinnaker::IImageProcessor

Type Name
IImageProcessor ()
IImageProcessor (const IImageProcessor &)
IImageProcessor & operator= (const IImageProcessor &)

Detailed Description

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:

  • PixelFormat_Mono8
  • PixelFormat_Mono16
  • PixelFormat_BayerGR8
  • PixelFormat_BayerRG8
  • PixelFormat_BayerGB8
  • PixelFormat_BayerBG8
  • PixelFormat_BayerGR16
  • PixelFormat_BayerRG16
  • PixelFormat_BayerGB16
  • PixelFormat_BayerBG16
  • PixelFormat_Mono12Packed
  • PixelFormat_BayerGR12Packed
  • PixelFormat_BayerRG12Packed
  • PixelFormat_BayerGB12Packed
  • PixelFormat_BayerBG12Packed
  • PixelFormat_YUV411Packed
  • PixelFormat_YUV422Packed
  • PixelFormat_YUV444Packed
  • PixelFormat_Mono12p
  • PixelFormat_BayerGR12p
  • PixelFormat_BayerRG12p
  • PixelFormat_BayerGB12p
  • PixelFormat_BayerBG12p
  • PixelFormat_YCbCr8
  • PixelFormat_YCbCr422_8
  • PixelFormat_YCbCr411_8
  • PixelFormat_BGR8
  • PixelFormat_BGRa8
  • PixelFormat_Mono10Packed
  • PixelFormat_BayerGR10Packed
  • PixelFormat_BayerRG10Packed
  • PixelFormat_BayerGB10Packed
  • PixelFormat_BayerBG10Packed
  • PixelFormat_Mono10p
  • PixelFormat_BayerGR10p
  • PixelFormat_BayerRG10p
  • PixelFormat_BayerGB10p
  • PixelFormat_BayerBG10p
  • PixelFormat_Mono10
  • PixelFormat_Mono12
  • PixelFormat_Mono14
  • PixelFormat_BayerBG10
  • PixelFormat_BayerBG12
  • PixelFormat_BayerGB10
  • PixelFormat_BayerGB12
  • PixelFormat_BayerGR10
  • PixelFormat_BayerGR12
  • PixelFormat_BayerRG10
  • PixelFormat_BayerRG12
  • PixelFormat_RGBa8
  • PixelFormat_RGB8
  • PixelFormat_RGB12
  • PixelFormat_BGR16
  • PixelFormat_R12
  • PixelFormat_G12
  • PixelFormat_B12
  • PixelFormat_YUV8_UYV
  • PixelFormat_YUV411_8_UYYVYY
  • PixelFormat_YUV422_8
  • PixelFormat_Polarized8
  • PixelFormat_Polarized10p
  • PixelFormat_Polarized12p
  • PixelFormat_Polarized16
  • PixelFormat_BayerRGPolarized8
  • PixelFormat_BayerRGPolarized10p
  • PixelFormat_BayerRGPolarized12p
  • PixelFormat_BayerRGPolarized16
  • PixelFormat_LLCMono8
  • PixelFormat_LLCBayerRG8
  • PixelFormat_JPEGMono8
  • PixelFormat_JPEGColor8
  • PixelFormat_Raw16
  • PixelFormat_Raw8
  • PixelFormat_R12_Jpeg
  • PixelFormat_GR12_Jpeg
  • PixelFormat_GB12_Jpeg
  • PixelFormat_B12_Jpeg

List of supported output image pixel formats

  • PixelFormat_Mono8
  • PixelFormat_Mono16
  • PixelFormat_BayerBG8
  • PixelFormat_BayerGB8
  • PixelFormat_BayerRG8
  • PixelFormat_BayerGR8
  • PixelFormat_BayerBG16
  • PixelFormat_BayerGB16
  • PixelFormat_BayerRG16
  • PixelFormat_BayerGR16
  • PixelFormat_BGR8
  • PixelFormat_BGRa8
  • PixelFormat_RGB8
  • PixelFormat_RGBa8
  • PixelFormat_BGR16
  • PixelFormat_RGB16
  • PixelFormat_R12
  • PixelFormat_G12
  • PixelFormat_B12

Public Functions Documentation

function ApplyGamma [1/2]

virtual ImagePtr Spinnaker::ImageProcessor::ApplyGamma (
    const ImagePtr & srcImage,
    float gamma,
    bool applyGammaInverse=false
) const

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

Parameters:

  • srcImage The source image from which to apply gamma on.
  • gamma Gamma value to apply. A value between 0.5 and 4 is acceptable. (Default assuming image-to-screen)
  • applyGammaInverse Converts 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 Spinnaker::IImageProcessor::ApplyGamma


function ApplyGamma [2/2]

virtual void Spinnaker::ImageProcessor::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.

Note that the destination image buffer cannot point to the same memory location as the source image buffer. This ensures that the image processing operation does not result in undefined behavior or data corruption due to overlapping memory regions.

Parameters:

  • srcImage The source image from which to apply gamma on.
  • destImage The destination image in which the gamma applied image data will be stored.
  • gamma Gamma value to apply. A value between 0.5 and 4 is acceptable. (Default assuming image-to-screen)
  • applyGammaInverse Converts 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 Spinnaker::IImageProcessor::ApplyGamma


function Convert [1/5]

virtual ImagePtr Spinnaker::ImageProcessor::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. 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

See also: SetNumDecompressionThreads

Parameters:

  • srcImage The source image from which to convert the image from.
  • destFormat Output format of the converted image.

Returns:

The converted image.

Implements Spinnaker::IImageProcessor::Convert


function Convert [2/5]

virtual void Spinnaker::ImageProcessor::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. 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().

Note that the destination image buffer cannot point to the same memory location as the source image buffer. This ensures that the image processing operation does not result in undefined behavior or data corruption due to overlapping memory regions.

See also: PixelFormatEnums

See also: ResetImage

See also: SetNumDecompressionThreads

Parameters:

  • srcImage The source image from which to convert the image from.
  • destImage The destination image in which the converted image data will be stored.
  • destFormat Output format of the converted image.

Implements Spinnaker::IImageProcessor::Convert


function Convert [3/5]

virtual ImagePtr Spinnaker::ImageProcessor::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. 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 that the destination image buffer cannot point to the same memory location as the source image buffer. This ensures that the image processing operation does not result in undefined behavior or data corruption due to overlapping memory regions.

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

See also: SetNumDecompressionThreads

Parameters:

  • srcImageList List of images from which to convert the images from.
  • destFormat Output format of the converted image.

Returns:

The converted image.

Implements Spinnaker::IImageProcessor::Convert


function Convert [4/5]

virtual void Spinnaker::ImageProcessor::Convert (
    const ImageList & srcImageList,
    ImagePtr & destImage,
    PixelFormatEnums destFormat
) const

Converts the source list of image buffers to the specified output pixel format and stores the result in the destination 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

See also: ResetImage

See also: SetNumDecompressionThreads

Parameters:

  • srcImageList List of images from which to convert the images from.
  • destImage The destination image in which the converted image data will be stored.
  • destFormat Output format of the converted image.

Implements Spinnaker::IImageProcessor::Convert


function GetColorProcessing

virtual ColorProcessingAlgorithm Spinnaker::ImageProcessor::GetColorProcessing () 

Gets the default color processing algorithm.

See also: SetColorProcessing()

Returns:

The default color processing algorithm.

Implements Spinnaker::IImageProcessor::GetColorProcessing


function GetNumDecompressionThreads

virtual unsigned int Spinnaker::ImageProcessor::GetNumDecompressionThreads () 

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 Spinnaker::IImageProcessor::GetNumDecompressionThreads


function ImageProcessor [1/2]

Spinnaker::ImageProcessor::ImageProcessor () 

Default constructor.


function ImageProcessor [2/2]

Spinnaker::ImageProcessor::ImageProcessor (
    const ImageProcessor & processor
) 

Copy constructor


function SetColorProcessing

virtual void Spinnaker::ImageProcessor::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. The DEFAULT algorithm is deprecated and should not be used in the ImageProcessor class.

Parameters:

  • colorAlgorithm The color processing algorithm to set.

See also: GetColorProcessing()

Implements Spinnaker::IImageProcessor::SetColorProcessing


function SetNumDecompressionThreads

virtual void Spinnaker::ImageProcessor::SetNumDecompressionThreads (
    unsigned int numThreads
) 

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:

  • numThreads Number of parallel image decompression threads set to run

See also: Convert()

Implements Spinnaker::IImageProcessor::SetNumDecompressionThreads


function operator=

ImageProcessor & Spinnaker::ImageProcessor::operator= (
    const ImageProcessor & processor
) 

Assignment operator.


function ~ImageProcessor

virtual Spinnaker::ImageProcessor::~ImageProcessor () 

Default destructor.


Protected Functions Documentation

function Convert [5/5]

void Spinnaker::ImageProcessor::Convert (
    const Image * pSrcImage,
    Image * pDestImage,
    PixelFormatEnums destFormat
) const


The documentation for this class was generated from the following file C:/workspace/include/ImageProcessor.h