MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

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
22 LT_BEGIN_LIZARDTECH_NAMESPACE
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();
53 LT_STATUS initialize();
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
147 LT_STATUS addMetadataLocal(LTIMetadataDatabase& db) const;
148
149 // not for public use
150 LT_STATUS createDataStream(LTIOSubStream*&) const;
151
152 // not for public use
153 bool hasGeoInfo(void) const;
154
155 // not for public use
156 LT_STATUS setGeoCoord(LTIGeoCoord&) const;
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
228 ImageSegment(ImageSegment&);
229 ImageSegment& operator=(const ImageSegment&);
230 };
231
232
233 }
234 LT_END_LIZARDTECH_NAMESPACE
235
236 #endif // ImageSegment_H

LizardTech