Syntax
 

PXL_RETURN_CODE PxLDecompressFrame (
  void const*				pSrcFrame,
  FRAME_DESC const*			pSrcFrameDesc,
  COMPRESSION_DESC const*	pCompressionDesc,
  LPVOID					pDestBuffer,
  U32*						pDestBufferSize);

 

Description


This function converts a compressed frame of image data to a decompressed frame and stores it in a buffer.

  • pSrcFrame is the pointer to the buffer containing a compressed frame of image data. This buffer must be aligned on a 64-byte boundary.

  • pSrcFrameDesc is the pointer to a frame descriptor (see FRAME_DESC structure). The structure is also defined in the file PixelinkTypes.h.

  • pCompressionDesc is the pointer to a compression descriptor.

  • pDestBuffer is the pointer to the destination buffer receiving the uncompressed frame of image data. This buffer must be aligned on a 64-byte boundary. Set to NULL to return the required output buffer size in pDestBufferSize.

  • pDestBufferSize points to the size of the pDestBuffer buffer (in bytes). On output, the function returns the actual buffer size in this parameter.



Usage


Recommended method of using PxLDecompressFrame:

  1. Call the function with pDestBuffer set to NULL. The required size of the destination buffer is returned in pDestBufferSize.

  2. Allocate the required number of bytes of memory to the destination buffer.

  3. Call the function with pDestBuffer set to point to the allocated destination buffer.


Comments, Restrictions and Limitations


Output buffer size

Prior to calling this function, sufficient memory space should be allocated to the destination buffer. If the destination buffer is too small, the application will return an ApiBufferTooSmall message.


Regardless of the return code generated, PxLDecompressFrame will return the size of the output frame in pDestBufferSize, so to determine the appropriate amount of the memory to be allocated to the destination buffer without running the risk of generating an error message, call PxLDecompressFrame with pDestBuffer set to NULL. The required number of bytes will be returned in pDestBufferSize, and the destination buffer can be allocated prior to calling the function with pDestBuffer pointing at the buffer location. 


Input buffer size

The size of the input buffer is assumed to be the size of the uncompressed frame (width × height × number of bytes per pixel, where width and height take the pixel addressing value into account). These settings for the uncompressed frame can be found in the supplied pSrcFrameDesc. For more information, go to FRAME_DESC structure (defined in the file PixelinkTypes.h).