MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
ImageSegment.h
Go to the documentation of this file.
1 /* //////////////////////////////////////////////////////////////////////////
2 // //
3 // This code is Copyright (c) 2010 LizardTech, Inc, 1008 Western Avenue, //
4 // Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
5 // prohibited. Access to and use of this code is permitted only under //
6 // license from LizardTech, Inc. Portions of the code are protected by //
7 // US and foreign patents and other filings. All Rights Reserved. //
8 // //
10 /* PUBLIC */
11 
12 #ifndef ImageSegment_H
13 #define ImageSegment_H
14 
15 // lt_lib_base
16 #include "lt_base.h"
17 
18 // lt_lib_mrsid_nitf
19 #include "nitf_types.h"
20 #include "Segment.h"
21 
23 class LTIPixel;
24 class LTIOSubStream;
25 class LTIGeoCoord;
26 
27 namespace Nitf {
28 class ImageSegmentMetadata;
29 
30 
44 class ImageSegment : public Segment
45 {
46 public:
47  // not for public use -- to get a DataSegment, use NITFReaderManager::getImageSegment
48  ImageSegment(NITFReaderManager&, LTIOStreamInf&,
49  int segmentNumber,
50  lt_int64 headerOffset, lt_int64 headerLength,
51  lt_int64 dataOffset, lt_int64 dataLength);
52  ~ImageSegment();
54 
58  const char* getIID1() const;
59 
63  Format getFormat() const;
64 
68  Layout getLayout() const;
69 
73  bool isBlocked() const;
74 
78  bool isMasked() const;
79 
83  const LTIPixel& getPixelProps() const;
84 
88  lt_uint32 getWidth() const;
89 
93  lt_uint32 getHeight() const;
94 
98  int getBlockWidth() const;
99 
103  int getBlockHeight() const;
104 
108  int getBlocksPerRow() const;
109 
113  int getBlocksPerCol() const;
114 
118  int getNBPP() const;
119 
123  int getNBANDS() const;
124 
125  // not for public use
126  int getILOCr() const;
127 
128  // not for public use
129  int getILOCc() const;
130 
131  // not for public use
132  const lt_uint8* getPadValue() const;
133 
134  // not for public use
135  lt_uint64 getBlockOffset(lt_uint32 index) const;
136 
137  // not for public use
138  lt_uint64 getNextBlockOffset(lt_uint32 index) const;
139 
140  // not for public use
141  bool isMaskedBlock(lt_uint32 index) const;
142 
143  // not for public use
144  LT_STATUS isSupported() const;
145 
146  // not for public use
148 
149  // not for public use
151 
152  // not for public use
153  bool hasGeoInfo(void) const;
154 
155  // not for public use
157 
161  const ImageSegmentMetadata* getImageMetadata() const;
162 
163 private:
164  LT_STATUS readHeader();
165  LT_STATUS readData();
166 
167  LT_STATUS readMaskTable();
168  LT_STATUS constructOffsetTable_RAW(lt_int64, bool BUGGY);
169  LT_STATUS constructOffsetTable_JPG(lt_int64, bool BUGGY);
170  LT_STATUS determinePixelFormat();
171  LT_STATUS determineImageFormat();
172 
173  LTIPixel* m_pixel;
174  bool m_hasLUT;
175  Format m_format; // IC
176  bool m_isMasked;
177  Layout m_layout; // IMODE
178 
179  LT_STATUS m_isSupported;
180 
181  ImageSegmentMetadata* m_imageMetadata;
182 
183  int m_NROWS;
184  int m_NCOLS;
185  char* m_PVTYPE; // 3
186  char* m_IREP; // 8
187  char* m_ICAT; // 8
188  int m_ABPP; // just precision
189  char* m_PJUST; // 1
190  char* m_ICORDS; // 1
191  char* m_IGEOLO; // 60
192  char* m_IC; // 2
193  char* m_COMRAT; // 4
194  int m_NBANDS;
195  char** m_IREPBAND;
196  char** m_ISUBCAT;
197  lt_uint8*** m_LUTD;
198  int* m_NLUTS;
199  int* m_NELUT;
200  char* m_IMODE; // 1
201  int m_NBPR;
202  int m_NBPC;
203  int m_NPPBH;
204  int m_NPPBV;
205  int m_NBPP; // actual bytes used
206  int m_IDLVL;
207  int m_IALVL;
208  int m_ILOCr;
209  int m_ILOCc;
210  char* m_IMAG; // 4
211 
212  // mask stuff
213  lt_uint32 m_IMDATOFF;
214  lt_uint16 m_BMRLNTH;
215  lt_uint16 m_TMRLNTH;
216  lt_uint16 m_TPXCDLNTH;
217  lt_uint8* m_TPXCD;
218  int m_TPXCDlen;
219  lt_uint64* m_BMRBND;
220  lt_uint32* m_TMRBND;
221 
222  // geo stuff
223  double *m_geoPoints; // ul(lat,lon), ur(lat,lon), lr(lat,lon), ll(lat,lon)
224  int m_zone;
225  bool m_igeoloValid;
226 
227  // nope
229  ImageSegment& operator=(const ImageSegment&);
230 };
231 
232 
233 }
235 
236 #endif // ImageSegment_H
int getNBPP() const
returns the number of bits per pixel used in the image (corresponds to the NBPP field) ...
LT_STATUS createDataStream(LTIOSubStream *&) const
ImageSegment(NITFReaderManager &, LTIOStreamInf &, int segmentNumber, lt_int64 headerOffset, lt_int64 headerLength, lt_int64 dataOffset, lt_int64 dataLength)
lt_uint32 getWidth() const
returns the width of the image, in pixels
const char * getIID1() const
returns the IID1 field of the image
Format
image/compression format
Definition: nitf_types.h:49
lt_uint64 getNextBlockOffset(lt_uint32 index) const
#define LT_BEGIN_LIZARDTECH_NAMESPACE
compiler does not support namespaces
Definition: lt_define.h:96
LT_STATUS addMetadataLocal(LTIMetadataDatabase &db) const
Include file for all LizardTech sources.
bool isMasked() const
returns true iff the image is masked
LTIOSubStream.
represents a geographic coordinate
Definition: lti_geoCoord.h:32
LT_STATUS isSupported() const
base class for segment data in an NITF file
Definition: Segment.h:42
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:39
lt_uint32 getHeight() const
returns the height of the image, in pixels
const lt_uint8 * getPadValue() const
int getILOCr() const
int getBlockHeight() const
returns the height of a block, in pixels (corresponds to the NPPBV field)
Abstract definition of a stream.
LT_STATUS initialize()
initializer
class for storing metadata associated with an image
basic properties of a pixel
Definition: lti_pixel.h:36
Format getFormat() const
returns the format (JPEG, RAW, JP2, etc) of the image
const LTIPixel & getPixelProps() const
returns the pixel type of the image
bool isMaskedBlock(lt_uint32 index) const
int getBlocksPerCol() const
returns the number of blocks per row in the image (corresponds to the NBPC field) ...
bool isBlocked() const
returns true iff the image is blocked
unsigned short lt_uint16
unsigned 16-bit integer
Definition: lt_types.h:50
bool hasGeoInfo(void) const
const ImageSegmentMetadata * getImageMetadata() const
returns the metadata object associated with the image
represents a image segment in an existing NITF file
Definition: ImageSegment.h:44
int getBlocksPerRow() const
returns the number of blocks per row in the image (corresponds to the NBPR field) ...
Layout
layout
Definition: nitf_types.h:67
#define LT_END_LIZARDTECH_NAMESPACE
compiler does not support namespaces
Definition: lt_define.h:97
This file contains a number of enums, typedefs, etc, that are used within the NITF support classes...
lt_uint64 getBlockOffset(lt_uint32 index) const
container for Image Segment metadata
unsigned int lt_uint32
unsigned 32-bit integer
Definition: lt_types.h:54
unsigned char lt_uint8
unsigned 8-bit integer
Definition: lt_types.h:46
int getILOCc() const
int getBlockWidth() const
returns the width of a block, in pixels (corresponds to the NPPBH field)
LT_STATUS setGeoCoord(LTIGeoCoord &) const
Layout getLayout() const
returns the layout (interleaved, blocked, etc) of the image
int getNBANDS() const
returns the number of bands in the image (corresponds to the NBANDS field)

LizardTech