LOADINFO
typedef struct _LOADINFO
{
L_UINT uStructSize;
//
use sizeof(LOADINFO)
L_INT Format; /* File
format: FILE_PCX, ... */
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];
// for RAW_PACKBITS
L_UINT32 uStripSize;
// size of strip after compression
L_INT nPhotoInt; //
TIFF tag 0-6 TIFF tag
L_INT nPlanarConfig;
// TIFF tag 1 = Chunky, 2
= Planar format
} 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. For more information, refer to the LBase::EnableLoadInfoCallBack function.
Member |
Description |
uStructSize |
Size of the structure. This should be sizeof(LOADINFO). .You must fill this member. |
Format |
File format. The following are valid formats: |
|
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 |
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. |
|
LOADINFO_TOPLEFT |
[0x00000001] The image has a TOP_LEFT view perspective. |
|
LOADINFO_ORDERRGB |
[0x00000002] The color order is RGB. |
|
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. (Document/Medical only) |
|
LOADINFO_TOPLEFT270 |
[0x00000020] The image has a TOPLEFT270 view perspective. (Document/Medical only) |
|
LOADINFO_REVERSE |
[0x00000040] Each line is reversed (mirrored). |
|
LOADINFO_TOPLEFT180 |
[0x00000080] The image has a TOP_LEFT180 view perspective. (Document/Medical only) |
|
LOADINFO_BOTTOMLEFT90 |
[0x00000100] The image has a BOTTOM_LEFT90 view perspective. (Document/Medical only) |
|
LOADINFO_BOTTOMLEFT180 |
[0x00000200] The image has a BOTTOM_LEFT180 view perspective. (Document/Medical only) |
|
LOADINFO_BOTTOMLEFT270 |
[0x00000400] The image has a BOTTOM_LEFT270 view perspective. (Document/Medical only) |
|
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.
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 override 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 (2BitsPerPixel) entries of the rgbQuad field.
If the color order is ORDER_RGB then include this flag. If the ORDER_RGB flag is not included, the data will be loaded as ORDER_BGR.