typedef struct tagIMAGEHEADER
{
L_CHAR * pIM;
L_CHAR * pIID1;
NITFDATETIME IDATIM;
L_CHAR * pTGTID;
L_CHAR * pIID2;
L_CHAR * pISCLAS;
L_CHAR * pISCLSY;
L_CHAR * pISCODE;
L_CHAR * pISCTLH;
L_CHAR * pISREL;
L_CHAR * pISDCTP;
NITFDATE ISDCDT;
L_CHAR * pISDCXM;
L_CHAR * pISDG;
NITFDATE ISDGDT;
L_CHAR * pISCLTX;
L_CHAR * pISCATP;
L_CHAR * pISCAUT;
L_CHAR * pISCRSN;
NITFDATE ISSRDT;
L_CHAR * pISCTLN;
L_UINT uENCRYP;
L_CHAR * pISORCE;
L_UINT uNROWS;
L_UINT uNCOLS;
L_CHAR * pPVTYPE;
L_CHAR * pIREP;
L_CHAR * pICAT;
L_UINT uABPP;
L_CHAR * pPJUST;
L_CHAR * pICORDS;
L_CHAR * pIGEOLO;
L_UINT uNICOM;
L_CHAR ** pICOM;
L_CHAR * pIC;
L_CHAR * pCOMRAT;
L_UINT uNBANDS;
L_UINT uXBANDS;
L_CHAR ** pIREPBAND;
L_CHAR ** pISUBCAT;
L_CHAR ** pIFCN;
L_CHAR ** pIMFLTN;
L_UINT uISYNC;
L_CHAR * pIMODE;
L_UINT uNBPR;
L_UINT uNBPC;
L_UINT uNPPBH;
L_UINT uNPPBV;
L_UINT uNBPP;
L_UINT uIDLVL;
L_UINT uIALVL;
L_INT nILOCRow;
L_INT nILOCCol;
L_CHAR * pIMAG;
L_UINT uUDIDL;
L_UINT uUDOFL;
L_UCHAR * pUDID;
L_UINT uIXSHDL;
L_UINT uIXSOFL;
L_UCHAR * pIXSHD;
L_UINT uIMDATOFF;
L_UINT16 uBMRLNTH;
L_UINT16 uTMRLNTH;
L_UINT16 uTPXCDLNTH;
L_UCHAR * pTPXCD;
} IMAGEHEADER, *pIMAGEHEADER;
The IMAGEHEADER structure provides information about NITF file image header.
* Pointer to a character string that contains the ID of the sub-header type to be used. Possible values are:
* Pointer to a character string that contains an alphanumeric sequence that represents the identification code associated with the image. The valid codes are determined by the application.
* NITFDATETIME structure that contains information about the time of the image acquisition.
* Pointer to a character string that contains the identification of the primary target in the format, BBBBBBBBBBOOOOOCC, consisting of ten characters of Basic Encyclopedia (BE) identifier, followed by five characters of facility OSUFFIX, followed by the two character country code as specified in FIPS PUB 10-4.
* Pointer to a character string that contains the identification of additional information about the image.
* Pointer to a character string that contains a symbol character that represents the image security classification level. Possible values are:
* Pointer to a character string that contains valid values that indicates the national or multinational image security classification system used to classify the image. Country Codes per FIPS PUB 10-4 shall be used to indicate national security systems.
If this member is all spaces it shall imply that no security classification system applies to the image.
* Pointer to a character string that contains the image codewords that indicates the image security compartments. Multiple entries shall be separated by a single space. The selection of a relevant set of codewords is application specific.
If this member is all spaces, it shall imply that no codewords apply to the image.
* Pointer to a character string that contains an additional image security control and/or handling instructions (caveats). The selection of a relevant caveat(s) is application specific.
If this member is all spaces, it shall imply that no additional control and handling instructions apply to the image.
* Pointer to a character string that contains a valid list of country and/or multilateral entity codes to which countries and/or multilateral entities the image is authorized for release. Valid items in the list are one or more country codes as found in FIPS PUB 10-4 and/or codes identifying multilateral entities.
If this member is all spaces, it shall imply that no image release instructions apply.
* Pointer to a character string that contains a symbol character that represents the image declassification type or the image downgrading instructions. Possible values are:
* NITFDATE structure that contains information about the image declassification date.
This member is valid only if the value of the pISDCTP member is set to "DD" string.
* Pointer to a character string that contains the reason why the image is exempt from automatic declassification.
This member is valid only if the value of the pISDCTP member is set to "X" string. Possible values range from "X1" to "X8" and "X251" to "X259".
If this member is all spaces, it shall imply that an image declassification exemption does not apply.
* Pointer to a character string that contains a symbol character that represents the image downgrade classification level.
This member is valid only if the value of the pISDCTP member is set to "GD" or "GE" string. Possible values are:
* NITFDATE structure that contains information about the date on which an image is to be downgraded.
This member is valid only if the value of the pISDCTP member is set to "GD" string.
* Character string that contains the image classification text that includes information about the identification of declassification or downgrading event.
This member is valid only if the value of the pISDCTP member is set to "DE" or "GE" strings.
It may also be used to identify multiple classification sources and/or any other special handling rules. Values are user-defined free text.
If this member is all spaces, it shall imply that additional information about image classification does not apply.
* Pointer to a character string that contains a symbol character that represents the image classification authority type. Possible values are:
* Pointer to a character string that contains the image classification authority dependent on the value of the pISCATP member.
Values are user-defined free text which should contain the following information:
"O" "D" "M" In the latter case, the image originator will maintain a record of the sources used in accordance with existing security directives. One of the multiple sources may also be identified in image classification Text if desired.
If this member is all spaces, it shall imply that no image classification authority applies.
* Pointer to a character string that contains a symbol character that represents the image classification reason. Possible values range from "A" to "G". These correspond to the reasons for original classification per E.O. 12958, Section 1.5. (a) Through (g).
If this member contains a space, it shall imply that no image classification reason applies.
* NITFDATE structure that contains information about the date of the source used to derive the classification of the image. In the case of multiple sources, the date of the most recent source shall be used.
* Pointer to a character string that contains the image security control number. The format of the security control number shall be in accordance with the regulations governing the appropriate security channel(s).
If this member is all spaces, it shall imply that no image security control number applies.
* Reserved for future use. Must be 0.
* Pointer to a character string that contains a description of the source of the image. If the source of the data is classified, then the description shall be preceded by the classification, including codeword(s).
If this member is all spaces, it shall imply that no image source data applies.
* Value that represents the total number of rows of significant pixels in the image. If the value of uNROWS member is less than the value of (uNPPBV * uNBPC), the rows indexed within the range uNROWS to (uNPPBV * uNBPC) - 1, shall contain fill data.
NOTE: Only the rows indexed within the range 0 to (uNROWS - 1) of the image contain significant data.
The pixel fill values are determined by the application.
* Value that represents the total number of columns of significant pixels in the image. If the value of uNCOLS member is less than the value of (uNPPBH * uNBPR), the columns indexed within the range uNCOLS to (uNPPBH * uNBPR) - 1 of the image contain significant data.
The pixel fill values are determined by the application.
* Pointer to a character string that contains symbol characters that represents the type of computer representation used for each pixel of each band in the image. Possible values are:
* Pointer to a character string that contains symbol characters that represents the processing required for displaying an image. Possible values are:
* Pointer to a character string that contains a symbol characters that represents the specific category of image, raster or grid data. The specific category of an IS reveals its intended use or the nature of its collector. Possible categories are:
* Value that represents the number of "significant bits" for the value in each band of each pixel without compression. Even when the image is compressed, uABPP member contains the number of significant bits per pixel that were present in the image before compression. The value of this member must be less than or equal to the value of uNBPP member. The number of adjacent bits within each uNBPP member is used to represent the value. These "representation bits" shall be left justified or right justified within the bits of the uNBPP bits member, according to the value in the pPJUST member. For example, if 11-bits pixels are stored in 16 bits, the value of this member will be 11 and uNBPP will be 16. The default number of significant bits to be used is the value of uNBPP member.
* Pointer to a character string that contains a symbol character that represents the pixel justification. Possible values are:
This member is valid only if the value of the uABPP member is not equal to the value of the uNBPP member.
* Pointer to a character string that contains a symbol character that represents the type of coordinate representation used for providing an approximate location of the image in the pIGEOLO member. Possible values are:
* Pointer to a character string that contains an approximate geographic location which is not intended for analytical purposes (e.g., targeting, mensuration, distance calculation); it is intended to support general user appreciation for the image location which is specified in pICORDS member (e.g., cataloging).
The locations of the four corners of the (significant) image data shall be given in image coordinate order: (0,0), (0, MaxCol), (MaxRow, MaxCol), (MaxRow, 0).
MaxCol and MaxRow shall be determined from the values contained, respectively, in the uNCOLS member and the uNROWS member. MaxCol = is equal to the value contained in the uNCOLS member - 1 (MaxCol = uNCOLS -1). Valid corner locations in geographic coordinates shall be expressed as latitude and longitude.
The format ddmmssXdddmmssY represents latitude and longitude. The first half, ddmmssX, represents degrees, minutes, and seconds of latitude with X representing North or South (N for North, S for South). The second half, dddmmssY, represents degrees, minutes, and seconds of longitude with Y representing East or West (E for East, W for West), respectively.
Coordinates shall only be populated in the IGEOLO member to the known precision of the corner coordinates. Non-significant digits of the member shall be replaced with spaces. An example of the 60 character member with two spaces depicting the absence of arc seconds is ddmm Xdddmm Yddmm Xdddmm Yddmm Xdddmm Yddmm Xdddmm Y.
Decimal degrees are expressed as +\-dd.ddd +\-ddd.ddd (four times) where +\-dd.ddd equals latitude (+ represents northern hemisphere, - represents southern hemisphere) and +\-ddd.ddd equals longitude (+ represents eastern hemisphere, - represents western shall be expressed either in plain UTM coordinates or using MGRS.
Normally UTM/MGRS coordinates should be rounded to the nearest 10 meters to match the precision of the geographic coordinates. Plain UTM coordinates use the format zzeeeeeennnnnnn where zz represents the UTM zone number, and eeeeee, nnnnnnn represents Easting and Northing. Hemisphere (N or S) for plain UTM is expressed in the pICORDS member.UTM expressed in MGRS use the format zzBJKeeeeennnnn where zzBJK represents the zone, band and 100 km square within the zone and eeeee, nnnnn represents residuals of Easting and Northing. (MaxRow, 0).MaxCol and MaxRow shall be determined from the values contained, respectively, in the uNCOLS member and the uNROWS member. MaxCol is equal to the value contained in the uNCOLS member minus 1 (MaxCol = uNCOLS -1). Valid corner locations in geographic coordinates shall be expressed as latitude and longitude.
The format ddmmssXdddmmssY represents latitude and longitude. The first half, ddmmssX, represents degrees, minutes, and seconds of latitude with X representing North or South (N for North, S for South). The second half, dddmmssY, represents degrees, minutes, and seconds of longitude with Y representing East or West (E for East, W for West), respectively. Coordinates shall only be populated in the pIGEOLO field to the known precision of the corner coordinates. Non-significant digits of the field shall be replaced with spaces. An example of the 60 character member with two spaces depicting the absence of arc seconds is ddmm Xdddmm Yddmm Xdddmm Yddmm Xdddmm Yddmm Xdddmm Y.
Decimal degrees are expressed as +/-dd.ddd+/-ddd.ddd (four times) where +/-dd.ddd equals latitude (+ represents northern hemisphere, - represents southern hemisphere) and +/-ddd.ddd equals longitude (+ represents eastern hemisphere, - represents western hemisphere).
Non-significant digits of the member shall be replaced with spaces.
* Value that represents the number of image comments used as free text.
* Pointer to a character string that contains a free-form text, That intended to be used as a single comment block and should be used that way. This member must contain the nth free text image comment, where n is defined as follows: 0<=n< the value of the uNICOM member. If the image comment is classified, it must be preceded by the classification, including codeword(s). The value of this member will be ignored if the value of the uNICOM member is set to 0.
* Pointer to a character string that contains symbol characters that represents the form of compression used in representing the image data. Possible values are:
* Pointer to a character string that contains symbol characters that represents the compression rate code for the image.
This member is valid only for all values of pIC except "NC" and "NM". Possible values are:
* Value that represents the number of data bands within the specified image. This member and the pIREP member are interrelated and independent of the pIMODE member. The corresponding values for the pIREP and uNBANDS members are NODISPLY, 0 to 9; MONO, 1; RGB, 3; RGB/LUT, 1; YCbCr601, 3; NVECTOR, 0 to 9; POLAR, 2; VPH, 2; MULTI, 0, 2 to 9; and zeros for multiple band images or matrices with greater than 9 bands.
* Value that represents the number of bands or data points comprising the multiple band image.
This member is valid only if the value of the uNBANDS member is set to 0.Otherwise this member will be ignored if the value of the uNBANDS member is range from 1 to 9.
* Pointer to a character string that contains a symbol that represents the processing required for displaying the nth band of the image with regard to the general image type as recorded in the pIREP member. The significance of each band in the image can be derived from the combination of the pICAT, and pISUBCAT[n] members. Valid values of the pIREPBAND[n] member depend on the value of the pIREP member.
The following standard values shall apply:
R, G, B respectively for a Red, Green, Blue representation of the band,
LU for a LUT representation of the band (e.g., a three table LUT for RGB and a single table LUT for shades of grey),
M for a monochrome representation of the band, spaces for a band not designated for display, but may be displayed if desired,
E Y, Cb, Cr respectively for the Luminance,
Chrominance (blue), and Chrominance (red) representation of a YCbCr601 (compressed case only) image,
The only valid values when pIREP contains MULTI are M, R, G, B, and LU:
It is strongly recommended that 3 of the multiple bands have the IREPBAND[n] members populated with R, G, and B.
When bands marked as LU, R, G, B, and M are present, the RGB designated bands are the default bands for display. If R, G, B are not present, the default displayable band is the LU band. If R, G, B, or LU are not present, the default displayable band is the first M band. When no bands are marked with LU, R,G, B, or M the first three bands may be displayed as R, G, and B respectively. For consistency, multi-spectral images cannot have more than one band, each marked as R, G, and B.
IREPBAND[n] shall be filled with the M value, if the band is to be represented as monochrome.
IREPBAND[n] shall be filled with the LU value, if the band is to be represented using a LUT.
When IREPBAND[n] is filled with spaces (code 0x20), no specific representation is defined for the band, but it may be displayed if desired.
The only valid values when pIREP contains MONO images is M or spaces.
The only valid values when pIREP contains RGB images are R, G and B.
The only valid value when IREP contains RGB/LUT images is LU.
The only valid values when IREP contains YCbCr601 images are Y, Cb and Cr.
* Pointer to a character string that contains the nth band subcategory. The purpose of this member is to provide the significance of the nth bands of the image with regard to the specific category (pICAT member) of the overall image. The use of this member is user-defined except for the following: For MultiSpectral imagery (pICAT contains MS), HyperSpectral imagery (pICAT contains HS), and Infrared imagery (pICAT contains IR), pISUBCAT[n] contains the wavelength in nanometers. When pICAT contains SAR, pISUBCAT[n] contains I for the inphase and Q for the quadrature components or M for the magnitude and P for the phase components. When pICAT contains WIND or CURRENT, pISUBCAT[n] contains SPEED for wind or water speed , or DIRECT for wind or water direction. For location grids, the number of bands is strictly equal to 2, consequently, there are only 2 members, the pISUBCAT[0] member and the pISUBCAT[1] member. Standard values of these members of location grids are either CGX and CGY for the cartographic X (Easting) and Y (Northing) bands, or GGX and GGY with the geographic X representing the longitude band and Y representing the latitude band.
* Pointer to a character string that contains the nth band image filter condition. Possible values are:
* Reserved for future use. Pass spaces.
* Reserved for future use. Pass 0.
* Pointer to a character string that contains the image mode. Possible values are: "B", "P", "R", and "S". The interpretation of pIMODE member is dependent on whether the image is JPEG compressed (pIC = "C3", "C5", "I1", "M3", or "M5"), VQ compressed (pIC = "C4", or "M4"), or uncompressed (pIC = "NC" or "NM").
* Value that represents the number of image blocks in a row of blocks in the horizontal direction. If the image consists of only a single block, this member will contain the value 1.
* Value that represents the number of image blocks in a column of blocks in the vertical direction. If the image consists of only a single block, this member will contain the value 1.
* Value that represents the number of pixels horizontally in each block of the image. It shall be the case that the product of the values of the uNBPR member and the uNPPBH member is greater than or equal to the value of the uNCOLS member (uNBPR * uNPPBH >= uNCOLS).
* Value that represents the number of pixels vertically in each block of the image. It shall be the case that the product of the values of the uNBPC member and the uNPPBV member is greater than or equal to the value of the uNROWS member (uNBPC * uNPPBV >= uNROWS).
* Value that represents the number of bits per pixel per band. If the value of the pIC member is set to "NC", "NM", "C4", or "M4", the uNBPP member will contain the number of storage bits used for the value from each component of a pixel vector. The value in this member always will be greater than or equal to actual bits per pixel (uABPP). For example, if 11-bit pixels are stored in 16 bits, this member shall contain 16 and actual bits per pixel shall contain 11. If pIC = "C3", "M3", "C5", "M5", or "I1" this member shall contain the value 8 or the value 12. If pIC = "C1", this member shall contain the value 1.
* Value that represents the display level of the image relative to other displayed file components in a composite display. Possible values range from 1 to 999. The display level of each displayable segment (image or graphic) within a file shall be unique; that is, each number from 1 to 999 is the display level of, at most, one segment.
* Value that represents the attachment level of the image. Possible values are zero, and the display level value of any other image or graphic in the file.
* Value that represents the image location offset from the nILOCRow or GRAPHICHEADER.nSLOCRow member value of the segment to which the image is attached or from the origin of the CCS when the image is unattached (IALVL contains 000). A row value of 0 indicates no offset. Positive row values indicate offsets down. While negative row values indicate offsets up.
* Value that represents the image location offset from the nILOCCol or GRAPHICHEADER.nSLOCCol member value of the segment to which the image is attached or from the origin of the CCS when the image is unattached (IALVL contains 000). A row value of 0 indicates no offset. Positive row values indicate offsets down. While negative row values indicate offsets up.
* Pointer to a value that represents the magnification (or reduction) factor of the image relative to the original source image. Decimal values are used to indicate magnification, and decimal fraction values indicate reduction. For example, "2.30" indicates the original image has been magnified by a factor of "2.30", while "0.5" indicates the original image has been reduced by a factor of 2. In addition, the following values shall be used for reductions that are reciprocals of non-negative powers of 2: /2 (for 1/2), /4 (for 1/4), /8 (for 1/8), /16 (for 1/16), /32 (for 1/32), /64 (for 1/64), /128 (for 1/128).
Possible values are:
* Value that represents the user-defined image data length. A value of 0 indicates that no TREs are included in the pUDID member. If a TREs exists, the member will contain the sum of the length of all the TREs appearing in the pUDID member + 3 bytes (length of uUDOFL member). If a TRE is too long to fit in the pUDID member or the pIXSHD member, it shall be put in the TRE overflow DES with DESID set to the value TRE_OVERFLOW.
* Pointer to a character string that contains the user-defined image data. This member shall contain user-defined TREs. The length of this member shall be the length specified by the member uUDIDL - 3. TREs in this member for an image shall contain information pertaining specifically to the image. TREs shall appear one after the other with no intervening bytes. The first byte of this member shall be the first byte of the first TRE appearing in the member. The last byte of this member shall be the last byte of the last TRE to appear in the member. This member shall be ignored if the value of the uUDIDL member is set to 0.
* Value that represents the image extended sub-header data length. A value of zero shall represent that no TREs are included in the uIXSHD member. If a TRE exists, the member shall contain the sum of the length of all the TREs appearing in the pIXSHD member + 3 (length of uIXSOFL member), in bytes. If a TRE is too long to fit in the pIXSHD member or the pUDID member, it may be put in the TRE overflow DES with DESID set to the value TRE_OVERFLOW.
* Value that represents the image extended sub-header overflow. This member shall contain 0 if the TREs in pIXSHD member do not overflow into a DES, or shall contain the sequence number of the DES into which they do overflow. This member shall be ignored if the value of the iIXSHDL member is set to 0.
* Pointer to a character string that contains the image extended sub-header data. This member shall contain TREs approved and under configuration management by the ISMC. The length of this member shall be the length specified by the member uIXSHDL - 3. TREs in this member for an image shall contain information pertaining specifically to the image. TREs shall appear one after the other in this member with no intervening bytes. The first byte of this member shall be the first byte of the first TRE appearing in the member. The last byte of this member shall be the last byte of the last TRE to appear in the member. This member shall be ignored if the value of the uIXSHDL member is set to 0.
* Value that represents the blocked image data offset. This member is valid only if the value of the pIC member is set to "NM", "M1", "M3", "M4", or "M5". It identifies the offset from the beginning of the image data mask to the first byte of the blocked image data.
* Value that represents the block mask record length. This member is valid only if the value of the pIC member is set to "NM", "M1", "M3", "M4", or "M5". It identifies the length of each block mask record, in bytes. The length of each block mask record is 4 bytes. The total length of all the block mask records is equal to uBMRLNTH * uNBPR * uNBPC * uNBANDS (one 4 bytes record for each block of each band in the image).
* Value that represents the pad pixel mask record length. This member is valid only if the value of the pIC member is set to "NM", "M1", "M3", "M4", or "M5". It identifies the length of each pad pixel mask record, in bytes. When present, the length of each pad pixel mask record is 4 bytes. The total length of the pad pixel mask records is equal to uTMRLNTH * uNBPR * uNBPC * uNBANDS (one 4 bytes record for each block for each band in the image).
* Value that represents the pad output pixel code length. This member is valid only if the value of the pIC member is set to "NM", "M1", "M3", "M4", or "M5". It identifies the length in bits of the pad output pixel code. If coded as 0, then no pad pixels are present, and the pTPXCD member is not recorded. If the value of the pIC member is set to "M3", the value of this member shall be set to 0.
* Pointer to a character string that contains the pad output pixel code. This member is valid only if the value of the pIC member is set to "NM", "M1", "M3", "M4", or "M5" and the value of the uTPXCDLNTH member is not zero. It contains the output pixel code that represents a pad pixel in the image. This value is unique within the image, and allows the user to identify pad pixels. The pad output pixel code length is determined by the uTPXCDLNTH member. If the number of bits used by pTPXCD member is less than the number of bits available for storage, the value shall be justified in accordance with the pPJUST member in the image sub-header (L for left, R for right justified.)
pIMAGEHEADER is a pointer to an IMAGEHEADER structure. Where a function parameter type is pIMAGEHEADER, declare an IMAGEHEADER variable and pass the variable's address in the parameter. Declaring a pIMAGEHEADER variable is necessary only if the program requires a pointer.
The following functions make use of this structure: