00001
00002
00003
00004
00005
00006
00007
00008
00010
00011
00012 #ifndef ImageSegment_H
00013 #define ImageSegment_H
00014
00015
00016 #include "lt_base.h"
00017
00018
00019 #include "nitf_types.h"
00020 #include "Segment.h"
00021
00022 LT_BEGIN_LIZARDTECH_NAMESPACE
00023 class LTIPixel;
00024 class LTIOSubStream;
00025 class LTIGeoCoord;
00026
00027 namespace Nitf {
00028 class ImageSegmentMetadata;
00029
00030
00044 class ImageSegment : public Segment
00045 {
00046 public:
00047
00048 ImageSegment(NITFReaderManager&, LTIOStreamInf&,
00049 int segmentNumber,
00050 lt_int64 headerOffset, lt_int64 headerLength,
00051 lt_int64 dataOffset, lt_int64 dataLength);
00052 ~ImageSegment();
00053 LT_STATUS initialize();
00054
00058 const char* getIID1() const;
00059
00063 Format getFormat() const;
00064
00068 Layout getLayout() const;
00069
00073 bool isBlocked() const;
00074
00078 bool isMasked() const;
00079
00083 const LTIPixel& getPixelProps() const;
00084
00088 lt_uint32 getWidth() const;
00089
00093 lt_uint32 getHeight() const;
00094
00098 int getBlockWidth() const;
00099
00103 int getBlockHeight() const;
00104
00108 int getBlocksPerRow() const;
00109
00113 int getBlocksPerCol() const;
00114
00118 int getNBPP() const;
00119
00123 int getNBANDS() const;
00124
00125
00126 int getILOCr() const;
00127
00128
00129 int getILOCc() const;
00130
00131
00132 const lt_uint8* getPadValue() const;
00133
00134
00135 lt_uint32 getBlockOffset(lt_uint32 index) const;
00136
00137
00138 lt_uint32 getNextBlockOffset(lt_uint32 index) const;
00139
00140
00141 bool isPaddedBlock(lt_uint32 index) const;
00142
00143
00144 LT_STATUS isSupported() const;
00145
00146
00147 LT_STATUS addMetadataLocal(LTIMetadataDatabase& db) const;
00148
00149
00150 LT_STATUS createDataStream(LTIOSubStream*&) const;
00151
00152
00153 bool hasGeoInfo(void) const;
00154
00155
00156 LT_STATUS setGeoCoord(LTIGeoCoord&) const;
00157
00161 const ImageSegmentMetadata* getImageMetadata() const;
00162
00163 private:
00164 LT_STATUS readHeader();
00165 LT_STATUS readData();
00166
00167 LT_STATUS readMaskTable();
00168 LT_STATUS constructOffsetTable_RAW(lt_int64, bool BUGGY);
00169 LT_STATUS constructOffsetTable_JPG(lt_int64, bool BUGGY);
00170 LT_STATUS determinePixelFormat();
00171 LT_STATUS determineImageFormat();
00172
00173 LTIPixel* m_pixel;
00174 bool m_hasLUT;
00175 Format m_format;
00176 bool m_isMasked;
00177 Layout m_layout;
00178
00179 LT_STATUS m_isSupported;
00180
00181 ImageSegmentMetadata* m_imageMetadata;
00182
00183 int m_NROWS;
00184 int m_NCOLS;
00185 char* m_PVTYPE;
00186 char* m_IREP;
00187 char* m_ICAT;
00188 int m_ABPP;
00189 char* m_PJUST;
00190 char* m_ICORDS;
00191 char* m_IGEOLO;
00192 char* m_IC;
00193 char* m_COMRAT;
00194 int m_NBANDS;
00195 char** m_IREPBAND;
00196 char** m_ISUBCAT;
00197 lt_uint8*** m_LUTD;
00198 int* m_NLUTS;
00199 int* m_NELUT;
00200 char* m_IMODE;
00201 int m_NBPR;
00202 int m_NBPC;
00203 int m_NPPBH;
00204 int m_NPPBV;
00205 int m_NBPP;
00206 int m_IDLVL;
00207 int m_IALVL;
00208 int m_ILOCr;
00209 int m_ILOCc;
00210 char* m_IMAG;
00211
00212
00213 lt_uint32 m_IMDATOFF;
00214 lt_uint16 m_BMRLNTH;
00215 lt_uint16 m_TMRLNTH;
00216 lt_uint16 m_TPXCDLNTH;
00217 lt_uint8* m_TPXCD;
00218 int m_TPXCDlen;
00219 lt_uint32* m_BMRBND;
00220 lt_uint32* m_TMRBND;
00221
00222
00223 double* m_geoPoints;
00224 int m_zone;
00225 bool m_igeoloValid;
00226
00227
00228 ImageSegment(ImageSegment&);
00229 ImageSegment& operator=(const ImageSegment&);
00230 };
00231
00232
00233 }
00234 LT_END_LIZARDTECH_NAMESPACE
00235
00236 #endif // ImageSegment_H