This website is being translated through machine translation by a third-party service. Basler does not warrant the accuracy, reliability or timeliness of any information translated by this system and will not accept liability for loss or damage incurred as a result. Content that has not yet been translated appears in English. Switch to English version
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 one of the ComputeCompressionDescriptorHash methods 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 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 rate. The image can be decompressed if CompressionStatus is 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.
Type: System.IntPtr 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.
sizeHash
Type: System.Int32 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.
pCompressionDescriptor
Type: System.IntPtr Pointer to the compression descriptor. This parameter must not be null.
sizeCompressionDescriptor
Type: System.Int32 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).
Type: System.IntPtr Pointer to the buffer that will receive the decompressed image. This parameter must not be null.
sizeOutputBuffer
Type: System.Int32 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 struct received via the GetCompressionInfo methods; alternatively, the GetImageSizeForDecompression(ICamera) 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.
grabResult
Type: Basler.Pylon.IGrabResult Grab result that holds the compressed data. This parameter must not be null.
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 property.
The grab result provided must contain a compressed image that has been received without errors.
Thread Safety: This method is thread-safe.
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).
Type: System.IntPtr Pointer to the buffer that will receive the decompressed image. This parameter must not be null.
sizeOutputBuffer
Type: System.Int32 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 struct received via the GetCompressionInfo methods; alternatively, the GetImageSizeForDecompression(ICamera) 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.
pGrabBuffer
Type: System.IntPtr Pointer to the grab buffer that holds the compressed data. This parameter must not be null.
payloadSize
Type: System.Int32 Payload size (in bytes) of the data received (must be less or equal to the size of the grab buffer).
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 property.
The grab buffer provided must contain a compressed image that has been received without errors.
Thread Safety: This method is thread-safe.
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).
Type: T[] The array (one-dimensional) that will receive the decompressed image. The size of the array (in bytes) must be larger or equal to the value in the DecompressedImageSize field in the CompressionInfo struct received via the GetCompressionInfo methods. Alternatively, the GetImageSizeForDecompression(ICamera) method can be used to get the image size required for decompression. Keep in mind that the size of the array (in bytes) is calculated by multiplying the length of the array with the size of the array's elements. This parameter must not be null.
grabResult
Type: Basler.Pylon.IGrabResult Grab result that holds the compressed data. This parameter must not be null.
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 property.
The grab result provided must contain a compressed image that has been received without errors.
Thread Safety: This method is thread-safe.
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).
Type: T[] The array (one-dimensional) that will receive the decompressed image. The size of the array (in bytes) must be larger or equal to the value in the DecompressedImageSize field in the CompressionInfo struct received via the GetCompressionInfo methods. Alternatively, the GetImageSizeForDecompression(ICamera) method can be used to get the image size required for decompression. Keep in mind that the size of the array (in bytes) is calculated by multiplying the length of the array with the size of the array's elements. This parameter must not be null.
pGrabBuffer
Type: System.IntPtr Pointer to the grab buffer that holds the compressed data. This parameter must not be null.
payloadSize
Type: System.Int32 Payload size (in bytes) of the data received (must be less or equal to the size of the grab buffer).
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 property.
The grab buffer provided must contain a compressed image that has been received without errors.
Thread Safety: This method is thread-safe.
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).
This method requires image compression to be enabled in the camera. You can determine this via the GetCompressionMode(ICamera) method.
Thread Safety: This method is thread-safe.
Error Safety: Throws an exception if compression is not enabled in the camera (or unavailable) or an error is encountered while determining the compression descriptor.
This method requires image compression to be enabled in the camera. You can determine this via the GetCompressionMode(ICamera) method.
Thread Safety: This method is thread-safe.
Error Safety: Throws an exception if compression is not enabled in the camera (or unavailable) or an error is encountered while determining the compression descriptor hash.
Type: System.IntPtr 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.
sizeHash
Type: System.Int32 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.
pGrabBuffer
Type: System.IntPtr Pointer to the grab buffer that holds the compressed data. This parameter must not be null.
payloadSize
Type: System.Int32 Payload size (in bytes) of the data received (must be less or equal to the size of the grab buffer).
endianness
Type: Basler.Pylon.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).
Type: System.IntPtr 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.
sizeHash
Type: System.Int32 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 method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor property.
Thread Safety: This method is thread-safe.
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).
Type: System.IntPtr 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.
sizeHash
Type: System.Int32 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.
camera
Type: Basler.Pylon.ICamera Camera to be used for retrieving the compression descriptor hash. This parameter must not be null.
This method requires image compression to be enabled in the camera. You can determine this via the GetCompressionMode(ICamera) method.
Thread Safety: This method is thread-safe.
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 hash).
Type: System.IntPtr 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.
sizeHash
Type: System.Int32 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.
grabResult
Type: Basler.Pylon.IGrabResult Grab result that holds the compressed data. This parameter must not be null.
This method will try to auto detect the endianness of the grab result's content.
Thread Safety: This method is thread-safe.
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).
Type: System.IntPtr 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.
sizeHash
Type: System.Int32 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.
grabResult
Type: Basler.Pylon.IGrabResult Grab result that holds the compressed data. This parameter must not be null.
endianness
Type: Basler.Pylon.Endianness Endianness of the grab result's 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).
Type: System.IntPtr 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.
sizeHash
Type: System.Int32 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.
pGrabBuffer
Type: System.IntPtr Pointer to the grab buffer that holds the compressed data. This parameter must not be null.
payloadSize
Type: System.Int32 Payload size (in bytes) of the data received (must be less or equal to the size of the grab buffer).
This method will try to auto detect the endianness of the grab buffer's content.
Thread Safety: This method is thread-safe.
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).
Type: System.IntPtr 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.
sizeCompressionDescriptor
Type: System.Int32 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 method requires that a compression descriptor has been set previously via the constructor or the SetCompressionDescriptor methods. You can determine this via the HasCompressionDescriptor property.
Thread Safety: This method is thread-safe.
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).
Type: System.IntPtr 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.
sizeCompressionDescriptor
Type: System.Int32 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.
camera
Type: Basler.Pylon.ICamera Camera to be used for retrieving the compression descriptor. This parameter must not be null.
This method requires image compression to be enabled in the camera. You can determine this via the GetCompressionMode(ICamera) method.
Thread Safety: This method is thread-safe.
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).
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).
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).
Error Safety: Throws an exception if no memory can be allocated.
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).
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).
Error Safety: When setting the property, 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). When getting the property, throws an exception if the decompressor has no compression descriptor set.