LEADTOOLS Raster Imaging C DLL Help > LEADTOOLS Raster Imaging Features > Loading and Saving Images > Used Structures > STARTDECOMPRESSDATA |
typedef struct _STARTDECOMPRESSDATA
{
L_UINT uStructSize;
pBITMAPHANDLE pBitmap;
L_UINT uBitmapStructSize;
L_UINT uStripsOrTiles;
L_UINT uFormat;
L_INT nWidth;
L_INT nHeight;
L_INT nBitsPerPixel;
L_INT nViewPerspective;
L_INT nRawOrder;
L_INT nLoadOrder;
L_INT nXResolution;
L_INT nYResolution;
FILEREADCALLBACK pfnReadCallback;
L_RGBQUAD Palette[256];
L_UINT uFlags;
L_VOID* pUserData;
L_UINT rgbColorMask[3];
L_INT nPhotoInt;
L_INT nPlanarConfig;
L_UINT uReserved1;
} STARTDECOMPRESSDATA, *pSTARTDECOMPRESSDATA;
The STARTDECOMPRESSDATA structure provides decompression to the L_StartDecompressBuffer function.
Member |
Description |
|
uStructSize |
Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value. |
|
pBitmap |
Pointer to the bitmap handle in which to load the image. |
|
uBitmapStructSize |
Size of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE). |
|
uStripsOrTiles |
Flag that indicates whether strips or tiles are being decompressed. Strips have a width equal to the bitmap width, but tiles can have a width that is less than the bitmap width. Possible values are: |
|
|
Value |
Meaning |
|
DECOMPRESS_STRIPS |
Decompress strips of data. |
|
DECOMPRESS_TILES |
Decompress tiles of data. The pfnReadCallback is not called if this option is set. |
uFormat |
Format of the image to decompress. Possible values are: |
|
|
Value |
Meaning |
|
FILE_JPEG |
JPEG file |
|
FILE_RAW_RLE4 |
RAW file with RLE compression, 4 bits per pixel |
|
FILE_RAW_RLE8 |
RAW file with RLE compression, 8 bits per pixel |
|
FILE_RAW_BITFIELDS |
RAW file with bitfield compression |
|
FILE_RAW_PACKBITS |
RAW file with packed bits compression |
|
FILE_RAW_CCITT |
RAW file with CCITT compression. |
|
FILE_FAX_G3_1D |
Fax file with G3 one-dimensional compression |
|
FILE_FAX_G3_2D |
Fax file with G3 two-dimensional compression |
|
FILE_FAX_G4 |
Fax file with G4 compression |
nWidth |
Bitmap width. |
|
nHeight |
Bitmap height. |
|
nBitsPerPixel |
Bits per pixel of the compressed data. |
|
nViewPerspective |
View perspective of the compressed data. Possible values are: |
|
|
Value |
Meaning |
|
TOP_LEFT |
Top-left of image is first in memory. |
|
TOP_LEFT90 |
TOP_LEFT rotated clockwise by 90 degrees. |
|
TOP_LEFT180 |
TOP_LEFT rotated clockwise by 180 degrees. |
|
TOP_LEFT270 |
TOP_LEFT rotated clockwise by 270 degrees. |
|
BOTTOM_LEFT |
Bottom-left of image is first in memory. |
|
BOTTOM_LEFT90 |
BOTTOM_LEFT rotated clockwise by 90 degrees. |
|
BOTTOM_LEFT180 |
BOTTOM_LEFT rotated clockwise by 180 degrees. |
|
BOTTOM_LEFT270 |
BOTTOM_LEFT rotated clockwise by 270 degrees |
nRawOrder |
Color order of 24-bit raw data. This is ignored if the image is palettized. Possible values are: |
|
|
Value |
Meaning |
|
ORDER_RGB |
RGB |
|
ORDER_BGR |
BGR |
nLoadOrder |
Desired color order after a 24-bit image is loaded. This is ignored if the image is palettized. Possible values are: |
|
|
Value |
Meaning |
|
ORDER_RGB |
RGB |
|
ORDER_BGR |
BGR |
nXResolution |
Horizontal resolution, in dots per inch. |
|
nYResolution |
Vertical resolution, in dots per inch. |
|
pfnReadCallback |
Optional callback function for additional processing. |
|
|
If you do not provide a callback function, use NULL as the value of this parameter. |
|
|
If you do provide a callback function, use the function pointer as the value of this parameter. |
|
|
The callback function must adhere to the function prototype described in FILEREADCALLBACK Function. |
|
Palette |
Palette for uncompressed data that is 8 bits per pixel or less. Fill in the first 2BitsPerPixel entries in this palette and include DECOMPRESS_PALETTE in the uFlags field. |
|
uFlags |
Flags that affect the decompression process. Possible values are: |
|
|
Value |
Meaning |
|
DECOMPRESS_LSB |
Fill the least significant bit first. |
|
DECOMPRESS_PAD4 |
Pad each line to a multiple of 4 bytes. |
|
DECOMPRESS_PALETTE |
A palette is supplied in the rgbQuad field. |
pUserData |
Void pointer that you can use to pass one or more additional parameters that the callback function needs. |
|
|
To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. |
|
|
If the additional parameters are not needed, you can pass NULL in this parameter. |
|
rgbColorMask |
An array of L_UINT32 values that represent RGB color masks. rgbColorMask[0] is the red mask; rgbColorMask[1] is the green mask; rgbColorMask[2] is the blue mask. This field is valid only if uFormat is FILE_RAW_BITFIELDS. |
|
nPhotoInt |
Value that represents color information. Possible values are: |
|
|
Value |
Meaning |
|
For FILE_RAW_CCITT |
|
|
FILE_RAW_G3_1D, |
|
|
FILE_RAW_G3_2D and |
|
|
FILE_FAX_G4 |
|
|
0 |
White is zero |
|
1 |
Black is zero |
|
For FILE_RAW_PACKBITS: |
|
|
2 |
There is no color map (RGB) |
|
5 |
Separated CMYK |
|
6 |
YC b C r color space |
|
8 |
1976 CIE L*a*b |
nPlanarConfig |
Planar configuration. This value is used only if uFormat is FILE_RAW_PACKBITS. Otherwise, it is ignored. Possible values are: |
|
|
Value |
Meaning |
|
1 |
Chunky |
|
2 |
Planar format |
uReserved1 |
Reserved for future use. Pass 0. |
Comments
As an example, with 16-bit data arranged as RRR RRGG GGGB BBBB, the masks would be:
rgbColorMask[0] = 0x7C00
rgbColorMask[1] = 0x0E30
rgbColorMask[2] = 0x001F
For 32-bit data, the only valid data is RRRR RRRR GGGG GGGG BBBB BBBB. The masks would be:
rgbColorMask[0] = 0xFF0000
rgbColorMask[1] = 0x00FF00
rgbColorMask[2] = 0x0000FF
Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.