Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
typedef struct _FILEINFO
{
L_UINT uStructSize;
// use sizeof(FILEINFO)
L_INT Format; //
File format: FILE_PCX, ...
L_TCHAR Name[_MAX_FNAME+_MAX_EXT];//
File name, including the Extension
L_INT Width; //
Image width
L_INT Height; //
Image height
L_INT BitsPerPixel;
// Bits per
pixel
L_SSIZE_T SizeDisk;
// Size of
file on disk
L_SSIZE_T SizeMem; //
Size of image in memory
L_TCHAR Compression[20];
// Compression method name
L_INT ViewPerspective;
// Image view perspective
L_INT Order; //
RGB order
L_INT PageNumber; //
Page number
L_INT TotalPages; //
Total number of pages present in the file
L_INT XResolution; //
Resolution along the X axis, in dpi.
L_INT YResolution; //
Resolution along the Y axis, in dpi.
L_UINT Flags; //
identifies file subtypes: progressive, interlaced
L_UINT GlobalLoop; //
Global animation loop count 0 = infinity
L_INT GlobalWidth; //
Global width, in pixels
L_INT GlobalHeight;
// Global
height, in pixels
L_COLORREF GlobalBackground;
// Global background color (see Flags)
L_RGBQUAD GlobalPalette[256];
// Global palette (see Flags)
L_SIZE_T IFD; //
IFD offset (for TIF files only)
L_INT Layers; //
The number of layers in the file
L_INT ColorSpace; //
The colorspace (RGB, CMYK, CIELAB, etc)
L_INT Channels; //
The number of channels in the file
L_BOOL bIsDocFile; //
Is this a DOC file?
L_DOUBLE dDocPageWidth;
// (Only valid for DOC files), the
width in uDocUnit
L_DOUBLE dDocPageHeight;
// (Only valid for DOC files), the height
in uDocUnit
RASTERIZEDOC_UNIT
uDocUnit; // (Only valid for DOC files), the unit of measure
to be used for the width and height
L_BOOL bIsVectorFile; //
Value that indicates whether the file is a vector file
VECTORPARALLELOGRAM VectorParallelogram;
//
Bounding parallelogram for the vector
}FILEINFO, *pFILEINFO;
The FILEINFO structure, which is loaded by the L_FileInfo function, provides information about the specified file.
Note: The LTFIL.H header file describes the entire FILEINFO structure.
Member |
Data Type |
Description |
|
uStructSize |
Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value. |
||
Format |
File format. For possible values, refer to Formats of Input Files. |
||
Name[_MAX_FNAME+_MAX_EXT] |
A character array containing the null-terminated string that is the file name. The name is truncated if it exceeds _MAX_FNAME + _MAX_EXT characters. |
||
Width |
Image width, in pixels. |
||
Height |
Image height, in pixels. |
||
BitsPerPixel |
Bits per pixel. |
||
SizeDisk |
Size of the file on disk (in bytes). |
||
SizeMem |
Amount of memory (in bytes) required to load the file. |
||
Compression[20] |
A 20-character array containing the null-terminated string that describes the compression method. |
||
ViewPerspective |
Where the beginning of the image is stored. Valid values are TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT, TOP_LEFT90, and TOP_LEFT270. For descriptions, refer to Accounting for View Perspective. |
||
Order |
Color order of the bitmap. This field is meaningful if the image does not have a palette. It indicates whether the color values are in red-green-blue or blue-green-red order. Possible values are ORDER_RGB, ORDER_BGR and ORDER_GRAY. |
||
PageNumber |
The page number in a multi-page file. To determine the total number of pages in a file, call L_FileInfo with uFlags set to FILEINFO_TOTALPAGES. |
||
TotalPages |
The total number of pages present in a file. To update this field, call L_FileInfo with uFlags set to FILEINFO_TOTALPAGES. If you do not want this field updated, call L_FileInfo with uFlags set to 0. |
||
XResolution |
Horizontal resolution, in dots per inch. Some file formats save this value in the file header. |
||
YResolution |
Vertical resolution, in dots per inch. Some file formats save this value in the file header. |
||
Flags |
For possible values, refer to FILEINFO Flags. |
||
GlobalLoop |
Global animation loop count. 0 = infinity. This field is valid only if the FILEINFO_HAS_GLOBALLOOP flag is set. |
||
GlobalWidth |
Global width for animation playback |
||
GlobalHeight |
Global height for animation playback |
||
GlobalBackground |
Global background color for animation playback (FILEINFO Flags) |
||
GlobalPalette[256] |
Global palette for animation playback (FILEINFO Flags). |
||
IFD |
Offset within a TIFF file where a page starts. This member is updated when L_FileInfo is called. |
||
Layers |
The number of layers the PSD file contains. 0 if the file is not a PSD file. If a file is a PSD file but it does not have any layers, the number is also 0. Number of layers in the file. If this value is 0, then the file does not contain any layers. Only PSD files can have layers. |
||
ColorSpace |
Color space of the file. The possible values are: |
||
|
|
Value |
Meaning |
|
|
COLORSPACE_BGR |
[0] Color space is RGB or BGR |
|
|
COLORSPACE_YUV |
[1] Color space is YUV or YCbCr |
|
|
COLORSPACE_CMYK |
[2] Color space is CMYK |
|
|
COLORSPACE_CIELAB |
[3] Color space is CIELab |
Channels |
Number of channels in the file. If this value is 0, then the file does not contain channels. Only PSD files can have channels. |
||
bIsDocFile |
TRUE if the image file or stream is a document format, FALSE otherwise. When the value of this member is TRUE, then the image file or stream passed to the L_FileInfo is a document file such as PDF or XPS and dDocPageWidth, dDocPageHeight and uDocUnit will contain the original document logical size. The physical load (rasterization size) is calculated based on the current rasterization values and is stored in Width, Height, XResolution and YResolution. When the value of this member is FALSE, then the image file or stream is a raster image such as JPEG or TIFF. These files have physical size and dDocPageWidth, dDocPageHeight and uDocUnit should not be used. |
||
dDocPageWidth |
The logical width of the document. This value is in uDocUnit. The logical width and height of the document is the original size before rasterization. LEADTOOLS usually returns the logical size in inches. dDocPageWidth should only be used if the value of bIsDocFile is TRUE. |
||
dDocPageHeight |
The logical height of the document. This value is in uDocUnit. The logical width and height of the document is the original size before rasterization. LEADTOOLS usually returns the logical size in inches. dDocPageHeight should only be used if the value of bIsDocFile is TRUE. |
||
uDocUnit |
The unit for dDocPageWidth and dDocPageHeight. Valid values are as follows: |
||
|
|
Value |
Meaning |
|
|
RASTERIZEDOC_UNIT_PIXEL |
[0] Page width and height is in pixels. |
|
|
RASTERIZEDOC_UNIT_INCH |
[1] Page width and height is in inches. |
|
|
RASTERIZEDOC_UNIT_MILLIMETER |
[2] Page width and height is in millimeters. |
bIsVectorFile |
TRUE if the image file or stream is a vector format, FALSE otherwise. |
||
VectorParallelogram |
Parallelogram structure that contains the bounding parallelogram for the vector. |
Comments
pFILEINFONFO is a pointer to a FILEINFO structure. Where the function parameter type is pFILEINFO, you can declare a FILEINFO variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pFILEINFO variable is necessary only if your program requires a pointer.
Some functions which take this structure as a parameter require that the structure must 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.
Note: |
For more information about loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF Files. |
Please note that if FILEINFO.Format is FILE_JPEG or FILE_TIF_JPEG and FILEINFO.BitsPerPixel is 8, then the image is 4:0:0 color space, not 4:4:4 color space.
Currently only PSD files support layers.