Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
LOADFILEOPTION
typedef struct _LOADFILEOPTION
{
L_UINT uStructSize;
L_INT XResolution;
L_INT YResolution;
L_UINT Flags;
L_INT Passes;
L_INT PageNumber;
L_UINT GlobalLoop;
L_SIZE_T IFD;
L_UINT uRedScan;
L_UINT uGreenScan;
L_UINT uBlueScan;
} LOADFILEOPTION, * pLOADFILEOPTION;
The LOADFILEOPTION structure specifies options for reading or writing an image file.
The following functions make use of this structure:
LFileSettings::GetLoadResolution
See LBaseFile::GetDefaultLoadFileOption for information on default load options.
Member |
Description |
|
uStructSize |
Size of the LOADFILEOPTION structure. This should be sizeof(LOADFILEOPTION). .You must fill this member. |
|
XResolution |
Horizontal dots per inch. (Used only with LBitmapBase::Initialize.) |
|
YResolution |
Vertical dots per inch. (Used only with LBitmapBase::Initialize.) |
|
Flags |
Any of the following flags. (You can use a bitwise OR to specify more than one value.) |
|
|
Value |
Meaning |
|
ELO_REVERSEBITS |
[0x00000001] Reverses the bit order when writing CCITT Group 3 and 4 files, so that the least significant bit (LSB) is first. |
|
ELO_GLOBALBACKGROUND |
[0x00000002] Causes a GIF file to be saved with the global background color specified by the GlobalBackground field. |
|
ELO_GLOBALPALETTE |
[0x00000004] Causes a GIF file to be saved with the global palette specified by the GlobalPalette field. |
|
ELO_GLOBALLOOP |
[0x00000008] Enables looping when loading an animated file. This flag must be on for the GlobalLoop field to be used. |
|
ELO_ROTATED |
[0x00000010] Loads files without rotating them. This affects files that can be saved with a rotated view perspective. For more information refer to Accounting for View Perspective. |
|
ELO_IGNOREVIEWTRANSFORMS |
[0x00000020] Causes a Flash-Pix file to be loaded without being modified by the viewing transforms. |
|
ELO_IGNORECOLORTRANSFORMS |
[0x00000040] Causes a Flash-Pix file to be loaded without being modified by the color transforms. |
|
ELO_SIGNED |
[0x00000080] Indicates the bitmap can contain negative pixel values. |
|
ELO_DISABLEMMX |
[0x00000100] Do not use MMX optimized code |
|
ELO_DISABLEP3 |
[0x00000200] Do not use P3 specific optimized code. |
|
ELO_USEIFD |
[0x00000400] Use the IFD offset. |
|
ELO_FORCECIELAB |
[0x00000800] (JPEG only) The file has CIELAB colorspace |
|
ELO_USEBADJPEGPREDICTOR |
[0x00001000] (JPEG only) Load lossless JPEG file using an incorrect predicto |
|
ELO_IGNOREPHOTOMETRICINTERP |
[0x00002000] (TIFF only) Use RGB colorspace instead of the PhotometricInterpretation stored in the file. Use this to disable the color conversion to RGB during the load process. |
|
ELO_FORCERGBFILE |
[0x00004000] (JPEG only) The file has RGB colorspace. |
|
ELO_MULTISPECTRALSCAN |
[0x00008000] Use uXXXScan values info when loading NITF files. |
|
ELO_NOPALETTE |
[0x00010000] Use the new palette mechanism. Do not use GDI memory to store the palette. |
|
ELO_IGNOREVIEWPERSPECTIVE |
[0x00200000] (TIF and Exif only) Ignore the view perspective stored in the file: load the file as TOP_LEFT. If you are loading a TIFF or Exif file that looks rotated or flipped, try setting this flag before loading the file. |
|
ELO_USEFASTCONVERSION |
[0x00400000] (TIF and JPEG only) Use the fast color conversions when loading CMYK or CIELab files. Setting this flag will greatly speed up the loading of CMYK and CIELab files, but it will reduce the image quality. |
|
ELO_ALPHAINIT |
[0x01000000] Initializes the alpha channel for 32 or 64-bit color images to all ones (0xFF for 8-bit alpha channels and 0xFFFF for 16-bit alpha channels). Without this flag, a created alpha channel will be initialized to zeros. |
|
ELO_LOADCORRUPTED |
[0x00010000] Attempt to load corrupted files. |
|
ELO_NITF_USE_MAX |
[0x00040000] (NITF Only) Use the maximum width and height. |
|
ELO_NITF_USE_MONODARK |
[0x00080000] (NITF Only) Use the mono dark process (to brighten the resulting bitmap). |
|
ELO_NITF_SHOW_OBJECT |
[0x00100000] (NITF Only) Make the object CGM available if it exists. |
Passes |
The number of passes (scans through the image) when loading or saving a progressive JPEG or LEAD CMP file. (This value is also used when loading, but not when saving, interlaced PNG files.) (This value is also used when loading JBIG files to determine the number of resolutions to load to create a progressive load effect.) |
|
|
|
Possible values when loading a progressive file: |
|
Value |
Meaning |
|
Any positive number |
The LFile::LoadFileCallBack function is called the specified number of times. |
|
CALLBACK_ONCE |
[0] The LFile::LoadFileCallBack function is called only once at the end. |
|
CALLBACK_WHEN_MEANINGFUL |
[-1] The LFile::LoadFileCallBack function is called only on significant scans. (This is usually the best option.) |
|
CALLBACK_ALWAYS |
[-2] The LFile::LoadFileCallBack function is called for the default number of scans. |
PageNumber |
The page number of a multipage file, which can contain more than one image. When loading a file, this is the exact page number. When saving a file, any value greater than 1 will cause the page to be appended to the end of the file. For more information on multipage files refer to Multipage File Formats. |
|
GlobalLoop |
Loop count when playing an animation. Use 0 for continuous looping. For no looping, turn off the EFO_GLOBALLOOP flag in the Flags field. |
|
IFD |
Offset within a TIFF file where a page starts. This serves as a reference page for loading pages to a large TIFF file. |
|
uRedScan |
(NITF only) Index of the scan to be loaded for the red component. Used only if ELO_MULTISPECTRALSCAN is set. |
|
uGreenScan |
(NITF only) Index of the scan to be loaded for the green component. Used only if ELO_MULTISPECTRALSCAN is set. |
|
uBlueScan |
(NITF only) Index of the scan to be loaded for the blue component. Used only if ELO_MULTISPECTRALSCAN is set. |
Comments
pLOADFILEOPTION is a pointer to an LOADFILEOPTION structure. Where the function parameter type is pLOADFILEOPTION, you can declare a LOADFILEOPTION variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pLOADFILEOPTION variable is necessary only if your program requires a pointer.
To load a stamp image, you must use the LFile::ReadStamp function.
If EFO_SIGNED is set, the bitmap can contain negative pixel values. This can cause the image to be incorrectly painted when it is loaded. In order to load correctly, you must call LBitmapBase::ClearNegativePixels before loading the image. If EFO_SIGNED is not set, any negative pixels in the image will be cleared internally.
Note: When loading JBIG files, the behavior is as follows:
1) If only one resolution exists in the JBIG File, then the LFile::LoadFileCallBack function will be called with the image data for that resolution as it is decompressed.
2) If the image contains more than one resolution and (Passes >= nResolutions, where nResolutions is the number of resolutions present in the file) then the LFile::LoadFileCallBack function will be called with the image data from the lowest resolution available in the file. The data that gets passed to the callback and/or inserted into the bitmap handle will be padded to the remaining width (that is, the size of the last resolution available in the file) with 0s. This will be repeated nResolution times, until the entire image (that is, the last resolution available) is loaded. Setting nPasses to CALLBACK_WHEN_MEANINGFUL or CALLBACK_ALWAYS has the same effect.
3) If the image contains more than one resolution and (Passes is < nResolutions) then the process is the same as in case 2, except loading starts with the first resolution available, continues with the 2nd resolution, and so on, up to resolution Passes-1, and then loading is completed with the decompression of the last resolution available in the file.
Note: For information about loading and saving large TIFF files faster, refer to Loading and Saving Large Tiff Files.
ELO_MULTISPECTRALSCAN is used internally by the NITF filter. You do not need to use this flag.