Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
typedef struct _LOADINFO
{
L_UINT uStructSize;
L_INT Format;
/* File format */
L_INT Width; /* Image width */
L_INT Height; /* Image height */
L_INT BitsPerPixel; /* Bits per pixel */
L_INT XResolution; /* X resolution (DPI) */
L_INT YResolution; /* Y resolution (DPI) */
L_SIZE_T Offset; /* Data offset */
L_UINT Flags; /* Special flags */
L_RGBQUAD rgbQuad[256]; /* palette */
L_UINT rgbColorMask[3]; /* RGB color masks */
L_UINT32 uStripSize; /* strip size before decompression */
L_INT nPhotoInt; /* color information */
L_INT nPlanarConfig; /* planar configuration information */
} LOADINFO, * pLOADINFO;
The LOADINFO structure provides file format information to the LBase::LoadInfoCallBack function, which you can use when loading image data in a format that LEADTOOLS does not recognize.
Member |
Description |
|
uStructSize |
Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value. |
|
Format |
File format. The following are valid formats: |
|
|
Value |
Meaning |
|
FILE_FAX_G3_1D |
[66] Raw FAX, compressed using CCITT group 3, 1 dimension. |
|
FILE_FAX_G3_2D |
[67] Raw FAX, compressed using CCITT group 3, 2 dimensions. |
|
FILE_FAX_G4 |
[68] Raw FAX, compressed using CCITT group 4. |
|
FILE_RAW |
[153] Raw uncompressed data |
|
FILE_RAW_RLE4 |
[157] Raw RLE4 compressed, 4 bit data. (Read only) |
|
FILE_RAW_RLE8 |
[158] Raw RLE8 compressed, 8 bit data. (Read only) |
|
FILE_RAW_BITFIELDS |
[159] Raw BITFIELD data, 16 or 32-bit data. (Read only) |
|
FILE_RAW_PACKBITS |
[160] Raw PackBits compression. (Read only) |
Width |
Image width in pixels. |
|
Height |
Image height in pixels. |
|
BitsPerPixel |
Bits per pixel of the image data in the file. |
|
XResolution |
Horizontal resolution for rendering the image, specified in dots per inch. This is an optional field. |
|
YResolution |
Vertical resolution for rendering the image, specified in dots per inch. This is an optional field. |
|
Offset |
Position of the first byte of image data. This can be 0 if your file does not have a header. |
|
Flags |
Special flags, which can be specified as follows. You can use a bitwise OR to specify more than one value. Possible values are: |
|
|
Value |
Meaning |
|
LOADINFO_TOPLEFT |
[0x00000001] The image has a TOP_LEFT view perspective. |
|
LOADINFO_ORDERRGB |
[0x00000002] The color order is RGB. If the bitmap is a 16-bit value, it is in the 555 format (uses 5 bits each for red, green and blue and the highest bit for alpha). |
|
LOADINFO_ORDERRGB565 |
[0x00040000] The color order is RGB 565: it uses 5 bits for red, 6 bits for green, and 5 bits for blue. |
|
LOADINFO_WHITEONBLACK |
[0x00000004] The image is white-on-black. |
|
LOADINFO_LSB |
[0x00000008] The least significant bit is filled first. |
|
LOADINFO_TOPLEFT90 |
[0x00000010] The image has a TOP_LEFT90 view perspective. ( Imaging toolkits) |
|
LOADINFO_TOPLEFT270 |
[0x00000020] The image has a TOPLEFT270 view perspective. ( Imaging toolkits) |
|
LOADINFO_REVERSE |
[0x00000040] Each line is reversed (mirrored). |
|
LOADINFO_TOPLEFT180 |
[0x00000080] The image has a TOP_LEFT180 view perspective. ( Imaging toolkits) |
|
LOADINFO_BOTTOMLEFT90 |
[0x00000100] The image has a BOTTOM_LEFT90 view perspective. ( Imaging toolkits) |
|
LOADINFO_BOTTOMLEFT180 |
[0x00000200] The image has a BOTTOM_LEFT180 view perspective. ( Imaging toolkits) |
|
LOADINFO_BOTTOMLEFT270 |
[0x00000400] The image has a BOTTOM_LEFT270 view perspective. ( Imaging toolkits) |
|
LOADINFO_PAD4 |
[0x00000800] Each line is padded to a multiple of 4 bytes. (raw data only) |
|
LOADINFO_PALETTE |
[0x00001000] A palette is supplied in the rgbQuad field. (raw data only) |
|
LOADINFO_BITFIELDS |
[0x00002000] 3 color masks are specified in the rgbColorMask field. This is for raw Bitfield compressed data only. |
|
LOADINFO_ORDERGRAY |
[0x00004000] Image is grayscale. |
|
LOADINFO_MOTOROLAORDER |
[0x00008000] Image bytes are in Motorola byte order. Valid only for 16, 48 and 64-bit.) |
|
LOADINFO_ORDERROMM |
[0x00010000] The color order is ROMM. Valid only for 24 and 48-bit.) |
|
LOADINFO_SIGNED |
[0x00020000] The image data is signed raw data. |
rgbQuad |
Palette for uncompressed data that is 8 bits per pixel or less. Fill in the first 2 BitsPerPixel entries in this palette and include the LOADINFO_PALETTE flag in the Flags field. |
|
rgbColorMask |
Array of RGB color masks used with raw, Bitfield compressed data. |
|
uStripSize |
Size of the data strip before it is decompressed. |
|
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 Format is FILE_RAW_PACKBITS. Otherwise, it is ignored. Possible values are: |
|
|
Value |
Meaning |
|
1 |
Chunky |
|
2 |
Planar format |
Comments
pLOADINFO is a pointer to a LOADINFO structure. Where the function parameter type is pLOADINFO, you can declare a LOADINFO variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pLOADINFO variable is necessary only if your program requires a pointer.
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.
LOADINFO_TOPLEFT, LOADINFO_TOPLEFT90 and LOADINFO_TOPLEFT270 cannot be combined.
LOADINFO_REVERSE can be combined with LOADINFO_TOPLEFT, LOADINFO_TOPLEFT90 or LOADINFO_TOPLEFT270. If LOADINFO_REVERSE is set, every line is reversed before being put into the bitmap.
To load a raw fax file, you must provide a LBase::LoadInfoCallBack . If you recognize the file and you know the height and width of the file, set LOADINFO.Width and LOADINFO.Height to a positive value. To automatically detect the width and height of the fax file, set LOADINFO.Width and LOADINFO.Height to -1.
To load raw uncompressed data, set the Format field to FILE_RAW. Valid values must be set for the following LOADINFO fields: Width, Height, BitsPerPixel, Offset (byte location in the file where the raw data begins). If each line of RAW data is padded so that the number of bytes is a multiple of 4 (as is the case with raw Windows BMP data), include LOADINFO_PAD4 in the Flags field. Include an orientation flag in the Flags field to load the data with the proper orientation. For example, raw Windows BMP data is stored with a BOTTOM_LEFT orientation. If the orientation is unknown, include the TOP_LEFT flag. If the raw data is 8 bits per pixel or less, then the image is palettized and a palette must be generated. If this is the case, include the LOADINFO_PALETTE flag, and fill in the first (2 bits per pixel) entries of the rgbQuad field.
If the color order is RGB then include LOADINFO_ORDERRGB or LOADINFO_ORDERRGB565. If either of the LOADINFO_ORDERRGB or LOADINFO_ORDERRGB565 flags are not included, the data will be loaded as ORDER_BGR.