Spinnaker C
4.3.0.189
 
Functions
Image Processor Access

The functions in this section provide access to information and functionality of image processor. This includes image processor creation, deletion, image conversion, image decompression and image post processing methods. More...

Functions

SPINNAKERC_API spinImageProcessorCreate (spinImageProcessor *phImageProcessor)
 Creates an image processor. More...
 
SPINNAKERC_API spinImageProcessorDestroy (spinImageProcessor hImageProcessor)
 Destroys a image list. More...
 
SPINNAKERC_API spinImageProcessorSetColorProcessing (spinImageProcessor hImageProcessor, spinColorProcessingAlgorithm colorAlgorithm)
 Sets the color processing algorithm used at the time of the spinImageProcessorConvert() call, therefore the most recent execution of this function will take precedence. More...
 
SPINNAKERC_API spinImageProcessorGetColorProcessing (spinImageProcessor hImageProcessor, spinColorProcessingAlgorithm *pColorAlgorithm)
 Gets the default color processing algorithm. More...
 
SPINNAKERC_API spinImageProcessorSetNumDecompressionThreads (spinImageProcessor hImageProcessor, unsigned int numThreads)
 Sets the default number of threads used for image decompression during spinImageProcessorConvert(). More...
 
SPINNAKERC_API spinImageProcessorGetNumDecompressionThreads (spinImageProcessor hImageProcessor, unsigned int *pNumThreads)
 Gets the number of threads used for image decompression during spinImageProcessorConvert(). More...
 
SPINNAKERC_API spinImageProcessorConvert (spinImageProcessor hImageProcessor, spinImage hSrcImage, spinImage hDestImage, spinPixelFormatEnums destFormat)
 Converts the source image buffer to the specified destination pixel format and stores the result in the destination image. More...
 
SPINNAKERC_API spinImageProcessorConvertImageList (spinImageProcessor hImageProcessor, spinImageList hSrcImageList, spinImage hDestImage, spinPixelFormatEnums destFormat)
 Converts the source list of image buffers to the specified output pixel format and returns the result in a new image. More...
 
SPINNAKERC_API spinImageProcessorApplyGamma (spinImageProcessor hImageProcessor, spinImage hSrcImage, spinImage hDestImage, float gamma, bool8_t applyGammaInverse)
 Applies gamma correction to the source image and stores the result in the destination image. More...
 

Detailed Description

The functions in this section provide access to information and functionality of image processor. This includes image processor creation, deletion, image conversion, image decompression and image post processing methods.

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

Function Documentation

◆ spinImageProcessorApplyGamma()

SPINNAKERC_API spinImageProcessorApplyGamma ( spinImageProcessor  hImageProcessor,
spinImage  hSrcImage,
spinImage  hDestImage,
float  gamma,
bool8_t  applyGammaInverse 
)

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

Parameters
hImageProcessorThe image processor context
hSrcImageThe source image from which to apply gamma on.
hDestImageThe 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)

◆ spinImageProcessorConvert()

SPINNAKERC_API spinImageProcessorConvert ( spinImageProcessor  hImageProcessor,
spinImage  hSrcImage,
spinImage  hDestImage,
spinPixelFormatEnums  destFormat 
)

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

See also
spinPixelFormatEnums
spinImageReset
spinImageProcessorSetNumDecompressionThreads
Parameters
hImageProcessorThe image processor context
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.
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageEvents_C.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinImageProcessorConvertImageList()

SPINNAKERC_API spinImageProcessorConvertImageList ( spinImageProcessor  hImageProcessor,
spinImageList  hSrcImageList,
spinImage  hDestImage,
spinPixelFormatEnums  destFormat 
)

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 spinImageReset() 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
spinPixelFormatEnums
spinImageReset
spinImageProcessorSetNumDecompressionThreads
Parameters
hImageProcessorThe image processor context
hSrcImageListList of images from which to convert the images from.
hDestImageThe destination image in which the converted image data will be stored.
destFormatOutput format of the converted image.

◆ spinImageProcessorCreate()

SPINNAKERC_API spinImageProcessorCreate ( spinImageProcessor phImageProcessor)

Creates an image processor.

See also
spinError
Parameters
phImageProcessorThe image processor handle pointer in which the image processor context is returned
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageEvents_C.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinImageProcessorDestroy()

SPINNAKERC_API spinImageProcessorDestroy ( spinImageProcessor  hImageProcessor)

Destroys a image list.

See also
spinError
Parameters
hImageProcessorThe image processor context to destroy
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageEvents_C.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinImageProcessorGetColorProcessing()

SPINNAKERC_API spinImageProcessorGetColorProcessing ( spinImageProcessor  hImageProcessor,
spinColorProcessingAlgorithm *  pColorAlgorithm 
)

Gets the default color processing algorithm.

Parameters
hImageProcessorThe image processor context
pColorAlgorithmThe color processing algorithm pointer in which the color processing algorithm is returned
See also
spinImageProcessorSetColorProcessing()

◆ spinImageProcessorGetNumDecompressionThreads()

SPINNAKERC_API spinImageProcessorGetNumDecompressionThreads ( spinImageProcessor  hImageProcessor,
unsigned int *  pNumThreads 
)

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

Parameters
hImageProcessorThe image processor context
pNumThreadsThe unsigned integer pointer in which the number of parallel image decompression threads is returned
See also
spinImageProcessorSetNumDecompressionThreads()

◆ spinImageProcessorSetColorProcessing()

SPINNAKERC_API spinImageProcessorSetColorProcessing ( spinImageProcessor  hImageProcessor,
spinColorProcessingAlgorithm  colorAlgorithm 
)

Sets the color processing algorithm used at the time of the spinImageProcessorConvert() 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
hImageProcessorThe image processor context
colorAlgorithmThe color processing algorithm to set.
See also
spinImageProcessorGetColorProcessing()
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageEvents_C.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinImageProcessorSetNumDecompressionThreads()

SPINNAKERC_API spinImageProcessorSetNumDecompressionThreads ( spinImageProcessor  hImageProcessor,
unsigned int  numThreads 
)

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

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

Parameters
hImageProcessorThe image processor context
numThreadsNumber of parallel image decompression threads set to run
See also
spinImageProcessorConvert()