FlashPix Structures

Non-image data in FlashPix files are treated as comments by LEADTOOLS. They are one contiguous block of memory, hereafter referred to as "Comments Block". Within the Comments Block are one or more individual comments. An individual comment will hereafter be referred to as "Comment". In FlashPix files a Comment consists of a "Comment header" and "Comment data". Further information on individual Comments may be found in FlashPixComments.

Reading the Comments stored in the Comments Block requires the use of the following structure.

Summary

The FILECOMMENTS structure, which is necessary for the L_ReadFileCommentExt function, provides information about and access to the FlashPix comments.

Syntax

FILECOMMENTS, LPFILECOMMENTS; 
typedef struct _FILECOMMENTS 
{ 
   L_INT count; 
   L_UCHAR **pointer; 
   L_UINT *size; 
} FILECOMMENTS, * LPFILECOMMENTS; 

Members

count

Number of comments. Must be CMNT_LAST + 1.

pPointer

Pointer to an array of pointers. Each pointer within the array points to a single comment.

size

Pointer to an array of sizes. Each member of the array indicates the length of the corresponding comment.

Comments

Presently, this structure is used with L_ReadFileCommentExt.

The FILECOMMENTS structure must be filled before using L_ReadFileCommentExt:

FILECOMMENTS FileComments; 
L_UCHAR *pPointer[CMNT_LAST + 1]; 
L_UINT Size[CMNT_LAST + 1]; 
FileComments.count = CMNT_LAST + 1; 
FileComments.pointer = pPointer; 
FileComments.size = Size; 

For a full example showing the use of this structure when reading Comments, refer to L_ReadFileCommentExt.

In the above structure, count indicates the number of individual Comments which can be stored in the Comments Block. Generally, the memory allocated for a Comments Block is large enough to store all FlashPix Comments, even if not all FlashPix Comments may actually be stored. **Pointer points to an array of pointers. Each pointer within the array points to the beginning of a Comment. Size points to the beginning of an array of integers. Each integer indicates the length of the corresponding Comment. The graph below shows the structure of FILECOMMENTS and its relationship to Comments Block, the array of pointers into Comments Block and the array of integers containing the lengths of the Comments in Comments Block. The following declarations pertain to the graph:

FILECOMMENTS FileComments; 
L_UCHAR *pPointerComments[CMNT_LAST + 1]; 
L_UINT LengthComments[CMNT_LAST + 1]; 
L_CHAR *pTextToGet; 

image\Filecmnt2.gif

FileComments is an instance of FILECOMMENTS. The data member count is set to CMNT_LAST + 1 indicating that the Comments Block contains all the FlashPix Comments. pPointer points to the beginning of the array of pointers, pPointerComments. Size points to the beginning of the integer array LengthComments. In this graph you can see that the first pointer in pPointerComments points to the beginning of the first Comment in pTextToGet, the Comments Block. The first entry in LengthComments contains the length of this Comment. You can also see that the first Comment consists of a Comment header and Comment data.

The second pointer in pPointerComments points to the second Comment in the Comments Block, adjacent to the first Comment. The second entry in LengthComments contains the data value 16, indicating that the second Comment is 16 bytes in length. Again, the second Comment consists of a Comment header and Comment data. This continues for each Comment in the Comment Block.

See Also

Topics

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

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