LBase::LoadInfoCallBack

#include "ltwrappr.h"

virtual L_INT LBase::LoadInfoCallBack(fd, pInfo)

Handles input data that is in a format (such as raw FAX) that LEADTOOLS cannot recognize.

Parameters

L_HFILE fd

The Windows file handle of the file to load.

pLOADINFO pInfo

Pointer to the LOADINFO structure that supplies information about the file that LEADTOOLS needs.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Override this function if you wish to handle unrecognized image data.

This function also loads raw FAX data (CCITT Group 3 or Group 4) or raw uncompressed data.

This function handles input data that is in a format (such as raw FAX) that LEADTOOLS cannot recognize. This function will be called only if the load info callback is enabled. When loading an image from a file, a LEADTOOLS function normally determines the file format from the file header, and if the format is unrecognized, the function returns an error. You can override this function to change that behavior by supplying the information that LEADTOOLS needs when loading an image from a file.

To load raw uncompressed data, you must override LBase::LoadInfoCallBack. Set the LOADINFO.Format field to FILE_RAW. Valid values must also be set for the following LOADINFO fields: Width, Height, BitsPerPixel, Offset (byte location in file where 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 LOADINFO.Flags field. Include an orientation flag in the LOADINFO.Flags field to load 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.

To supply the needed information, refer to the LOADINFO structure description.

Note: More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

For an example, refer to LFile::StartFeedLoad.

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.