LEADTOOLS provides several functions for compressing and decompressing images in buffers.
To begin the compression process, the L_StartCompressBuffer function must be called. This function initializes the compression engine, sets the characteristics such as compression factor and output type for the compression, and establishes the COMPBUFFCALLBACK callback that will handle the compressed data. Compression is actually carried out by calling L_CompressBuffer. Once the L_CompressBuffer function is called, the COMPBUFFCALLBACK function is called each time the buffer is filled with compressed data, or when the compression is complete. When compression is completed, the data variables and buffers allocated by the L_StartCompressBuffer and L_CompressBuffer functions should be freed by calling L_EndCompressBuffer.
To begin the decompression process, the L_StartDecompressBuffer function must be called. This function initializes the decompression engine and establishes characteristics of the decompression, such as whether strips or tiles will be decompressed, the format of the image, the view perspective, the load order, and where to place the decompressed image. For more information about the decompression characteristics set by this function, refer to the STARTDECOMPRESSDATA structure. For each strip or tile to be decompressed, the L_DecompressBuffer function must be called. When decompression is completed, data variables and buffers allocated by the L_StartDecompressBuffer and L_DecompressBuffer functions should be freed by calling L_StopDecompressBuffer.
TWAIN buffer transfers can return data in raw compressed form. These functions provide a means of decompressing this data. Consequently, these functions only work for certain file types. These file types and the corresponding TWAIN constant are given below:
|LEAD file constant||TWAIN constant|
(Document and Medical Imaging toolkits)
LEADTOOLS provides functionality for compressing and decompressing ABIC images in buffers.
To begin the compression process, the L_EncodeABIC function must be called. This compresses the input raw data to 1-bit bi-level or 4-bit grayscale data using the ABIC encoder.
To begin the decompression process, the L_DecodeABIC function must be called. This function decompresses the input 1-bit bi-level or 4-bit grayscale ABIC raw data using the ABIC decoder.
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries