OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
ossimNitfImageHeaderV2_0 Class Reference

#include <ossimNitfImageHeaderV2_0.h>

Inheritance diagram for ossimNitfImageHeaderV2_0:
ossimNitfImageHeaderV2_X ossimNitfImageHeader ossimObject ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimNitfImageHeaderV2_0 ()
 
virtual ~ossimNitfImageHeaderV2_0 ()
 
virtual void parseStream (ossim::istream &in)
 
virtual void writeStream (ossim::ostream &out)
 
virtual std::ostream & print (std::ostream &out, const std::string &prefix=std::string()) const
 print method that outputs a key/value type format adding prefix to keys. More...
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool isCompressed () const
 
virtual bool isEncrypted () const
 
virtual ossim_int32 getNumberOfBands () const
 
virtual ossim_int32 getNumberOfRows () const
 
virtual ossim_int32 getNumberOfCols () const
 
virtual ossim_int32 getNumberOfBlocksPerRow () const
 
virtual ossim_int32 getNumberOfBlocksPerCol () const
 
virtual ossim_int32 getNumberOfPixelsPerBlockHoriz () const
 
virtual ossim_int32 getNumberOfPixelsPerBlockVert () const
 
virtual ossimString getImageId () const
 
virtual ossim_int32 getBitsPerPixelPerBand () const
 
virtual ossim_int32 getActualBitsPerPixelPerBand () const
 
virtual ossimString getIMode () const
 
virtual ossimString getSecurityClassification () const
 
virtual ossimString getImageDateAndTime () const
 
virtual ossimString getAcquisitionDateMonthDayYear (ossim_uint8 separationChar='-') const
 
virtual ossimString getCategory () const
 
virtual ossimString getImageSource () const
 
virtual ossimString getRepresentation () const
 
virtual ossimString getCoordinateSystem () const
 
virtual ossimString getPixelValueType () const
 
virtual bool hasBlockMaskRecords () const
 
virtual bool hasPadPixelMaskRecords () const
 
virtual bool hasTransparentCode () const
 
virtual ossim_uint32 getTransparentCode () const
 
virtual ossim_uint32 getBlockMaskRecordOffset (ossim_uint32 blockNumber, ossim_uint32 bandNumber) const
 
virtual ossim_uint32 getPadPixelMaskRecordOffset (ossim_uint32 blockNumber, ossim_uint32 bandNumber) const
 
virtual const ossimRefPtr< ossimNitfCompressionHeadergetCompressionHeader () const
 
virtual const ossimRefPtr< ossimNitfImageBandgetBandInformation (ossim_uint32 idx) const
 
virtual void setNumberOfBands (ossim_uint32 nbands)
 
virtual void setBandInfo (ossim_uint32 idx, const ossimNitfImageBandV2_0 &info)
 
virtual void setNumberOfRows (ossim_uint32 rows)
 
virtual void setNumberOfCols (ossim_uint32 cols)
 
virtual bool isValid () const
 isValid will test if the fields are valid and will return true or false. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const ossimString &prefix="") const
 
- Public Member Functions inherited from ossimNitfImageHeaderV2_X
 ossimNitfImageHeaderV2_X ()
 
virtual ossimIrect getImageRect () const
 Returns the zero based image rectangle. More...
 
virtual ossimIrect getBlockImageRect () const
 Returns the zero based image rectangle expanded out to block boundaries. More...
 
void setImageId (const ossimString &value)
 
void setAquisitionDateTime (const ossimString &value)
 
void setTargetId (const ossimString &value)
 
void setTitle (const ossimString &value)
 
void setSecurityClassification (const ossimString &value)
 
void setEncryption (const ossimString &value)
 
void setImageSource (const ossimString &value)
 
void setJustification (const ossimString &value)
 
void setCoordinateSystem (const ossimString &value)
 
void setGeographicLocation (const ossimString &value)
 
void setNumberOfComments (const ossimString &value)
 
void setCompression (const ossimString &value)
 
void setCompressionRateCode (const ossimString &value)
 
void setDisplayLevel (const ossimString &value)
 
void setAttachmentLevel (const ossimString &value)
 
void setPixelType (const ossimString &pixelType=ossimString("INT"))
 
void setBitsPerPixel (ossim_uint32 bitsPerPixel)
 
void setActualBitsPerPixel (ossim_uint32 bitsPerPixel)
 
void setImageMode (char mode)
 
void setCategory (const ossimString &category)
 
void setRepresentation (const ossimString &rep)
 
void setBlocksPerRow (ossim_uint32 blocks)
 
void setBlocksPerCol (ossim_uint32 blocks)
 
void setNumberOfPixelsPerBlockRow (ossim_uint32 pixels)
 
void setNumberOfPixelsPerBlockCol (ossim_uint32 pixels)
 
ossim_uint64 getDataLocation () const
 
ossimString getImageId () const
 
ossimString getAquisitionDateTime () const
 
ossimString getTargetId () const
 
ossimString getTitle () const
 
ossimString getSecurityClassification () const
 
ossimString getEncryption () const
 
ossimString getImageSource () const
 
ossimString getJustification () const
 
ossimString getCoordinateSystem () const
 
ossimString getGeographicLocation () const
 
ossimString getNumberOfComments () const
 
ossimString getCompressionCode () const
 
ossimString getCompressionRateCode () const
 
ossim_uint32 getDisplayLevel () const
 
ossim_uint32 getAttachmentLevel () const
 
ossimString getPixelType () const
 
ossim_uint32 getBitsPerPixel () const
 
ossim_uint32 getActualBitsPerPixel () const
 
char getImageMode () const
 
ossimString getCategory () const
 
ossimString getRepresentation () const
 
ossim_uint32 getBlocksPerRow () const
 
ossim_uint32 getBlocksPerCol () const
 
ossim_uint32 getNumberOfPixelsPerBlockRow () const
 
ossim_uint32 getNumberOfPixelsPerBlockCol () const
 
virtual ossimString getImageMagnification () const
 Gets the IMAG field as a string. More...
 
virtual void getImageLocation (ossimIpt &loc) const
 Gets the ILOC field as an ossimIpt. More...
 
virtual void setGeographicLocationDms (const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
 
virtual void setGeographicLocationDecimalDegrees (const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
 
virtual void setUtmNorth (ossim_uint32 zone, const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
 
virtual void setUtmSouth (ossim_uint32 zone, const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to set fields from a keyword list. More...
 
- Public Member Functions inherited from ossimNitfImageHeader
 ossimNitfImageHeader ()
 
virtual ~ossimNitfImageHeader ()
 
virtual bool getTagInformation (ossimNitfTagInformation &tagInfo, ossim_uint32 idx) const
 
virtual std::vector< ossimNitfTagInformationgetAllTags ()
 
virtual void setAllTags (std::vector< ossimNitfTagInformation > tagList)
 
virtual bool getTagInformation (ossimNitfTagInformation &tagInfo, const ossimString &tagName) const
 
ossimRefPtr< ossimNitfRegisteredTaggetTagData (const ossimString &tagName)
 
const ossimRefPtr< ossimNitfRegisteredTaggetTagData (const ossimString &tagName) const
 
void getTagData (const ossimString &tagName, std::vector< const ossimNitfRegisteredTag *> &tags) const
 Returns all tags of type tagName. More...
 
virtual ossim_uint32 getNumberOfTags () const
 
virtual void addTag (const ossimNitfTagInformation &tag, bool unique=true)
 
virtual void removeTag (const ossimString &tagName)
 
virtual void getDecimationFactor (ossim_float64 &result) const
 Convenience method to get the decimation factor as a double from the string returned be the getImageMagnification() method. More...
 
bool hasLut () const
 
ossimRefPtr< ossimNBandLutDataObjectcreateLut (ossim_uint32 bandIdx) const
 
virtual bool isSameAs (const ossimNitfImageHeader *hdr) const
 
virtual ossim_uint32 getTotalTagLength () const
 
virtual std::ostream & printTags (std::ostream &out, const std::string &prefix=std::string()) const
 print method that outputs a key/value type format adding prefix to keys. More...
 
virtual void getMetadata (ossimKeywordlist &kwl, const char *prefix=0) const
 Populates keyword list with metadata. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 

Static Public Attributes

static const ossimString ISCODE_KW = "iscode"
 
static const ossimString ISCTLH_KW = "isctlh"
 
static const ossimString ISREL_KW = "isrel"
 
static const ossimString ISCAUT_KW = "iscaut"
 
static const ossimString CTLN_KW = "ctln"
 
static const ossimString ISDWNG_KW = "isdwng"
 
static const ossimString ISDEVT_KW = "isdevt"
 
- Static Public Attributes inherited from ossimNitfImageHeaderV2_X
static const ossimString IM_KW = "IM"
 
static const ossimString IID1_KW = "IID1"
 
static const ossimString IDATIM_KW = "IDATIM"
 
static const ossimString TGTID_KW = "TGTID"
 
static const ossimString IID2_KW = "IID2"
 
static const ossimString ITITLE_KW = "ITITLE"
 
static const ossimString ISCLAS_KW = "ISCLAS"
 
static const ossimString ENCRYP_KW = "ENCRYP"
 
static const ossimString ISORCE_KW = "ISORCE"
 
static const ossimString NROWS_KW = "NROWS"
 
static const ossimString NCOLS_KW = "NCOLS"
 
static const ossimString PVTYPE_KW = "PVTYPE"
 
static const ossimString IREP_KW = "IREP"
 
static const ossimString ICAT_KW = "ICAT"
 
static const ossimString ABPP_KW = "ABPP"
 
static const ossimString PJUST_KW = "PJUST"
 
static const ossimString ICORDS_KW = "ICORDS"
 
static const ossimString IGEOLO_KW = "IGEOLO"
 
static const ossimString NICOM_KW = "NICOM"
 
static const ossimString ICOM_KW = "ICOM"
 
static const ossimString IC_KW = "IC"
 
static const ossimString COMRAT_KW = "COMRAT"
 
static const ossimString NBANDS_KW = "NBANDS"
 
static const ossimString ISYNC_KW = "ISYNC"
 
static const ossimString IMODE_KW = "IMODE"
 
static const ossimString NBPR_KW = "NBPR"
 
static const ossimString NBPC_KW = "NBPC"
 
static const ossimString NPPBH_KW = "NPPBH"
 
static const ossimString NPPBV_KW = "NPPBV"
 
static const ossimString NBPP_KW = "NBPP"
 
static const ossimString IDLVL_KW = "IDLVL"
 
static const ossimString IALVL_KW = "IALVL"
 
static const ossimString ILOC_KW = "ILOC"
 
static const ossimString IMAG_KW = "IMAG"
 
static const ossimString UDIDL_KW = "UDIDL"
 
static const ossimString UDOFL_KW = "UDOFL"
 
static const ossimString IXSHDL_KW = "IXSHDL"
 
static const ossimString IXSOFL_KW = "IXSOFL"
 
static const ossimString IMDATOFF_KW = "IMDATOFF"
 
static const ossimString BMRLNTH_KW = "BMRLNTH"
 

Private Member Functions

void clearFields ()
 

Private Attributes

char theCodewords [41]
 
char theControlAndHandling [41]
 
char theReleasingInstructions [41]
 
char theClassificationAuthority [21]
 
char theSecurityControlNumber [21]
 
char theSecurityDowngrade [7]
 
char theDowngradingEvent [41]
 
std::vector< ossimRefPtr< ossimNitfImageBandV2_0 > > theImageBands
 Will contain also the field NBANDS and we will have to recreate the prefix for. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ossimNitfImageHeader
void checkForGeographicTiePointTruncation (const ossimDpt &tie) const
 Method to check tie point to see if it will be truncated in field IGEOLO which has only arc second resolution. More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimNitfImageHeaderV2_X
char theType [3]
 
char theImageId [11]
 FIELD: IID1 Is a required 10 Alphanumeric value. More...
 
char theDateTime [15]
 
char theTargetId [18]
 FIELD: TGTID. More...
 
char theTitle [81]
 FIELD: IID2. More...
 
char theSecurityClassification [2]
 FIELD: ISCLAS. More...
 
char theEncryption [2]
 
char theImageSource [43]
 FIELD: ISORCE. More...
 
char theSignificantRows [9]
 FIELD: NROWS. More...
 
char theSignificantCols [9]
 FIELD: NCOLS. More...
 
char thePixelValueType [4]
 FIELD: PVTYPE. More...
 
char theRepresentation [9]
 FIELD: IREP. More...
 
char theActualBitsPerPixelPerBand [3]
 FIELD: ABPP. More...
 
char theCategory [9]
 FIELD: ICAT. More...
 
char theJustification [2]
 FIELD: PJUST. More...
 
char theCoordinateSystem [2]
 FIELD: ICORDS. More...
 
char theNumberOfComments [2]
 
std::vector< ossimStringtheImageComments
 
char theGeographicLocation [61]
 FIELD: IGEOLO. More...
 
char theCompression [3]
 FIELD: IC. More...
 
char theCompressionRateCode [5]
 FIELD COMRAT. More...
 
char theNumberOfBands [2]
 FIELD: NBANDS. More...
 
char theImageSyncCode [2]
 FIELD: ISYNC. More...
 
char theImageMode [2]
 FIELD: IMODE. More...
 
char theNumberOfBlocksPerRow [5]
 FIELD: NBPR. More...
 
char theNumberOfBlocksPerCol [5]
 FIELD: NBPC. More...
 
char theNumberOfPixelsPerBlockHoriz [5]
 FIELD: NPPBH. More...
 
char theNumberOfPixelsPerBlockVert [5]
 FIELD: NPPBV. More...
 
char theNumberOfBitsPerPixelPerBand [3]
 FIELD: NBPP. More...
 
char theDisplayLevel [4]
 FIELD: IDLVL. More...
 
char theAttachmentLevel [4]
 FIELD: IALVL. More...
 
char theImageLocation [11]
 FIELD: ILOC. More...
 
char theImageMagnification [5]
 FIELD: IMAG. More...
 
char theUserDefinedImageDataLength [6]
 FIELD: UDIDL. More...
 
char theUserDefinedOverflow [4]
 FIELD: UDOFL. More...
 
char theExtendedSubheaderDataLen [6]
 FIELD: IXSHDL. More...
 
char theExtendedSubheaderOverflow [4]
 FIELD: IXSOFL. More...
 
ossim_uint32 theBlockedImageDataOffset
 FIELD NAME: IMDATOFF. More...
 
ossim_uint16 theBlockMaskRecordLength
 FIELD NAME: BMRLNTH. More...
 
ossim_uint16 thePadPixelMaskRecordLength
 FIELD: TMRLNTH. More...
 
ossim_uint16 theTransparentOutputPixelCodeLength
 FIELD: TPXCDLNTH. More...
 
ossim_uint16 thePadOutputPixelCode
 FIELD: TPXCD. More...
 
std::vector< ossim_uint32theBlockMaskRecords
 
std::vector< ossim_uint32thePadPixelMaskRecords
 
ossimRefPtr< ossimNitfCompressionHeadertheCompressionHeader
 
ossim_uint64 theDataLocation
 
- Protected Attributes inherited from ossimNitfImageHeader
std::vector< ossimNitfTagInformationtheTagList
 

Detailed Description

Definition at line 22 of file ossimNitfImageHeaderV2_0.h.

Constructor & Destructor Documentation

◆ ossimNitfImageHeaderV2_0()

ossimNitfImageHeaderV2_0::ossimNitfImageHeaderV2_0 ( )

Definition at line 44 of file ossimNitfImageHeaderV2_0.cpp.

References clearFields().

◆ ~ossimNitfImageHeaderV2_0()

ossimNitfImageHeaderV2_0::~ossimNitfImageHeaderV2_0 ( )
virtual

Definition at line 49 of file ossimNitfImageHeaderV2_0.cpp.

50 {
51 }

Member Function Documentation

◆ clearFields()

void ossimNitfImageHeaderV2_0::clearFields ( )
private

Definition at line 841 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theActualBitsPerPixelPerBand, ossimNitfImageHeaderV2_X::theAttachmentLevel, ossimNitfImageHeaderV2_X::theBlockedImageDataOffset, ossimNitfImageHeaderV2_X::theBlockMaskRecordLength, ossimNitfImageHeaderV2_X::theBlockMaskRecords, ossimNitfImageHeaderV2_X::theCategory, theClassificationAuthority, theCodewords, ossimNitfImageHeaderV2_X::theCompression, ossimNitfImageHeaderV2_X::theCompressionHeader, ossimNitfImageHeaderV2_X::theCompressionRateCode, theControlAndHandling, ossimNitfImageHeaderV2_X::theCoordinateSystem, ossimNitfImageHeaderV2_X::theDataLocation, ossimNitfImageHeaderV2_X::theDateTime, ossimNitfImageHeaderV2_X::theDisplayLevel, theDowngradingEvent, ossimNitfImageHeaderV2_X::theEncryption, ossimNitfImageHeaderV2_X::theExtendedSubheaderDataLen, ossimNitfImageHeaderV2_X::theExtendedSubheaderOverflow, ossimNitfImageHeaderV2_X::theGeographicLocation, ossimNitfImageHeaderV2_X::theImageId, ossimNitfImageHeaderV2_X::theImageLocation, ossimNitfImageHeaderV2_X::theImageMagnification, ossimNitfImageHeaderV2_X::theImageMode, ossimNitfImageHeaderV2_X::theImageSource, ossimNitfImageHeaderV2_X::theImageSyncCode, ossimNitfImageHeaderV2_X::theJustification, ossimNitfImageHeaderV2_X::theNumberOfBands, ossimNitfImageHeaderV2_X::theNumberOfBitsPerPixelPerBand, ossimNitfImageHeaderV2_X::theNumberOfBlocksPerCol, ossimNitfImageHeaderV2_X::theNumberOfBlocksPerRow, ossimNitfImageHeaderV2_X::theNumberOfComments, ossimNitfImageHeaderV2_X::theNumberOfPixelsPerBlockHoriz, ossimNitfImageHeaderV2_X::theNumberOfPixelsPerBlockVert, ossimNitfImageHeaderV2_X::thePadOutputPixelCode, ossimNitfImageHeaderV2_X::thePadPixelMaskRecordLength, ossimNitfImageHeaderV2_X::thePadPixelMaskRecords, ossimNitfImageHeaderV2_X::thePixelValueType, theReleasingInstructions, ossimNitfImageHeaderV2_X::theRepresentation, ossimNitfImageHeaderV2_X::theSecurityClassification, theSecurityControlNumber, theSecurityDowngrade, ossimNitfImageHeaderV2_X::theSignificantCols, ossimNitfImageHeaderV2_X::theSignificantRows, ossimNitfImageHeader::theTagList, ossimNitfImageHeaderV2_X::theTargetId, ossimNitfImageHeaderV2_X::theTitle, ossimNitfImageHeaderV2_X::theTransparentOutputPixelCodeLength, ossimNitfImageHeaderV2_X::theType, ossimNitfImageHeaderV2_X::theUserDefinedImageDataLength, and ossimNitfImageHeaderV2_X::theUserDefinedOverflow.

Referenced by ossimNitfImageHeaderV2_0(), and parseStream().

842 {
843  theTagList.clear();
844 
845  memcpy(theType, "IM", 2);
846  memset(theImageId, ' ', 10);
847  memset(theDateTime, ' ', 14);
848  memset(theTargetId, ' ', 17);
849  memset(theTitle, ' ', 80);
850  memset(theSecurityClassification, ' ', 1);
851  memset(theCodewords, ' ', 40);
852  memset(theControlAndHandling, ' ', 40);
853  memset(theReleasingInstructions, ' ', 40);
854  memset(theClassificationAuthority, ' ', 20);
855  memset(theSecurityControlNumber, ' ', 20);
856  memset(theSecurityDowngrade, ' ', 6);
857  memset(theDowngradingEvent, ' ', 40);
858  memset(theEncryption, '0', 1);
859  memset(theImageSource, ' ', 42);
860  memset(theSignificantRows, ' ', 8);
861  memset(theSignificantCols, ' ', 8);
862  memset(thePixelValueType, ' ', 3);
863  memset(theRepresentation, ' ', 8);
864  memset(theCategory, ' ', 8);
865  memset(theActualBitsPerPixelPerBand, '0', 2);
866  memset(theJustification, ' ', 1);
867  memset(theCoordinateSystem, 'N', 1);
868  memset(theGeographicLocation, ' ', 60);
869  memset(theNumberOfComments, '0', 1);
870  memcpy(theCompression, "NC", 2);
871  memset(theCompressionRateCode, ' ', 4);
872  memset(theNumberOfBands, ' ', 1);
873  memset(theImageSyncCode, '0', 1);
874  memset(theImageMode, ' ', 1);
875  memset(theNumberOfBlocksPerRow, ' ', 4);
876  memset(theNumberOfBlocksPerCol, ' ', 4);
877  memset(theNumberOfPixelsPerBlockHoriz, ' ', 4);
878  memset(theNumberOfPixelsPerBlockVert, ' ', 4);
879  memset(theNumberOfBitsPerPixelPerBand, '0', 2);
880  memset(theDisplayLevel, ' ', 3);
881  memset(theAttachmentLevel, ' ', 3);
882  memcpy(theImageLocation, "0000000000", 10);
883  memcpy(theImageMagnification, "1.00", 4);
884  memset(theUserDefinedImageDataLength, '0', 5);
885  memset(theUserDefinedOverflow, '0', 3);
886  memset(theExtendedSubheaderDataLen, '0', 5);
887  memset(theExtendedSubheaderOverflow, ' ', 3);
888 
889  theBlockMaskRecords.clear();
890  thePadPixelMaskRecords.clear();
891 
898  theType[2] = '\0';
899  theImageId[10] = '\0';
900  theDateTime[14] = '\0';
901  theTargetId[17] = '\0';
902  theTitle[80] = '\0';
903  theSecurityClassification[1] = '\0';
904  theCodewords[40] = '\0';
905  theControlAndHandling[40] = '\0';
906  theReleasingInstructions[40] = '\0';
907  theClassificationAuthority[20] = '\0';
908  theSecurityControlNumber[20] = '\0';
909  theSecurityDowngrade[6] = '\0';
910  theDowngradingEvent[40] = '\0';
911  theEncryption[1] = '\0';
912  theImageSource[42] = '\0';
913  theSignificantRows[8] = '\0';
914  theSignificantCols[8] = '\0';
915  thePixelValueType[3] = '\0';
916  theRepresentation[8] = '\0';
917  theCategory[8] = '\0';
919  theJustification[1] = '\0';
920  theCoordinateSystem[1] = '\0';
921  theGeographicLocation[60] = '\0';
922  theNumberOfComments[1] = '\0';
923  theCompression[2] = '\0';
924  theCompressionRateCode[4] = '\0';
925  theNumberOfBands[1] = '\0';
926  theImageSyncCode[1] = '\0';
927  theImageMode[1] = '\0';
928  theNumberOfBlocksPerRow[4] = '\0';
929  theNumberOfBlocksPerCol[4] = '\0';
933  theDisplayLevel[3] = '\0';
934  theAttachmentLevel[3] = '\0';
935  theImageLocation[10] = '\0';
936  theImageMagnification[4] = '\0';
938  theUserDefinedOverflow[3] = '\0';
939  theExtendedSubheaderDataLen[5] = '\0';
940  theExtendedSubheaderOverflow[3] = '\0';
941  theDataLocation = 0;
942 }
char theSignificantRows[9]
FIELD: NROWS.
ossim_uint16 theBlockMaskRecordLength
FIELD NAME: BMRLNTH.
char theNumberOfPixelsPerBlockVert[5]
FIELD: NPPBV.
char theNumberOfPixelsPerBlockHoriz[5]
FIELD: NPPBH.
char theCompressionRateCode[5]
FIELD COMRAT.
ossim_uint32 theBlockedImageDataOffset
FIELD NAME: IMDATOFF.
char theRepresentation[9]
FIELD: IREP.
ossim_uint16 thePadPixelMaskRecordLength
FIELD: TMRLNTH.
char theNumberOfBands[2]
FIELD: NBANDS.
char theUserDefinedImageDataLength[6]
FIELD: UDIDL.
ossim_uint16 thePadOutputPixelCode
FIELD: TPXCD.
char theActualBitsPerPixelPerBand[3]
FIELD: ABPP.
ossimRefPtr< ossimNitfCompressionHeader > theCompressionHeader
char theNumberOfBitsPerPixelPerBand[3]
FIELD: NBPP.
char theNumberOfBlocksPerRow[5]
FIELD: NBPR.
char theGeographicLocation[61]
FIELD: IGEOLO.
char theImageId[11]
FIELD: IID1 Is a required 10 Alphanumeric value.
std::vector< ossim_uint32 > thePadPixelMaskRecords
char theExtendedSubheaderDataLen[6]
FIELD: IXSHDL.
std::vector< ossimNitfTagInformation > theTagList
char theImageMode[2]
FIELD: IMODE.
char theTargetId[18]
FIELD: TGTID.
char theImageLocation[11]
FIELD: ILOC.
char theImageSyncCode[2]
FIELD: ISYNC.
char theAttachmentLevel[4]
FIELD: IALVL.
char theJustification[2]
FIELD: PJUST.
char theUserDefinedOverflow[4]
FIELD: UDOFL.
char theNumberOfBlocksPerCol[5]
FIELD: NBPC.
char theDisplayLevel[4]
FIELD: IDLVL.
char theImageSource[43]
FIELD: ISORCE.
std::vector< ossim_uint32 > theBlockMaskRecords
char theSecurityClassification[2]
FIELD: ISCLAS.
ossim_uint16 theTransparentOutputPixelCodeLength
FIELD: TPXCDLNTH.
char theCoordinateSystem[2]
FIELD: ICORDS.
char theSignificantCols[9]
FIELD: NCOLS.
char theExtendedSubheaderOverflow[4]
FIELD: IXSOFL.
char thePixelValueType[4]
FIELD: PVTYPE.
char theImageMagnification[5]
FIELD: IMAG.

◆ getAcquisitionDateMonthDayYear()

ossimString ossimNitfImageHeaderV2_0::getAcquisitionDateMonthDayYear ( ossim_uint8  separationChar = '-') const
virtual

Implements ossimNitfImageHeader.

Definition at line 673 of file ossimNitfImageHeaderV2_0.cpp.

References ossimString::downcase(), ossimNitfImageHeaderV2_X::theDateTime, and ossimString::toUInt32().

674 {
675  ossimString result;
676  ossimString month(theDateTime+9,
677  theDateTime+12);
678  month = month.downcase();
679  if(month == "jan")
680  {
681  result += "01";
682  }
683  else if(month == "feb")
684  {
685  result += "02";
686  }
687  else if(month == "mar")
688  {
689  result += "03";
690  }
691  else if(month == "apr")
692  {
693  result += "04";
694  }
695  else if(month == "may")
696  {
697  result += "05";
698  }
699  else if(month == "jun")
700  {
701  result += "06";
702  }
703  else if(month == "jul")
704  {
705  result += "07";
706  }
707  else if(month == "aug")
708  {
709  result += "08";
710  }
711  else if(month == "sep")
712  {
713  result += "09";
714  }
715  else if(month == "oct")
716  {
717  result += "10";
718  }
719  else if(month == "nov")
720  {
721  result += "11";
722  }
723  else if(month == "dec")
724  {
725  result += "12";
726  }
727  result += ossimString(separationChar);
728  result += ossimString(theDateTime,
729  theDateTime + 2);
730  result += ossimString(separationChar);
731  ossimString year(theDateTime+12,
732  theDateTime+14);
733  if(year.toUInt32() < 70)
734  {
735  result += "20";
736  }
737  else
738  {
739  result += "19";
740  }
741  result += ossimString(theDateTime+12,
742  theDateTime+14);
743 
744  return result;
745 }

◆ getActualBitsPerPixelPerBand()

ossim_int32 ossimNitfImageHeaderV2_0::getActualBitsPerPixelPerBand ( ) const
virtual

◆ getBandInformation()

const ossimRefPtr< ossimNitfImageBand > ossimNitfImageHeaderV2_0::getBandInformation ( ossim_uint32  idx) const
virtual

Implements ossimNitfImageHeader.

Definition at line 949 of file ossimNitfImageHeaderV2_0.cpp.

References theImageBands.

950 {
951  if(idx < theImageBands.size())
952  {
953  return (ossimNitfImageBand*)theImageBands[idx].get();
954  }
955 
956  return NULL;
957 }
std::vector< ossimRefPtr< ossimNitfImageBandV2_0 > > theImageBands
Will contain also the field NBANDS and we will have to recreate the prefix for.

◆ getBitsPerPixelPerBand()

ossim_int32 ossimNitfImageHeaderV2_0::getBitsPerPixelPerBand ( ) const
virtual

◆ getBlockMaskRecordOffset()

ossim_uint32 ossimNitfImageHeaderV2_0::getBlockMaskRecordOffset ( ossim_uint32  blockNumber,
ossim_uint32  bandNumber 
) const
virtual

Implements ossimNitfImageHeader.

Definition at line 792 of file ossimNitfImageHeaderV2_0.cpp.

References getNumberOfBands(), getNumberOfBlocksPerCol(), getNumberOfBlocksPerRow(), hasBlockMaskRecords(), ossimNitfImageHeaderV2_X::theBlockMaskRecords, and ossimNitfImageHeaderV2_X::theImageMode.

794 {
796  ossim_uint32 result = 0xffffffff;
797 
798  if((hasBlockMaskRecords())&&
799  (blockNumber < maxBlock))
800  {
801  if(theImageMode[0] == 'S')
802  {
803  if(bandNumber < (ossim_uint32)getNumberOfBands())
804  {
805  result = theBlockMaskRecords[bandNumber*maxBlock + blockNumber];
806  }
807  }
808  else
809  {
810  result = theBlockMaskRecords[blockNumber];
811  }
812  }
813 
814  return result;
815 }
virtual ossim_int32 getNumberOfBlocksPerCol() const
virtual ossim_int32 getNumberOfBands() const
char theImageMode[2]
FIELD: IMODE.
virtual bool hasBlockMaskRecords() const
unsigned int ossim_uint32
virtual ossim_int32 getNumberOfBlocksPerRow() const
std::vector< ossim_uint32 > theBlockMaskRecords

◆ getCategory()

ossimString ossimNitfImageHeaderV2_0::getCategory ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 747 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theCategory.

748 {
749  return theCategory;
750 }

◆ getCompressionHeader()

const ossimRefPtr< ossimNitfCompressionHeader > ossimNitfImageHeaderV2_0::getCompressionHeader ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 944 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theCompressionHeader.

945 {
946  return theCompressionHeader;
947 }
ossimRefPtr< ossimNitfCompressionHeader > theCompressionHeader

◆ getCoordinateSystem()

ossimString ossimNitfImageHeaderV2_0::getCoordinateSystem ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 762 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theCoordinateSystem.

763 {
764  return theCoordinateSystem;
765 }
char theCoordinateSystem[2]
FIELD: ICORDS.

◆ getImageDateAndTime()

ossimString ossimNitfImageHeaderV2_0::getImageDateAndTime ( ) const
virtual
Returns
The IDATIM field unparsed.

Implements ossimNitfImageHeader.

Definition at line 668 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theDateTime.

◆ getImageId()

ossimString ossimNitfImageHeaderV2_0::getImageId ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 643 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theImageId.

Referenced by parseStream().

644 {
645  return theImageId;
646 }
char theImageId[11]
FIELD: IID1 Is a required 10 Alphanumeric value.

◆ getImageSource()

ossimString ossimNitfImageHeaderV2_0::getImageSource ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 752 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theImageSource.

753 {
754  return theImageSource;
755 }
char theImageSource[43]
FIELD: ISORCE.

◆ getIMode()

ossimString ossimNitfImageHeaderV2_0::getIMode ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 658 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theImageMode, and ossimString::trim().

659 {
660  return ossimString(theImageMode).trim();
661 }
char theImageMode[2]
FIELD: IMODE.
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.

◆ getNumberOfBands()

ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfBands ( ) const
virtual

◆ getNumberOfBlocksPerCol()

ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfBlocksPerCol ( ) const
virtual

◆ getNumberOfBlocksPerRow()

ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfBlocksPerRow ( ) const
virtual

◆ getNumberOfCols()

ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfCols ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 618 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theSignificantCols, and ossimString::toInt32().

619 {
621 }
ossim_int32 toInt32() const
char theSignificantCols[9]
FIELD: NCOLS.

◆ getNumberOfPixelsPerBlockHoriz()

ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfPixelsPerBlockHoriz ( ) const
virtual

◆ getNumberOfPixelsPerBlockVert()

ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfPixelsPerBlockVert ( ) const
virtual

◆ getNumberOfRows()

ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfRows ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 613 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theSignificantRows, and ossimString::toInt32().

614 {
616 }
char theSignificantRows[9]
FIELD: NROWS.
ossim_int32 toInt32() const

◆ getPadPixelMaskRecordOffset()

ossim_uint32 ossimNitfImageHeaderV2_0::getPadPixelMaskRecordOffset ( ossim_uint32  blockNumber,
ossim_uint32  bandNumber 
) const
virtual

Implements ossimNitfImageHeader.

Definition at line 816 of file ossimNitfImageHeaderV2_0.cpp.

References getNumberOfBands(), getNumberOfBlocksPerCol(), getNumberOfBlocksPerRow(), hasPadPixelMaskRecords(), ossimNitfImageHeaderV2_X::theImageMode, and ossimNitfImageHeaderV2_X::thePadPixelMaskRecords.

818 {
820  ossim_uint32 result = 0xffffffff;
821 
822  if((hasPadPixelMaskRecords())&&
823  (blockNumber < maxBlock))
824  {
825  if(theImageMode[0] == 'S')
826  {
827  if(bandNumber < (ossim_uint32)getNumberOfBands())
828  {
829  result = thePadPixelMaskRecords[bandNumber*maxBlock + blockNumber];
830  }
831  }
832  else
833  {
834  result = thePadPixelMaskRecords[blockNumber];
835  }
836  }
837 
838  return result;
839 }
virtual ossim_int32 getNumberOfBlocksPerCol() const
std::vector< ossim_uint32 > thePadPixelMaskRecords
virtual ossim_int32 getNumberOfBands() const
char theImageMode[2]
FIELD: IMODE.
unsigned int ossim_uint32
virtual ossim_int32 getNumberOfBlocksPerRow() const
virtual bool hasPadPixelMaskRecords() const

◆ getPixelValueType()

ossimString ossimNitfImageHeaderV2_0::getPixelValueType ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 767 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::thePixelValueType, and ossimString::trim().

768 {
770 }
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
char thePixelValueType[4]
FIELD: PVTYPE.

◆ getProperty()

ossimRefPtr< ossimProperty > ossimNitfImageHeaderV2_0::getProperty ( const ossimString name) const
virtual

Reimplemented from ossimNitfImageHeaderV2_X.

Definition at line 1016 of file ossimNitfImageHeaderV2_0.cpp.

References CTLN_KW, ossimNitfImageHeaderV2_X::getProperty(), ISCAUT_KW, ISCODE_KW, ISCTLH_KW, ISDEVT_KW, ISDWNG_KW, ISREL_KW, theClassificationAuthority, theCodewords, theControlAndHandling, theDowngradingEvent, theReleasingInstructions, theSecurityControlNumber, and theSecurityDowngrade.

1017 {
1018  ossimRefPtr<ossimProperty> property = 0;
1019  if(name == ISCODE_KW)
1020  {
1021  property = new ossimStringProperty(name, theCodewords);
1022  }
1023  else if(name == ISCTLH_KW)
1024  {
1025  property = new ossimStringProperty(name, theControlAndHandling);
1026  }
1027  else if(name == ISREL_KW)
1028  {
1029  property = new ossimStringProperty(name, theReleasingInstructions);
1030  }
1031  else if(name == ISCAUT_KW)
1032  {
1033  property = new ossimStringProperty(name, theClassificationAuthority);
1034  }
1035  else if(name == CTLN_KW)
1036  {
1037  property = new ossimStringProperty(name, theSecurityControlNumber);
1038  }
1039  else if(name == ISDWNG_KW)
1040  {
1041  property = new ossimStringProperty(name, theSecurityDowngrade);
1042  }
1043  else if(name == ISDEVT_KW)
1044  {
1045  property = new ossimStringProperty(name, theDowngradingEvent);
1046  }
1047  else
1048  {
1049  property = ossimNitfImageHeaderV2_X::getProperty(name);
1050  }
1051  return property;
1052 }
static const ossimString ISDWNG_KW
static const ossimString ISDEVT_KW
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
static const ossimString ISCAUT_KW
static const ossimString ISREL_KW
static const ossimString ISCODE_KW
static const ossimString CTLN_KW
static const ossimString ISCTLH_KW

◆ getPropertyNames()

void ossimNitfImageHeaderV2_0::getPropertyNames ( std::vector< ossimString > &  propertyNames) const
virtual

Reimplemented from ossimNitfImageHeaderV2_X.

Definition at line 1054 of file ossimNitfImageHeaderV2_0.cpp.

References CTLN_KW, ossimNitfImageHeaderV2_X::getPropertyNames(), ISCAUT_KW, ISCODE_KW, ISCTLH_KW, ISDEVT_KW, ISDWNG_KW, and ISREL_KW.

1055 {
1057  propertyNames.push_back(ISCODE_KW);
1058  propertyNames.push_back(ISCTLH_KW);
1059  propertyNames.push_back(ISREL_KW);
1060  propertyNames.push_back(ISCAUT_KW);
1061  propertyNames.push_back(CTLN_KW);
1062  propertyNames.push_back(ISDWNG_KW);
1063  propertyNames.push_back(ISDEVT_KW);
1064 }
static const ossimString ISDWNG_KW
static const ossimString ISDEVT_KW
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
static const ossimString ISCAUT_KW
static const ossimString ISREL_KW
static const ossimString ISCODE_KW
static const ossimString CTLN_KW
static const ossimString ISCTLH_KW

◆ getRepresentation()

ossimString ossimNitfImageHeaderV2_0::getRepresentation ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 757 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theRepresentation.

758 {
759  return theRepresentation;
760 }
char theRepresentation[9]
FIELD: IREP.

◆ getSecurityClassification()

ossimString ossimNitfImageHeaderV2_0::getSecurityClassification ( ) const
virtual

◆ getTransparentCode()

ossim_uint32 ossimNitfImageHeaderV2_0::getTransparentCode ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 787 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::thePadOutputPixelCode.

788 {
789  return thePadOutputPixelCode;
790 }
ossim_uint16 thePadOutputPixelCode
FIELD: TPXCD.

◆ hasBlockMaskRecords()

bool ossimNitfImageHeaderV2_0::hasBlockMaskRecords ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 772 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theBlockMaskRecords.

Referenced by getBlockMaskRecordOffset().

773 {
774  return (theBlockMaskRecords.size() > 0);
775 }
std::vector< ossim_uint32 > theBlockMaskRecords

◆ hasPadPixelMaskRecords()

bool ossimNitfImageHeaderV2_0::hasPadPixelMaskRecords ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 777 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::thePadPixelMaskRecords.

Referenced by getPadPixelMaskRecordOffset().

778 {
779  return (thePadPixelMaskRecords.size() > 0);
780 }
std::vector< ossim_uint32 > thePadPixelMaskRecords

◆ hasTransparentCode()

bool ossimNitfImageHeaderV2_0::hasTransparentCode ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 782 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theTransparentOutputPixelCodeLength.

783 {
785 }
ossim_uint16 theTransparentOutputPixelCodeLength
FIELD: TPXCDLNTH.

◆ isCompressed()

bool ossimNitfImageHeaderV2_0::isCompressed ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 595 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theCompression, and ossimString::trim().

596 {
598  temp = temp.trim();
599  return ((temp != "NC") &&
600  (temp != "NM"));
601 }
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.

◆ isEncrypted()

bool ossimNitfImageHeaderV2_0::isEncrypted ( ) const
virtual

Implements ossimNitfImageHeader.

Definition at line 603 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theEncryption.

604 {
605  return (theEncryption[0] == '1');
606 }

◆ isValid()

bool ossimNitfImageHeaderV2_0::isValid ( ) const
virtual

isValid will test if the fields are valid and will return true or false.

Reimplemented from ossimNitfImageHeaderV2_X.

Definition at line 418 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::isValid().

419 {
420  bool result = ossimNitfImageHeaderV2_X::isValid();
421 
422  if(result)
423  {
424 
425  }
426 
427  return result;
428 }
virtual bool isValid() const
isValid will test if the fields are valid and will return true or false.

◆ parseStream()

void ossimNitfImageHeaderV2_0::parseStream ( ossim::istream in)
virtual

Implements ossimNitfImageHeader.

Definition at line 53 of file ossimNitfImageHeaderV2_0.cpp.

References clearFields(), ossimRefPtr< T >::get(), ossimNitfVqCompressionHeader::getCompressionAlgorithmId(), ossimNitfImageHeaderV2_X::getCompressionCode(), getImageId(), getNumberOfBands(), getNumberOfBlocksPerCol(), getNumberOfBlocksPerRow(), ossimEndian::getSystemEndianType(), OSSIM_LITTLE_ENDIAN, ossimNitfTagInformation::parseStream(), ossimNitfVqCompressionHeader::parseStream(), ossimEndian::swap(), ossimNitfImageHeaderV2_X::theActualBitsPerPixelPerBand, ossimNitfImageHeaderV2_X::theAttachmentLevel, ossimNitfImageHeaderV2_X::theBlockedImageDataOffset, ossimNitfImageHeaderV2_X::theBlockMaskRecordLength, ossimNitfImageHeaderV2_X::theBlockMaskRecords, ossimNitfImageHeaderV2_X::theCategory, theClassificationAuthority, theCodewords, ossimNitfImageHeaderV2_X::theCompression, ossimNitfImageHeaderV2_X::theCompressionHeader, ossimNitfImageHeaderV2_X::theCompressionRateCode, theControlAndHandling, ossimNitfImageHeaderV2_X::theCoordinateSystem, ossimNitfImageHeaderV2_X::theDataLocation, ossimNitfImageHeaderV2_X::theDateTime, ossimNitfImageHeaderV2_X::theDisplayLevel, theDowngradingEvent, ossimNitfImageHeaderV2_X::theEncryption, ossimNitfImageHeaderV2_X::theExtendedSubheaderDataLen, ossimNitfImageHeaderV2_X::theExtendedSubheaderOverflow, ossimNitfImageHeaderV2_X::theGeographicLocation, theImageBands, ossimNitfImageHeaderV2_X::theImageComments, ossimNitfImageHeaderV2_X::theImageId, ossimNitfImageHeaderV2_X::theImageLocation, ossimNitfImageHeaderV2_X::theImageMagnification, ossimNitfImageHeaderV2_X::theImageMode, ossimNitfImageHeaderV2_X::theImageSource, ossimNitfImageHeaderV2_X::theImageSyncCode, ossimNitfImageHeaderV2_X::theJustification, ossimNitfImageHeaderV2_X::theNumberOfBands, ossimNitfImageHeaderV2_X::theNumberOfBitsPerPixelPerBand, ossimNitfImageHeaderV2_X::theNumberOfBlocksPerCol, ossimNitfImageHeaderV2_X::theNumberOfBlocksPerRow, ossimNitfImageHeaderV2_X::theNumberOfComments, ossimNitfImageHeaderV2_X::theNumberOfPixelsPerBlockHoriz, ossimNitfImageHeaderV2_X::theNumberOfPixelsPerBlockVert, ossimNitfImageHeaderV2_X::thePadOutputPixelCode, ossimNitfImageHeaderV2_X::thePadPixelMaskRecordLength, ossimNitfImageHeaderV2_X::thePadPixelMaskRecords, ossimNitfImageHeaderV2_X::thePixelValueType, theReleasingInstructions, ossimNitfImageHeaderV2_X::theRepresentation, ossimNitfImageHeaderV2_X::theSecurityClassification, theSecurityControlNumber, theSecurityDowngrade, ossimNitfImageHeaderV2_X::theSignificantCols, ossimNitfImageHeaderV2_X::theSignificantRows, ossimNitfImageHeader::theTagList, ossimNitfImageHeaderV2_X::theTargetId, ossimNitfImageHeaderV2_X::theTitle, ossimNitfImageHeaderV2_X::theTransparentOutputPixelCodeLength, ossimNitfImageHeaderV2_X::theType, ossimNitfImageHeaderV2_X::theUserDefinedImageDataLength, ossimNitfImageHeaderV2_X::theUserDefinedOverflow, ossimString::toInt32(), ossimString::toUInt32(), ossimString::trim(), and ossimString::upcase().

54 {
55  clearFields();
56  theImageBands.clear();
57 
58  in.read(theType, 2);
59  if(ossimString(theType) != "IM")
60  {
61  // error
62  }
63  in.read(theImageId, 10);
64  in.read(theDateTime, 14);
65  in.read(theTargetId, 17);
66  in.read(theTitle, 80);
67  in.read(theSecurityClassification, 1);
68  in.read(theCodewords, 40);
69  in.read(theControlAndHandling, 40);
70  in.read(theReleasingInstructions, 40);
71  in.read(theClassificationAuthority, 20);
72  in.read(theSecurityControlNumber, 20);
73  in.read(theSecurityDowngrade, 6);
74  if(ossimString(theSecurityDowngrade) == "999998")
75  {
76  in.read(theDowngradingEvent, 40);
77  }
78  in.read(theEncryption, 1);
79  in.read(theImageSource, 42);
80  in.read(theSignificantRows, 8);
81  in.read(theSignificantCols, 8);
82  in.read(thePixelValueType, 3);
83  in.read(theRepresentation, 8);
84  in.read(theCategory, 8);
85  in.read(theActualBitsPerPixelPerBand, 2);
86  in.read(theJustification, 1);
87  in.read(theCoordinateSystem, 1);
88  if(theCoordinateSystem[0] != 'N')
89  {
90  in.read(theGeographicLocation, 60);
91  }
92  in.read(theNumberOfComments, 1);
94 
95  // for now let's ignore the comments
96  if(numberOfComments > 0)
97  {
98  theImageComments.resize(numberOfComments);
99  for (ossim_uint32 i=0; i < numberOfComments; ++i)
100  {
101  char comment[81];
102  memset(comment, ' ', 80);
103  comment[80] = '\0';
104  in.read(comment, 80);
105  theImageComments[i] = ossimString(comment).trim();
106  }
107  }
108  in.read(theCompression, 2);
109  // check to see if there is compression
111  if((temp != "NC") &&
112  (temp != "NM"))
113  {
114  // get the rate if compression exists.
115  in.read(theCompressionRateCode, 4);
116  }
117  in.read(theNumberOfBands, 1);
119  theImageBands.resize(numberOfBands);
120  ossim_uint32 idx = 0;
121  while(idx < numberOfBands)
122  {
124  theImageBands[idx]->parseStream(in);
125  ++idx;
126  }
127  in.read(theImageSyncCode, 1);
128  in.read(theImageMode, 1);
129  in.read(theNumberOfBlocksPerRow, 4);
130  in.read(theNumberOfBlocksPerCol, 4);
131  in.read(theNumberOfPixelsPerBlockHoriz, 4);
132  in.read(theNumberOfPixelsPerBlockVert, 4);
133  in.read(theNumberOfBitsPerPixelPerBand, 2);
134  in.read(theDisplayLevel, 3);
135  in.read(theAttachmentLevel, 3);
136  in.read(theImageLocation, 10);
137  in.read(theImageMagnification, 4);
138  in.read(theUserDefinedImageDataLength, 5);
139  std::streampos userDefinedDataLen = (std::streampos)ossimString(theUserDefinedImageDataLength).toUInt32();
140  theTagList.clear();
141  ossimNitfTagInformation headerTag;
142  std::streampos start = in.tellg();
143  std::streampos current = in.tellg();
144  if(userDefinedDataLen > 0)
145  {
146  in.read(theUserDefinedOverflow, 3);
147 
148  while((current - start) < userDefinedDataLen)
149  {
150  headerTag.parseStream(in);
151  theTagList.push_back(headerTag);
152  // in.ignore(headerTag.getTagLength());
153  // headerTag.clearFields();
154  current = in.tellg();
155  }
156  }
157 
158  in.read(theExtendedSubheaderDataLen, 5);
159  std::streampos extSubHeadLen = (std::streampos)ossimString(theExtendedSubheaderDataLen).toUInt32();
160  start = in.tellg();
161  current = in.tellg();
162  if(extSubHeadLen > 0)
163  {
164  in.read(theExtendedSubheaderOverflow, 3);
165 
166  // ossim_uint32 test = 0;
167  while((current - start) < extSubHeadLen)
168  {
169  headerTag.parseStream(in);
170  theTagList.push_back(headerTag);
171  // test = headerTag.getTagLength()+in.tellg();
172  // in.ignore(headerTag.getTagLength());
173  // headerTag.clearFields();
174  current = in.tellg();
175  }
176  }
177 
178  ossimString compressionType = theCompression;
179  compressionType = compressionType.trim().upcase();
180  ossimEndian endian;
181  ossim_uint64 locationBefore = in.tellg();
182 
183  //---
184  // Note: "C4" added to skip over the image data mask subheader.
185  // See MIL-STD-2500A paragraph 5.5.1.5
186  //
187  // Seems like CIB data does not have. Could not find a hard and fast
188  // rule in the specs. Need a better was to detect if this needs to be
189  // read. (drb - 20100317)
190  //---
191  if( (compressionType == "NM") ||
192  (compressionType == "M0") ||
193  (compressionType == "M3") ||
194  (compressionType == "M4") ||
195  ( (compressionType == "C4") && ( !getImageId().contains("CIB")) ) )
196  {
197  in.read((char*)(&theBlockedImageDataOffset), 4);
198  in.read((char*)(&theBlockMaskRecordLength),2);
199  in.read((char*)(&thePadPixelMaskRecordLength), 2);
200  in.read((char*)(&theTransparentOutputPixelCodeLength), 2);
201 
202 
204  {
209  }
211  {
213  {
214  ossim_uint8 padOutputPixelCode;
215  in.read((char*)(&padOutputPixelCode), 1);
216  thePadOutputPixelCode = padOutputPixelCode;
217  }
218  }
219  else
220  {
221  in.read((char*)(&thePadOutputPixelCode), 2);
223  {
224  endian.swap(thePadOutputPixelCode);
225  }
226  // I need to add code here to check for justification when its 2 bytes
227  // but the code length is less than 16 bits.
228  //
229  }
231  {
232  ossim_uint32 totalNumber = 0;
233  if(theImageMode[0] == 'S')
234  {
236  }
237  else
238  {
240  }
241  ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
242  ossim_uint32 idx = 0;
243  theBlockMaskRecords.resize(totalNumber);
244  in.read((char*)(blockRead), totalNumber*4);
245  for(idx = 0; idx < totalNumber; ++idx)
246  {
248  {
249  endian.swap(blockRead[idx]);
250  }
251  theBlockMaskRecords[idx] = blockRead[idx];
252  }
253  delete [] blockRead;
254  }
255  if((thePadPixelMaskRecordLength > 0)||
256  (( (getCompressionCode().upcase() == "M3"))&&
258  {
259  ossim_uint32 totalNumber = 0;
260  if(theImageMode[0] == 'S')
261  {
263  }
264  else
265  {
267  }
268  ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
269  ossim_uint32 idx = 0;
270  thePadPixelMaskRecords.resize(totalNumber);
271  in.read((char*)(blockRead), totalNumber*4);
272  for(idx = 0; idx < totalNumber; ++idx)
273  {
275  {
276  endian.swap(blockRead[idx]);
277  }
278  thePadPixelMaskRecords[idx] = blockRead[idx];
279  }
280  delete [] blockRead;
281  }
282  }
283 
285  if((getCompressionCode() == "C4")||
286  (getCompressionCode() == "M4"))
287  {
290  compressionHeader->parseStream(in);
291  // do a check to see if the compression header is good
292  //
293 
294  if( compressionHeader->getCompressionAlgorithmId()!= 1 )
295  {
296  compressionHeader = 0;
297  }
298  theCompressionHeader = compressionHeader.get();
299  }
300 
301  ossim_uint64 delta = (ossim_uint64)in.tellg() - locationBefore;
302  if(delta < theBlockedImageDataOffset)
303  {
304  in.ignore(theBlockedImageDataOffset-delta);
305  }
306 
307  //
308  // The stream should now be at the start of the data location so capture
309  // it.
310  //
311  theDataLocation = in.tellg();
312 }
char theSignificantRows[9]
FIELD: NROWS.
ossim_uint16 theBlockMaskRecordLength
FIELD NAME: BMRLNTH.
char theNumberOfPixelsPerBlockVert[5]
FIELD: NPPBV.
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
char theNumberOfPixelsPerBlockHoriz[5]
FIELD: NPPBH.
char theCompressionRateCode[5]
FIELD COMRAT.
ossim_uint32 theBlockedImageDataOffset
FIELD NAME: IMDATOFF.
virtual ossim_int32 getNumberOfBlocksPerCol() const
char theRepresentation[9]
FIELD: IREP.
ossim_uint16 thePadPixelMaskRecordLength
FIELD: TMRLNTH.
char theNumberOfBands[2]
FIELD: NBANDS.
virtual void parseStream(ossim::istream &in)
virtual ossimString getImageId() const
char theUserDefinedImageDataLength[6]
FIELD: UDIDL.
ossim_uint16 thePadOutputPixelCode
FIELD: TPXCD.
char theActualBitsPerPixelPerBand[3]
FIELD: ABPP.
ossimRefPtr< ossimNitfCompressionHeader > theCompressionHeader
ossim_uint32 toUInt32() const
char theNumberOfBitsPerPixelPerBand[3]
FIELD: NBPP.
char theNumberOfBlocksPerRow[5]
FIELD: NBPR.
char theGeographicLocation[61]
FIELD: IGEOLO.
char theImageId[11]
FIELD: IID1 Is a required 10 Alphanumeric value.
ossim_int32 toInt32() const
std::vector< ossim_uint32 > thePadPixelMaskRecords
virtual ossim_int32 getNumberOfBands() const
char theExtendedSubheaderDataLen[6]
FIELD: IXSHDL.
std::vector< ossimNitfTagInformation > theTagList
char theImageMode[2]
FIELD: IMODE.
char theTargetId[18]
FIELD: TGTID.
char theImageLocation[11]
FIELD: ILOC.
char theImageSyncCode[2]
FIELD: ISYNC.
char theAttachmentLevel[4]
FIELD: IALVL.
char theJustification[2]
FIELD: PJUST.
unsigned long long ossim_uint64
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
char theUserDefinedOverflow[4]
FIELD: UDOFL.
virtual ossim_uint32 getCompressionAlgorithmId() const
virtual void parseStream(std::istream &in)
virtual ossim_int32 getNumberOfBlocksPerRow() const
char theNumberOfBlocksPerCol[5]
FIELD: NBPC.
char theDisplayLevel[4]
FIELD: IDLVL.
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
char theImageSource[43]
FIELD: ISORCE.
std::vector< ossimRefPtr< ossimNitfImageBandV2_0 > > theImageBands
Will contain also the field NBANDS and we will have to recreate the prefix for.
std::vector< ossim_uint32 > theBlockMaskRecords
char theSecurityClassification[2]
FIELD: ISCLAS.
ossim_uint16 theTransparentOutputPixelCodeLength
FIELD: TPXCDLNTH.
char theCoordinateSystem[2]
FIELD: ICORDS.
char theSignificantCols[9]
FIELD: NCOLS.
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
char theExtendedSubheaderOverflow[4]
FIELD: IXSOFL.
unsigned char ossim_uint8
std::vector< ossimString > theImageComments
char thePixelValueType[4]
FIELD: PVTYPE.
char theImageMagnification[5]
FIELD: IMAG.

◆ print()

std::ostream & ossimNitfImageHeaderV2_0::print ( std::ostream &  out,
const std::string &  prefix = std::string() 
) const
virtual

print method that outputs a key/value type format adding prefix to keys.

Implements ossimNitfImageHeader.

Definition at line 429 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::theActualBitsPerPixelPerBand, ossimNitfImageHeaderV2_X::theAttachmentLevel, ossimNitfImageHeaderV2_X::theCategory, theClassificationAuthority, theCodewords, ossimNitfImageHeaderV2_X::theCompression, ossimNitfImageHeaderV2_X::theCompressionRateCode, theControlAndHandling, ossimNitfImageHeaderV2_X::theCoordinateSystem, ossimNitfImageHeaderV2_X::theDateTime, ossimNitfImageHeaderV2_X::theDisplayLevel, theDowngradingEvent, ossimNitfImageHeaderV2_X::theEncryption, ossimNitfImageHeaderV2_X::theExtendedSubheaderDataLen, ossimNitfImageHeaderV2_X::theExtendedSubheaderOverflow, ossimNitfImageHeaderV2_X::theGeographicLocation, theImageBands, ossimNitfImageHeaderV2_X::theImageComments, ossimNitfImageHeaderV2_X::theImageId, ossimNitfImageHeaderV2_X::theImageLocation, ossimNitfImageHeaderV2_X::theImageMagnification, ossimNitfImageHeaderV2_X::theImageMode, ossimNitfImageHeaderV2_X::theImageSource, ossimNitfImageHeaderV2_X::theImageSyncCode, ossimNitfImageHeaderV2_X::theJustification, ossimNitfImageHeaderV2_X::theNumberOfBands, ossimNitfImageHeaderV2_X::theNumberOfBitsPerPixelPerBand, ossimNitfImageHeaderV2_X::theNumberOfBlocksPerCol, ossimNitfImageHeaderV2_X::theNumberOfBlocksPerRow, ossimNitfImageHeaderV2_X::theNumberOfComments, ossimNitfImageHeaderV2_X::theNumberOfPixelsPerBlockHoriz, ossimNitfImageHeaderV2_X::theNumberOfPixelsPerBlockVert, ossimNitfImageHeaderV2_X::thePixelValueType, theReleasingInstructions, ossimNitfImageHeaderV2_X::theRepresentation, ossimNitfImageHeaderV2_X::theSecurityClassification, theSecurityControlNumber, theSecurityDowngrade, ossimNitfImageHeaderV2_X::theSignificantCols, ossimNitfImageHeaderV2_X::theSignificantRows, ossimNitfImageHeaderV2_X::theTargetId, ossimNitfImageHeaderV2_X::theTitle, ossimNitfImageHeaderV2_X::theType, ossimNitfImageHeaderV2_X::theUserDefinedImageDataLength, ossimNitfImageHeaderV2_X::theUserDefinedOverflow, and ossimString::toString().

431 {
432  out << setiosflags(std::ios::left)
433  << prefix << std::setw(24) << "IM:"
434  << theType << "\n"
435  << prefix << std::setw(24) << "IID:"
436  << theImageId << "\n"
437  << prefix << std::setw(24) << "IDATIM:"
438  << theDateTime << "\n"
439  << prefix << std::setw(24) << "TGTID:"
440  << theTargetId << "\n"
441  << prefix << std::setw(24) << "ITITLE:"
442  << theTitle << "\n"
443  << prefix << std::setw(24) << "ISCLAS:"
444  << theSecurityClassification << "\n"
445  << prefix << std::setw(24) << "ISCODE:"
446  << theCodewords << "\n"
447  << prefix << std::setw(24) << "ISCTLH:"
448  << theControlAndHandling << "\n"
449  << prefix << std::setw(24) << "ISREL:"
450  << theReleasingInstructions << "\n"
451  << prefix << std::setw(24) << "ISCAUT:"
452  << theClassificationAuthority << "\n"
453  << prefix << std::setw(24) << "ISCTLN:"
454  << theSecurityControlNumber << "\n"
455  << prefix << std::setw(24) << "ISDWNG:"
456  << theSecurityDowngrade << "\n"
457  << prefix << std::setw(24) << "ISDEBT:"
458  << theDowngradingEvent << "\n"
459  << prefix << std::setw(24) << "ENCRYP:"
460  << theEncryption << "\n"
461  << prefix << std::setw(24) << "ISORCE:"
462  << theImageSource << "\n"
463  << prefix << std::setw(24) << "NROWS:"
464  << theSignificantRows << "\n"
465  << prefix << std::setw(24) << "NCOLS:"
466  << theSignificantCols << "\n"
467  << prefix << std::setw(24) << "PVTYPE:"
468  << thePixelValueType << "\n"
469  << prefix << std::setw(24) << "IREP:"
470  << theRepresentation << "\n"
471  << prefix << std::setw(24) << "ICAT:"
472  << theCategory << "\n"
473  << prefix << std::setw(24) << "ABPP:"
475  << prefix << std::setw(24) << "PJUST:"
476  << theJustification << "\n"
477  << prefix << std::setw(24) << "ICORDS:"
478  << theCoordinateSystem << "\n"
479  << prefix << std::setw(24) << "IGEOLO:"
480  << theGeographicLocation << "\n"
481  << prefix << std::setw(24) << "NICOM:"
482  << theNumberOfComments << "\n";
483 
484  ossim_uint32 idx = 0;
485  for(idx = 0; idx < theImageComments.size(); ++idx)
486  {
487  ossimString icpre = "ICOM" + ossimString::toString(idx) + ":";
488  out << prefix << std::setw(24) << icpre << theImageComments[idx].trim() << "\n";
489  }
490  out << prefix << std::setw(24) << "IC:"
491  << theCompression << "\n"
492  << prefix << std::setw(24) << "COMRAT:"
493  << theCompressionRateCode << "\n"
494  << prefix << std::setw(24) << "NBANDS:"
495  << theNumberOfBands << "\n";
496 
497  for(idx = 0; idx < theImageBands.size(); ++idx)
498  {
499  if(theImageBands[idx].valid())
500  {
501  theImageBands[idx]->print(out, prefix, idx);
502  }
503  }
504 
505  out << prefix << std::setw(24) << "ISYNC:"
506  << theImageSyncCode << "\n"
507  << prefix << std::setw(24) << "IMODE:"
508  << theImageMode << "\n"
509  << prefix << std::setw(24) << "NBPR:"
510  << theNumberOfBlocksPerRow << "\n"
511  << prefix << std::setw(24) << "NBPC:"
512  << theNumberOfBlocksPerCol << "\n"
513  << prefix << std::setw(24) << "NPPBH:"
515  << prefix << std::setw(24) << "NPPBV:"
517  << prefix << std::setw(24) << "NBPP:"
519  << prefix << std::setw(24) << "IDLVL:"
520  << theDisplayLevel << "\n"
521  << prefix << std::setw(24) << "IALVL:"
522  << theAttachmentLevel << "\n"
523  << prefix << std::setw(24) << "ILOC:"
524  << theImageLocation << "\n"
525  << prefix << std::setw(24) << "IMAG:"
526  << theImageMagnification << "\n"
527  << prefix << std::setw(24) << "UDIDL:"
529  << prefix << std::setw(24) << "UDOFL:"
530  << theUserDefinedOverflow << "\n"
531  << prefix << std::setw(24) << "IXSHDL:"
532  << theExtendedSubheaderDataLen << "\n"
533  << prefix << std::setw(24) << "IXSOFL:"
534  << theExtendedSubheaderOverflow << "\n";
535 
536  if ( traceDebug() )
537  {
538  out << prefix << std::setw(24) << "theDataLocation:"
539  << theDataLocation << "\n"
540  << prefix << std::setw(24) << "theBlockedImageDataOffset:"
541  << theBlockedImageDataOffset << "\n"
542  << prefix << std::setw(24) << "theBlockMaskRecordLength:"
543  << theBlockMaskRecordLength << "\n"
544  << prefix << std::setw(24) << "thePadPixelMaskRecordLength:"
545  << thePadPixelMaskRecordLength << "\n"
546  << prefix << std::setw(24) << "theTransparentOutputPixelCodeLength:"
548  << prefix << std::setw(24) << "thePadOutputPixelCode:"
549  << thePadOutputPixelCode << "\n";
550  }
551 
553  {
554  theCompressionHeader->print(out, prefix);
555  }
556 
557  out << std::endl;
558 
559  return printTags(out, prefix);
560 }
char theSignificantRows[9]
FIELD: NROWS.
ossim_uint16 theBlockMaskRecordLength
FIELD NAME: BMRLNTH.
char theNumberOfPixelsPerBlockVert[5]
FIELD: NPPBV.
char theNumberOfPixelsPerBlockHoriz[5]
FIELD: NPPBH.
char theCompressionRateCode[5]
FIELD COMRAT.
ossim_uint32 theBlockedImageDataOffset
FIELD NAME: IMDATOFF.
char theRepresentation[9]
FIELD: IREP.
ossim_uint16 thePadPixelMaskRecordLength
FIELD: TMRLNTH.
bool valid() const
Definition: ossimRefPtr.h:75
char theNumberOfBands[2]
FIELD: NBANDS.
virtual std::ostream & print(std::ostream &out, const std::string &prefix) const =0
print method that outputs a key/value type format adding prefix to keys.
char theUserDefinedImageDataLength[6]
FIELD: UDIDL.
ossim_uint16 thePadOutputPixelCode
FIELD: TPXCD.
static ossimString toString(bool aValue)
Numeric to string methods.
char theActualBitsPerPixelPerBand[3]
FIELD: ABPP.
ossimRefPtr< ossimNitfCompressionHeader > theCompressionHeader
char theNumberOfBitsPerPixelPerBand[3]
FIELD: NBPP.
char theNumberOfBlocksPerRow[5]
FIELD: NBPR.
char theGeographicLocation[61]
FIELD: IGEOLO.
char theImageId[11]
FIELD: IID1 Is a required 10 Alphanumeric value.
char theExtendedSubheaderDataLen[6]
FIELD: IXSHDL.
char theImageMode[2]
FIELD: IMODE.
char theTargetId[18]
FIELD: TGTID.
char theImageLocation[11]
FIELD: ILOC.
char theImageSyncCode[2]
FIELD: ISYNC.
char theAttachmentLevel[4]
FIELD: IALVL.
char theJustification[2]
FIELD: PJUST.
unsigned int ossim_uint32
char theUserDefinedOverflow[4]
FIELD: UDOFL.
char theNumberOfBlocksPerCol[5]
FIELD: NBPC.
char theDisplayLevel[4]
FIELD: IDLVL.
char theImageSource[43]
FIELD: ISORCE.
std::vector< ossimRefPtr< ossimNitfImageBandV2_0 > > theImageBands
Will contain also the field NBANDS and we will have to recreate the prefix for.
char theSecurityClassification[2]
FIELD: ISCLAS.
ossim_uint16 theTransparentOutputPixelCodeLength
FIELD: TPXCDLNTH.
char theCoordinateSystem[2]
FIELD: ICORDS.
char theSignificantCols[9]
FIELD: NCOLS.
virtual std::ostream & printTags(std::ostream &out, const std::string &prefix=std::string()) const
print method that outputs a key/value type format adding prefix to keys.
char theExtendedSubheaderOverflow[4]
FIELD: IXSOFL.
std::vector< ossimString > theImageComments
char thePixelValueType[4]
FIELD: PVTYPE.
char theImageMagnification[5]
FIELD: IMAG.

◆ saveState()

bool ossimNitfImageHeaderV2_0::saveState ( ossimKeywordlist kwl,
const ossimString prefix = "" 
) const
virtual

Reimplemented from ossimNitfImageHeaderV2_X.

Definition at line 562 of file ossimNitfImageHeaderV2_0.cpp.

References ossimKeywordlist::add(), ossimKeywordlist::parseStream(), ossimNitfCompressionHeader::saveState(), ossimNitfImageHeaderV2_X::saveState(), ossimNitfImageHeaderV2_X::theCompressionHeader, theImageBands, ossimNitfImageHeaderV2_X::theTitle, and ossimRefPtr< T >::valid().

563 {
565  std::ostringstream out;
566 
567  kwl.add(prefix, "ITITLE", theTitle);
568 
569  ossim_uint32 idx = 0;
571  {
572  theCompressionHeader->saveState(kwl, prefix + "compression_header.");
573  }
574 
575  for(idx = 0; idx < theImageBands.size(); ++idx)
576  {
577  if(theImageBands[idx].valid())
578  {
579  theImageBands[idx]->print(out, "", idx);
580  }
581  }
582 
583  out << std::endl;
584 
585  ossimKeywordlist kwlTemp;
586 
587  std::istringstream in(out.str());
588  if(kwlTemp.parseStream(in))
589  {
590  kwl.add(prefix, kwlTemp);
591  }
592  return true;
593 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
virtual bool saveState(ossimKeywordlist &kwl, const ossimString &prefix="") const
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimNitfCompressionHeader > theCompressionHeader
virtual bool saveState(ossimKeywordlist &kwl, const ossimString &prefix="") const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
unsigned int ossim_uint32
std::vector< ossimRefPtr< ossimNitfImageBandV2_0 > > theImageBands
Will contain also the field NBANDS and we will have to recreate the prefix for.
virtual bool parseStream(ossim::istream &is, bool ignoreBinaryChars)
deprecated method
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32

◆ setBandInfo()

void ossimNitfImageHeaderV2_0::setBandInfo ( ossim_uint32  idx,
const ossimNitfImageBandV2_0 info 
)
virtual

Definition at line 981 of file ossimNitfImageHeaderV2_0.cpp.

References theImageBands.

Referenced by ossimNitf20Writer::writeBlockBandSeparate(), and ossimNitf20Writer::writeBlockBandSequential().

983 {
984  if(idx < theImageBands.size())
985  {
986  if(!theImageBands[idx].valid())
987  {
989  }
990  (*theImageBands[idx]) = info;
991  }
992 }
std::vector< ossimRefPtr< ossimNitfImageBandV2_0 > > theImageBands
Will contain also the field NBANDS and we will have to recreate the prefix for.

◆ setNumberOfBands()

void ossimNitfImageHeaderV2_0::setNumberOfBands ( ossim_uint32  nbands)
virtual

Definition at line 959 of file ossimNitfImageHeaderV2_0.cpp.

Referenced by ossimNitf20Writer::writeBlockBandSeparate(), and ossimNitf20Writer::writeBlockBandSequential().

960 {
961  std::ostringstream out;
962  if(nbands > 9)
963  {
964  if(traceDebug())
965  {
966  ossimNotify(ossimNotifyLevel_WARN) << "ossimNitfImageHeaderV2_0::setNumberOfBands: NBANDS is too large. For 2.0 spec we can only have up to 9 bands\n";
967  }
968  std::string s = "ossimNitfImageHeaderV2_0::setNumberOfBands:";
969  s += " ERROR\nExceeded max number of bands of 9!";
970  throw std::out_of_range(s);
971  }
972  else
973  {
974  out << nbands;
975  theNumberOfBands[0] = out.str().c_str()[0];
976  }
977 
979 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
char theNumberOfBands[2]
FIELD: NBANDS.
virtual ossim_int32 getNumberOfBands() const
std::vector< ossimRefPtr< ossimNitfImageBandV2_0 > > theImageBands
Will contain also the field NBANDS and we will have to recreate the prefix for.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ setNumberOfCols()

void ossimNitfImageHeaderV2_0::setNumberOfCols ( ossim_uint32  cols)
virtual

Definition at line 1002 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfCommon::setField(), and ossimNitfImageHeaderV2_X::theSignificantCols.

Referenced by ossimNitf20Writer::writeBlockBandSeparate(), and ossimNitf20Writer::writeBlockBandSequential().

1003 {
1004  std::ostringstream out;
1005  if(cols > 99999999) cols = 99999999;
1006 
1007  out << cols;
1008  ossimNitfCommon::setField(theSignificantCols, out.str(), 8, ios::right, '0');
1009 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.
char theSignificantCols[9]
FIELD: NCOLS.

◆ setNumberOfRows()

void ossimNitfImageHeaderV2_0::setNumberOfRows ( ossim_uint32  rows)
virtual

Definition at line 993 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfCommon::setField(), and ossimNitfImageHeaderV2_X::theSignificantRows.

Referenced by ossimNitf20Writer::writeBlockBandSeparate(), and ossimNitf20Writer::writeBlockBandSequential().

994 {
995  std::ostringstream out;
996  if(rows > 99999999) rows = 99999999;
997 
998  out << rows;
999  ossimNitfCommon::setField(theSignificantRows, out.str(), 8, ios::right, '0');
1000 }
char theSignificantRows[9]
FIELD: NROWS.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.

◆ setProperty()

void ossimNitfImageHeaderV2_0::setProperty ( ossimRefPtr< ossimProperty property)
virtual

Reimplemented from ossimNitfImageHeaderV2_X.

Definition at line 1011 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeaderV2_X::setProperty().

Referenced by ossimNitf20Writer::setProperty().

1012 {
1014 }
virtual void setProperty(ossimRefPtr< ossimProperty > property)

◆ writeStream()

void ossimNitfImageHeaderV2_0::writeStream ( ossim::ostream out)
virtual

Implements ossimNitfImageHeader.

Definition at line 314 of file ossimNitfImageHeaderV2_0.cpp.

References ossimNitfImageHeader::getTotalTagLength(), ossimNotify(), ossimNotifyLevel_WARN, ossimNitfImageHeaderV2_X::theActualBitsPerPixelPerBand, ossimNitfImageHeaderV2_X::theAttachmentLevel, ossimNitfImageHeaderV2_X::theCategory, theClassificationAuthority, theCodewords, ossimNitfImageHeaderV2_X::theCompression, ossimNitfImageHeaderV2_X::theCompressionRateCode, theControlAndHandling, ossimNitfImageHeaderV2_X::theCoordinateSystem, ossimNitfImageHeaderV2_X::theDateTime, ossimNitfImageHeaderV2_X::theDisplayLevel, theDowngradingEvent, ossimNitfImageHeaderV2_X::theEncryption, ossimNitfImageHeaderV2_X::theExtendedSubheaderDataLen, ossimNitfImageHeaderV2_X::theExtendedSubheaderOverflow, ossimNitfImageHeaderV2_X::theGeographicLocation, theImageBands, ossimNitfImageHeaderV2_X::theImageId, ossimNitfImageHeaderV2_X::theImageLocation, ossimNitfImageHeaderV2_X::theImageMagnification, ossimNitfImageHeaderV2_X::theImageMode, ossimNitfImageHeaderV2_X::theImageSource, ossimNitfImageHeaderV2_X::theImageSyncCode, ossimNitfImageHeaderV2_X::theJustification, ossimNitfImageHeaderV2_X::theNumberOfBands, ossimNitfImageHeaderV2_X::theNumberOfBitsPerPixelPerBand, ossimNitfImageHeaderV2_X::theNumberOfBlocksPerCol, ossimNitfImageHeaderV2_X::theNumberOfBlocksPerRow, ossimNitfImageHeaderV2_X::theNumberOfComments, ossimNitfImageHeaderV2_X::theNumberOfPixelsPerBlockHoriz, ossimNitfImageHeaderV2_X::theNumberOfPixelsPerBlockVert, ossimNitfImageHeaderV2_X::thePixelValueType, theReleasingInstructions, ossimNitfImageHeaderV2_X::theRepresentation, ossimNitfImageHeaderV2_X::theSecurityClassification, theSecurityControlNumber, theSecurityDowngrade, ossimNitfImageHeaderV2_X::theSignificantCols, ossimNitfImageHeaderV2_X::theSignificantRows, ossimNitfImageHeader::theTagList, ossimNitfImageHeaderV2_X::theTargetId, ossimNitfImageHeaderV2_X::theTitle, ossimNitfImageHeaderV2_X::theType, ossimNitfImageHeaderV2_X::theUserDefinedImageDataLength, and ossimNitfImageHeaderV2_X::theUserDefinedOverflow.

Referenced by ossimNitf20Writer::writeBlockBandSeparate(), and ossimNitf20Writer::writeBlockBandSequential().

315 {
316  out.write(theType, 2);
317  out.write(theImageId, 10);
318  out.write(theDateTime, 14);
319  out.write(theTargetId, 17);
320  out.write(theTitle, 80);
321  out.write(theSecurityClassification, 1);
322  out.write(theCodewords, 40);
323  out.write(theControlAndHandling, 40);
324  out.write(theReleasingInstructions, 40);
325  out.write(theClassificationAuthority, 20);
326  out.write(theSecurityControlNumber, 20);
327  out.write(theSecurityDowngrade, 6);
328  if(ossimString(theSecurityDowngrade) == "999998")
329  {
330  out.write(theDowngradingEvent, 40);
331  }
332  out.write(theEncryption, 1);
333  out.write(theImageSource, 42);
334  out.write(theSignificantRows, 8);
335  out.write(theSignificantCols, 8);
336  out.write(thePixelValueType, 3);
337  out.write(theRepresentation, 8);
338  out.write(theCategory, 8);
339  out.write(theActualBitsPerPixelPerBand, 2);
340  out.write(theJustification, 1);
341  out.write(theCoordinateSystem, 1);
342  if(theCoordinateSystem[0] != 'N')
343  {
344  out.write(theGeographicLocation, 60);
345  }
346  out.write(theNumberOfComments, 1);
347  out.write(theCompression, 2);
348  if(ossimString(theCompression) != "NC")
349  {
350  out.write(theCompressionRateCode, 4);
351  }
352  out.write(theNumberOfBands, 1);
353  ossim_uint32 bandIdx = 0;
354  for(bandIdx=0;bandIdx<theImageBands.size();++bandIdx)
355  {
356  theImageBands[bandIdx]->writeStream(out);
357  }
358  out.write(theImageSyncCode, 1);
359  out.write(theImageMode, 1);
360  out.write(theNumberOfBlocksPerRow, 4);
361  out.write(theNumberOfBlocksPerCol, 4);
362  out.write(theNumberOfPixelsPerBlockHoriz, 4);
363  out.write(theNumberOfPixelsPerBlockVert, 4);
364  out.write(theNumberOfBitsPerPixelPerBand, 2);
365  out.write(theDisplayLevel, 3);
366  out.write(theAttachmentLevel, 3);
367  out.write(theImageLocation, 10);
368  out.write(theImageMagnification, 4);
369  out.write(theUserDefinedImageDataLength, 5);
370  if(ossimString(theUserDefinedImageDataLength).toInt32() > 0)
371  {
372  out.write(theUserDefinedOverflow, 3);
373  }
374  ossim_uint32 totalLength = getTotalTagLength();
375 
376  if(totalLength == 0)
377  {
378  //memcpy(theExtendedSubheaderDataLen, "00000", 5);
379  out.write(theExtendedSubheaderDataLen, 5);
380  }
381  else
382  {
383  totalLength += 3; // per Table A-3 of MIL-STD-2500B
384 
385  if(totalLength <= 99999)
386  {
387  std::ostringstream tempOut;
388 
389  tempOut << std::setw(5)
390  << std::setfill('0')
391  << std::setiosflags(ios::right)
392  << totalLength;
393 
394  memcpy(theExtendedSubheaderDataLen, tempOut.str().c_str(), 5);
395 
396  out.write(theExtendedSubheaderDataLen, 5);
397  memset(theExtendedSubheaderOverflow, '0', 3);
398 
399  if(totalLength > 0)
400  {
401  out.write(theExtendedSubheaderOverflow, 3);
402 
403  ossim_uint32 i = 0;
404 
405  for(i = 0; i < theTagList.size(); ++i)
406  {
407  theTagList[i].writeStream(out);
408  }
409  }
410  }
411  else
412  {
413  ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_0::writeStream: Only support writing of total tag length < 99999" << std::endl;
414  }
415  }
416 }
char theSignificantRows[9]
FIELD: NROWS.
virtual ossim_uint32 getTotalTagLength() const
char theNumberOfPixelsPerBlockVert[5]
FIELD: NPPBV.
char theNumberOfPixelsPerBlockHoriz[5]
FIELD: NPPBH.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
char theCompressionRateCode[5]
FIELD COMRAT.
char theRepresentation[9]
FIELD: IREP.
char theNumberOfBands[2]
FIELD: NBANDS.
char theUserDefinedImageDataLength[6]
FIELD: UDIDL.
char theActualBitsPerPixelPerBand[3]
FIELD: ABPP.
char theNumberOfBitsPerPixelPerBand[3]
FIELD: NBPP.
char theNumberOfBlocksPerRow[5]
FIELD: NBPR.
char theGeographicLocation[61]
FIELD: IGEOLO.
char theImageId[11]
FIELD: IID1 Is a required 10 Alphanumeric value.
char theExtendedSubheaderDataLen[6]
FIELD: IXSHDL.
std::vector< ossimNitfTagInformation > theTagList
char theImageMode[2]
FIELD: IMODE.
char theTargetId[18]
FIELD: TGTID.
char theImageLocation[11]
FIELD: ILOC.
char theImageSyncCode[2]
FIELD: ISYNC.
char theAttachmentLevel[4]
FIELD: IALVL.
char theJustification[2]
FIELD: PJUST.
unsigned int ossim_uint32
char theUserDefinedOverflow[4]
FIELD: UDOFL.
char theNumberOfBlocksPerCol[5]
FIELD: NBPC.
char theDisplayLevel[4]
FIELD: IDLVL.
char theImageSource[43]
FIELD: ISORCE.
std::vector< ossimRefPtr< ossimNitfImageBandV2_0 > > theImageBands
Will contain also the field NBANDS and we will have to recreate the prefix for.
char theSecurityClassification[2]
FIELD: ISCLAS.
char theCoordinateSystem[2]
FIELD: ICORDS.
char theSignificantCols[9]
FIELD: NCOLS.
char theExtendedSubheaderOverflow[4]
FIELD: IXSOFL.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
char thePixelValueType[4]
FIELD: PVTYPE.
char theImageMagnification[5]
FIELD: IMAG.

Member Data Documentation

◆ CTLN_KW

const ossimString ossimNitfImageHeaderV2_0::CTLN_KW = "ctln"
static

Definition at line 92 of file ossimNitfImageHeaderV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ ISCAUT_KW

const ossimString ossimNitfImageHeaderV2_0::ISCAUT_KW = "iscaut"
static

Definition at line 91 of file ossimNitfImageHeaderV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ ISCODE_KW

const ossimString ossimNitfImageHeaderV2_0::ISCODE_KW = "iscode"
static

Definition at line 88 of file ossimNitfImageHeaderV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ ISCTLH_KW

const ossimString ossimNitfImageHeaderV2_0::ISCTLH_KW = "isctlh"
static

Definition at line 89 of file ossimNitfImageHeaderV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ ISDEVT_KW

const ossimString ossimNitfImageHeaderV2_0::ISDEVT_KW = "isdevt"
static

Definition at line 94 of file ossimNitfImageHeaderV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ ISDWNG_KW

const ossimString ossimNitfImageHeaderV2_0::ISDWNG_KW = "isdwng"
static

Definition at line 93 of file ossimNitfImageHeaderV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ ISREL_KW

const ossimString ossimNitfImageHeaderV2_0::ISREL_KW = "isrel"
static

Definition at line 90 of file ossimNitfImageHeaderV2_0.h.

Referenced by getProperty(), and getPropertyNames().

◆ theClassificationAuthority

char ossimNitfImageHeaderV2_0::theClassificationAuthority[21]
private

FIELD ISCAUT: Is a 20 byte field

Definition at line 124 of file ossimNitfImageHeaderV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), print(), and writeStream().

◆ theCodewords

char ossimNitfImageHeaderV2_0::theCodewords[41]
private

FIELD ISCODE: is a 40 byte field

Definition at line 106 of file ossimNitfImageHeaderV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), print(), and writeStream().

◆ theControlAndHandling

char ossimNitfImageHeaderV2_0::theControlAndHandling[41]
private

FIELD ISCTLH: is a 40 byte field

Definition at line 112 of file ossimNitfImageHeaderV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), print(), and writeStream().

◆ theDowngradingEvent

char ossimNitfImageHeaderV2_0::theDowngradingEvent[41]
private

FIELD ISDEVT: This is a conditional field and is present if the Security downgrade is 999998.

Definition at line 151 of file ossimNitfImageHeaderV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), print(), and writeStream().

◆ theImageBands

std::vector<ossimRefPtr<ossimNitfImageBandV2_0> > ossimNitfImageHeaderV2_0::theImageBands
private

Will contain also the field NBANDS and we will have to recreate the prefix for.

Container for repetitive fields: IREPBAND ISUBCAT IFC IMFLT NLUTS NELUT1 LUTD

Definition at line 165 of file ossimNitfImageHeaderV2_0.h.

Referenced by getBandInformation(), parseStream(), print(), saveState(), setBandInfo(), and writeStream().

◆ theReleasingInstructions

char ossimNitfImageHeaderV2_0::theReleasingInstructions[41]
private

FIELD ISREL: Is a 40 byte field.

Definition at line 118 of file ossimNitfImageHeaderV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), print(), and writeStream().

◆ theSecurityControlNumber

char ossimNitfImageHeaderV2_0::theSecurityControlNumber[21]
private

FIELD CTLN:

Definition at line 129 of file ossimNitfImageHeaderV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), print(), and writeStream().

◆ theSecurityDowngrade

char ossimNitfImageHeaderV2_0::theSecurityDowngrade[7]
private

FIELD ISDWNG: Is a 6 byte field with form:

YYMMDD. Year month day

999999 indicates that he Originating agencies determination is required (OADR) 999998 downgrade event will specify at what point and time the declassification or downgrading is to take place.

Definition at line 144 of file ossimNitfImageHeaderV2_0.h.

Referenced by clearFields(), getProperty(), parseStream(), print(), and writeStream().


The documentation for this class was generated from the following files: