Comments in FlashPix files are one contiguous block of memory, a Comments Block. Within the Comments Block are individual Comments which consist of a Comment header and Comment data.
Provides information on the size and type of the Comment that consists of a single item (a float or a short for example).
typedef struct _FPXCOMMENT_HEADER_ELEMENT
size of the comment.
type of comment stored.
Size is given in bytes. Type refers to a value within the enumerated type FPXTYPE_DATA.
Provides information on the size and type of the Comment that consists of an array of items (an array of shorts, an array of chars, or an array of strings for example).
typedef struct _FPXCOMMENT_HEADER_ARRAY
Size of the comment.
Type of comment stored.
Number of elements in the array.
Size is given in bytes. Type refers to a value within the enumerated type FPXTYPE_DATA. Elements provides the number of elements in the array.
Following the Comment header is the Comment data. Comment data may consist of simple data such as a float value, sub-comments, or a combination of one or more simple data and one or more sub-comments. The sections making up a sub-comment will be referred to as sub-comment header and sub-comment data. Both Comments and sub-comments must be of a Comment type.
For example, a Comment of Comment type FlashPixLong would contain a Comment header FPXCOMMENT_HEADER_ELEMENT. This would be followed by the Comment data, consisting of a L_UINT32 (4 bytes) which holds the long value. A Comment of Comment type FlashPixCFAPatternBlock, however, has Comment data consisting of two integer values and a comment of Comment type FlashPixString. A list of FlashPix Comment types is provided at the end of this section. To better understand FlashPix file Comment organization, look through the following example.
Each cell in the graph below indicates 1 byte of memory. Therefore a L_UINT32 is 4 bytes in size.
The values given above the cells indicate the value stored in that segment of memory.
The Comment type is given in brackets beside the Comment name.
Wide characters are 2 bytes in size and are indicated by a character followed by a blank byte.
The example given here contains the Comments present in the "Content Description Group" (CMNT_FPXCONTENTDESCRIPTIONGROUP see FlashPix File Comments.). The first Comment, CMNT_FPXTESTTARGETINTHEIMAGE is of Comment type FlashPixLong. It consists of the FPXCOMMENT_HEADER_ELEMENT and a single Comment data element of type long. Within the Comment header, the leftmost L_UINT32 stores the size of the entire Comment. The 4 bytes of the long data element and the 8 bytes for the 2 L_UINT32 members in the Comment header gives a total of 12 bytes. The right L_UINT32 member in the Comment header stores the value 3 for the Comment type of this Comment [FlashPixLong]. Finally, the last L_UINT32 (data) holds the value of the Comment data itself ( 0x0 ).
The next Comment, CMNT_FPXGROUPCAPTION is very similar. The Comment header stores the size of the entire Comment (34 bytes) as well as the Comment type (FlashPixWideString) and the number of elements (11) in the string. The Comment data contains the string itself (MY FRIENDS). Notice that since the array is made up of wide characters, each character within the string is followed by an empty byte to indicate that the wide characters are 2 bytes in size. The space between words and the final '\0' are included in the number of wide characters.
The next Comment is almost identical to CMNT_FPXGROUPCAPTION.
The next Comment CMNT_FPXPEOPLEINTHEIMAGE gives an example Comment of Comment type FlashPixWideStringArray. This Comment header is FPXCOMMENT_HEADER_ARRAY. The first L_UINT32 stores the size of the entire Comment, including the entire array (52 bytes). Again the next L_UINT32 indicates the Comment type is FlashPixWideStringArray (10). The rightmost L_UINT32 member in the Comment header stores the number of elements present in the array (2). The Comment data consists of multiple sub-comments of Comment type FlashPixWideString which make up the array. Again, these sub-comments consist of a sub-comment header and sub-comment data. The sub-comment header for the first FlashPixWideString sub-comment in the array begins with a L_UINT32 which stores the size of that one string within the array (20 bytes). The next L_UINT32 indicates the Comment type of the sub-comment which follows (9 or FlashPixWideString). Please note that the entire Comment is of type FlashPixWideStringArray, but each member of that array is of Comment type FlashPixWideString. The next L_UINT32 member in the sub-comment header of each wide string stores the number of elements in the string (4). Finally, the sub-comment data of each sub-comment contains the string BOB and TED.
The rest of the Comments may be explained similarly. It is important to note that all of the 1 byte cells seen here represent a contiguous block of memory and therefore would fall side by side in memory. The "exploded" view of the Comment organization is done only to show the individual members of the header and the data section.
Comments and sub-comments must be of certain Comment types. The Comment types available are listed below.
The following declarations pertain to the examples included in the Comment type definitions:
L_UINT i, j, uBytes;
L_UCHAR Buffer, String = "String";
This comment is used to store the number of rows, number of columns and data array which describe a color pattern. Refer to CMNT_FPXCFAPATTERN in FlashPix File Comments.
Size of this comment.
Type of this comment = FPXENUM_CFA_PATTERN_BLOCK.
Data value containing the number of rows defining the color pattern.
Data value containing the number of columns defining the color pattern.
Data array of color pattern values.
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries