CImageDecompressor(const void * pCompressionDescriptor, size_t sizeCompressionDescriptor) Creates a decompressor and initializes it with the compression descriptor provided.
CImageDecompressor(GenApi::INodeMap & nodeMap) Creates a decompressor and initializes it with a compression descriptor that is retrieved from the camera's node map.
SetCompressionDescriptor(const void * pCompressionDescriptor, size_t sizeCompressionDescriptor) Initializes a decompressor with the compression descriptor provided.
DecompressImage(void * pOutputBuffer, size_t * pSizeOutputBuffer, const Pylon::GrabResult & grabResult) const Decompresses the image of the grab result provided.
DecompressImage(void * pOutputBuffer, size_t * pSizeOutputBuffer, const Pylon::CGrabResultPtr grabResultPtr) const Decompresses the image of the grab result provided.
GetCompressionDescriptor(void * pCompressionDescriptor, size_t * pSizeCompressionDescriptor, GenApi::INodeMap & nodeMap) Gets the current compression descriptor from the camera's node map.
ComputeCompressionDescriptorHash(void * pHash, size_t * pSizeHash, const void * pCompressionDescriptor, size_t sizeCompressionDescriptor) Computes the hash for a given compression descriptor.
GetCompressionDescriptorHash(void * pHash, size_t * pSizeHash, const void * pGrabBuffer, size_t payloadSize, EEndianness endianness =Endianness_Auto Gets the hash of the compression descriptor that is required for decompressing the grab buffer provided.
Provides convenient access to cameras that support image compression and helps with decompressing these images.
A decompressor requires a compression descriptor in order to be able to decompress images. You can set a compression descriptor via the constructor or the SetCompressionDescriptor methods (in both cases, either using the node map or manually).
A compression descriptor can be identified via a hash. This hash can be used to identify the matching compression descriptor for a particular compressed image. It can be computed using the ComputeCompressionDescriptorHash method or retrieved from the camera, decompressor, or a grab buffer/result using one of the GetCompressionDescriptorHash methods.
Grab buffers/results may contain different kinds of data. You can use the decompressor's GetCompressionInfo methods to distinguish between them. For that to work, a grab buffer/result must have been received successfully and it must contain the payload type chunk (for grab results you can get the payload type using the GetPayloadType method).
If compression info for the grab buffer/result provided is available, GetCompressionInfo returns true and you will receive the compression info via the CompressionInfo_t struct. If the field hasCompressedImage in the struct is true, the grab buffer/result contains a compressed image. In this case, you should check the compressionStatus field in the struct to check whether the camera was able to compress the image properly. The camera can't compress an image if the amount of data required for compressing the image exceeds the desired compression ratio. The image can be decompressed if compressionStatus is CompressionStatus_Ok. If the field hasCompressedImage in the struct is false, the grab buffer/result contains an already decompressed image. In this case, the decompressedImageSize and decompressedPayloadSize fields will not be used. All other fields contain information about the decompressed data.
Creates an empty decompressor without compression descriptor.
Error Safety:
Throws an exception if no memory can be allocated.
This constructor does not initialize the decompressor with a compression descriptor. You will have to initialize the decompressor first by using one of the SetCompressionDescriptor methods in order to be able to decompress images. You will get an exception if you access methods that require the decompressor to be initialized (see method descriptions for which methods are affected by that precondition).
Creates a decompressor and initializes it with the compression descriptor provided.
Parameters:
pCompressionDescriptor Pointer to the compression descriptor. This parameter must not be NULL.
sizeCompressionDescriptor Size of the data (in bytes) of the compression descriptor.
Error Safety:
Throws an exception if no memory can be allocated or the compression descriptor provided is invalid (e.g., because it is corrupt) or incompatible (e.g., because a compression descriptor of a newer compression implementation is passed).
Initializes a decompressor with the compression descriptor provided.
Parameters:
pCompressionDescriptor Pointer to the compression descriptor. This parameter must not be NULL.
sizeCompressionDescriptor Size of the data (in bytes) of the compression descriptor.
Error Safety:
Throws an exception if no memory can be allocated or the compression descriptor provided is invalid (e.g., because it is corrupt) or incompatible (e.g., because a compression descriptor of a newer compression implementation is passed).
pCompressionDescriptor Pointer to the buffer that will receive the compression descriptor or NULL if you only want to get the size of the buffer for buffer allocation.
pSizeCompressionDescriptor On input, the variable specifies the size of the buffer (in bytes) for the compression descriptor (if pCompressionDescriptor is not NULL). On output, the variable will receive the actual buffer size required for the current compression descriptor. This parameter must not be NULL.
Error Safety:
Throws an exception if the decompressor has no compression descriptor set or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the compression descriptor).
Thread Safety:
This method is thread-safe.
This method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor method.
Gets the hash of the currently set compression descriptor.
Parameters:
pHash Pointer to the buffer that will receive the compression descriptor hash or NULL if you only want to get the size of the buffer for buffer allocation.
pSizeHash On input, the variable specifies the size of the buffer (in bytes) for the compression descriptor hash (if pHash is not NULL). On output, the variable will receive the actual buffer size required for the current compression descriptor hash. This parameter must not be NULL.
Error Safety:
Throws an exception if the decompressor has no compression descriptor set or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the compression descriptor hash).
Thread Safety:
This method is thread-safe.
This method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor method.
Decompresses the image of the grab buffer provided.
Parameters:
pOutputBuffer Pointer to the buffer that will receive the decompressed image. This parameter must not be NULL.
pSizeOutputBuffer On input, the variable specifies the size of the buffer (in bytes) for the decompressed image (must be larger or equal to the value in the decompressedImageSize field in the CompressionInfo_t struct received via the GetCompressionInfo methods; alternatively, the GetImageSizeForDecompression method can be used to get the image size required for decompression). On output, the variable will receive the actual buffer size required for the decompressed image. This parameter must not be NULL.
pGrabBuffer Pointer to the grab buffer that holds the compressed data. This parameter must not be NULL.
payloadSize Payload size (in bytes) of the data received (must be less or equal to the size of the grab buffer).
Return: Returns the struct with the compression information of the compressed image.
Error Safety:
Throws an exception if the grab buffer does not contain compressed data, the data is corrupt, the image cannot be decompressed, or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the decompressed image).
Thread Safety:
This method is thread-safe.
This method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor method.
The grab buffer provided must contain a compressed image that has been received without errors.
Decompresses the image of the grab result provided.
Parameters:
pOutputBuffer Pointer to the buffer that will receive the decompressed image. This parameter must not be NULL.
pSizeOutputBuffer On input, the variable specifies the size of the buffer (in bytes) for the decompressed image (must be larger or equal to the value in the decompressedImageSize field in the CompressionInfo_t struct received via the GetCompressionInfo methods; alternatively, the GetImageSizeForDecompression method can be used to get the image size required for decompression). On output, the variable will receive the actual buffer size required for the decompressed image. This parameter must not be NULL.
grabResult Grab result that holds the compressed data.
Return: Returns the struct with the compression information about the compressed image.
Error Safety:
Throws an exception if the grab result does not contain compressed data, the data is corrupt, the image cannot be decompressed or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the decompressed image).
Thread Safety:
This method is thread-safe.
This method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor method.
The grab result provided must contain a compressed image that has been received without errors.
Decompresses the image of the grab result provided.
Parameters:
pOutputBuffer Pointer to the buffer that will receive the decompressed image. This parameter must not be NULL.
pSizeOutputBuffer On input, the variable specifies the size of the buffer (in bytes) for the decompressed image (must be larger or equal to the value in the decompressedImageSize field in the CompressionInfo_t struct received via the GetCompressionInfo methods; alternatively, the GetImageSizeForDecompression method can be used to get the image size required for decompression). On output, the variable will receive the actual buffer size required for the decompressed image. This parameter must not be NULL.
grabResultPtr Pointer to grab result that holds the compressed data.
Return: Returns the struct with the compression information about the compressed image.
Error Safety:
Throws an exception if the grab result does not contain compressed data, the data is corrupt, the image cannot be decompressed or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the decompressed image).
Thread Safety:
This method is thread-safe.
This method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor method.
The grab result provided must contain a compressed image that has been received without errors.
Decompresses the image of the grab buffer provided.
Parameters:
destinationImage Image object (e.g., instance of CPylonImage) that will be filled with the decompressed image (will be resized if required).
pGrabBuffer Pointer to the grab buffer that holds the compressed data. This parameter must not be NULL.
payloadSize Payload size (in bytes) of the data received (must be less or equal to the size of the grab buffer).
Return: Returns the struct with the compression information about the compressed image.
Error Safety:
Throws an exception if the grab buffer does not contain compressed data, the data is corrupt, the image cannot be decompressed or the input parameters are invalid.
Thread Safety:
This method is thread-safe.
This method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor method.
The grab buffer provided must contain a compressed image that has been received without errors.
Decompresses the image of the grab result provided.
Parameters:
destinationImage Image object (e.g., instance of CPylonImage) that will be filled with the decompressed image (will be resized if required).
grabResult Grab result that holds the compressed data.
Return: Returns the struct with the compression information about the compressed image.
Error Safety:
Throws an exception if the grab result does not contain compressed data, the data is corrupt, the image cannot be decompressed, or the input parameters are invalid.
Thread Safety:
This method is thread-safe.
This method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor method.
The grab result provided must contain a compressed image that has been received without errors.
Decompresses the image of the grab result provided.
Parameters:
destinationImage Image object (e.g., instance of CPylonImage) that will be filled with the decompressed image (will be resized if required).
grabResultPtr Pointer to grab result that holds the compressed data.
Return: Returns the struct with the compression information about the compressed image.
Error Safety:
Throws an exception if the grab result does not contain compressed data, the data is corrupt, the image cannot be decompressed, or the input parameters are invalid.
Thread Safety:
This method is thread-safe.
This method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor method.
The grab result provided must contain a compressed image that has been received without errors.
Gets the current compression descriptor from the camera's node map.
Parameters:
pCompressionDescriptor Pointer to the buffer that will receive the compression descriptor or NULL if you only want to get the size of the buffer for buffer allocation.
pSizeCompressionDescriptor On input, the variable specifies the size of the buffer (in bytes) for the compression descriptor (if pCompressionDescriptor is not NULL). On output, the variable will receive the actual buffer size required for the current compression descriptor. This parameter must not be NULL.
nodeMap Node map of the camera to be used for retrieving the compression descriptor.
Error Safety:
Throws an exception if compression is not enabled in the camera (or unavailable) or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the compression descriptor).
Thread Safety:
This method is thread-safe.
This method requires image compression to be enabled in the camera. You can determine this via the GetCompressionMode method.
Computes the hash for a given compression descriptor.
Parameters:
pHash Pointer to the buffer that will receive the compression descriptor hash or NULL if you only want to get the size of the buffer for buffer allocation.
pSizeHash On input, the variable specifies the size of the buffer (in bytes) for the compression descriptor hash (if pHash is not NULL). On output, the variable will receive the actual buffer size required for the current compression descriptor hash. This parameter must not be NULL.
pCompressionDescriptor Pointer to the compression descriptor. This parameter must not be NULL.
sizeCompressionDescriptor Size of the data (in bytes) of the compression descriptor.
Error Safety:
Throws an exception if the input parameters are invalid (e.g., if the size provided is not sufficient to hold the compression descriptor hash).
Gets the hash of the current compression descriptor from the camera's node map.
Parameters:
pHash Pointer to the buffer that will receive the compression descriptor hash or NULL if you only want to get the size of the buffer for buffer allocation.
pSizeHash On input, the variable specifies the size of the buffer (in bytes) for the compression descriptor hash (if pHash is not NULL). On output, the variable will receive the actual buffer size required for the current compression descriptor hash. This parameter must not be NULL.
nodeMap Node map of the camera to be used for retrieving the compression descriptor hash.
Error Safety:
Throws an exception if compression is not active in the camera (or unavailable) or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the compression descriptor hash).
Thread Safety:
This method is thread-safe.
This method requires image compression to be enabled in the camera. You can determine this via the GetCompressionMode method.
Gets the hash of the compression descriptor that is required for decompressing the grab buffer provided.
Parameters:
pHash Pointer to the buffer that will receive the compression descriptor hash or NULL if you only want to get the size of the buffer for buffer allocation.
pSizeHash On input, the variable specifies the size of the buffer (in bytes) for the compression descriptor hash (if pHash is not NULL). On output, the variable will receive the actual buffer size required for the current compression descriptor hash. This parameter must not be NULL.
pGrabBuffer Pointer to the grab buffer that holds the compressed data. This parameter must not be NULL.
payloadSize Payload size (in bytes) of the data received (must be less or equal to the size of the grab buffer).
endianness Endianness of the grab buffer's content. If not known, auto detection can be used.
Error Safety:
Throws an exception if the grab buffer does not contain compressed data, the data is corrupt, or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the compression descriptor hash).
Gets the hash of the compression descriptor that is required for decompressing the grab result provided.
Parameters:
pHash Pointer to the buffer that will receive the compression descriptor hash or NULL if you only want to get the size of the buffer for buffer allocation.
pSizeHash On input, the variable specifies the size of the buffer (in bytes) for the compression descriptor hash (if pHash is not NULL). On output, the variable will receive the actual buffer size required for the current compression descriptor hash. This parameter must not be NULL.
grabResult Grab result that holds the compressed data.
endianness Endianness of the grab result content. If not known, auto detection can be used.
Error Safety:
Throws an exception if the grab result does not contain compressed data, the data is corrupt, or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the compression descriptor hash).
Gets the hash of the compression descriptor that is required for decompressing the grab result provided.
Parameters:
pHash Pointer to the buffer that will receive the compression descriptor hash or NULL if you only want to get the size of the buffer for buffer allocation.
pSizeHash On input, the variable specifies the size of the buffer (in bytes) for the compression descriptor hash (if pHash is not NULL). On output, the variable will receive the actual buffer size required for the current compression descriptor hash. This parameter must not be NULL.
grabResultPtr Pointer to grab result that holds the compressed data.
endianness Endianness of the grab result content. If not known, auto detection can be used.
Error Safety:
Throws an exception if the grab result does not contain compressed data, the data is corrupt, or the input parameters are invalid (e.g., if the size provided is not sufficient to hold the compression descriptor hash).