MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

MrSIDImageReaderBase.h
Go to the documentation of this file.
1 /* $Id$ */
2 /* //////////////////////////////////////////////////////////////////////////
3 // //
4 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, //
5 // Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
6 // prohibited. Access to and use of this code is permitted only under //
7 // license from LizardTech, Inc. Portions of the code are protected by //
8 // US and foreign patents and other filings. All Rights Reserved. //
9 // //
11 /* PUBLIC */
12
13 #ifndef MRSIDIMAGEREADERBASE_H
14 #define MRSIDIMAGEREADERBASE_H
15
16 // lt_lib_mrsid_core
17 #include "lti_types.h"
18 #include "lti_geoImageReader.h"
19
20 LT_BEGIN_NAMESPACE(LizardTech)
21
22 class MrSIDImageStageManager;
23 class MrSIDPasswordDelegate;
24 class MrSIDSimplePasswordDelegate;
25
26
27 /*
28 * memory settings for creating MrSID decoders
29 *
30 * "Small", "medium", and "large" refer to how much memory the
31 * decoder will use when opening the image and constructing certain
32 * internal data structures and tables. In general, decode
33 * performance will increase if more memory can be used.
34 */
35 enum MrSIDMemoryUsage
36 {
37 MRSID_MEMORY_USAGE_INVALID = 0,
38 MRSID_MEMORY_USAGE_DEFAULT = 1,
39 MRSID_MEMORY_USAGE_SMALL = 2,
40 MRSID_MEMORY_USAGE_MEDIUM = 3,
41 MRSID_MEMORY_USAGE_LARGE = 4
42 };
43
44 /*
45 * stream settings for creating MrSID decoders
46 *
47 * Normally, the stream used by the decoder is
48 * only opened when doing actual decode work, as resources like
49 * file handles can be a scarce resource in some environments. This
50 * obviously incurs a performance penalty; the "KeepStreamOpen" modes
51 * can be used to change the behaviour.
52 */
53 enum MrSIDStreamUsage
54 {
55 MRSID_STREAM_USAGE_INVALID = 0,
56 MRSID_STREAM_USAGE_KEEPOPEN = 2,
57 MRSID_STREAM_USAGE_KEEPCLOSED = 3,
58 MRSID_STREAM_USAGE_DEFAULT = MRSID_STREAM_USAGE_KEEPCLOSED
59 };
60
61
68 class MrSIDImageReaderInterface
69 {
70 LT_DISALLOW_COPY_CONSTRUCTOR(MrSIDImageReaderInterface);
71 public:
72 virtual ~MrSIDImageReaderInterface();
73
83 virtual lt_uint8 getNumLevels() const = 0;
84
95 virtual bool isLocked() const = 0;
96
110 void setPasswordDelegate(MrSIDPasswordDelegate* passwordDelegate);
111
126 void setPassword(const lt_utf8* password);
127
128 public:
143 virtual void setMaxWorkerThreads(int numThreads) = 0;
144
156 virtual int getMaxWorkerThreads() const = 0;
157
158 public:
173 static LT_STATUS getMrSIDGeneration(const LTFileSpec& fileSpec, lt_uint8& gen, bool &raster);
174
189 static LT_STATUS getMrSIDGeneration(LTIOStreamInf& stream, lt_uint8 &gen, bool &raster);
190
205 static LT_STATUS getMrSIDGeneration(const lt_uint8 version[8], lt_uint8& gen, bool &raster);
206
219 LT_STATUS getMrSIDGeneration(lt_uint8 &gen, bool &raster) const;
220
235 LT_STATUS getMrSIDVersion(lt_uint8& major, lt_uint8& minor,
236 lt_uint8& tweak, char& letter) const;
237
238 protected:
239 MrSIDImageReaderInterface();
240 LT_STATUS init(MrSIDMemoryUsage memoryUsage,
241 MrSIDStreamUsage streamUsage,
242 const lt_uint8 preamble[8]);
243
244 static LT_STATUS getGeoCoordFromMetadata(LTIMetadataDatabase &metadata,
245 LTIGeoCoord &geoCoord,
246 bool &hasGeo);
247
248 static LTIOStreamInf *openWorldFileStream(const LTFileSpec &fileSpec,
249 bool useWorldFile);
250
251 MrSIDMemoryUsage m_memoryUsage;
252 MrSIDStreamUsage m_streamUsage;
253 lt_uint8 m_magic[8];
254
255 private:
256 MrSIDPasswordDelegate* m_pwdDelegate;
257 MrSIDSimplePasswordDelegate* m_localPwdDelegate;
258 };
259
260
261 class MrSIDSingleImageReaderBase : public LTIGeoImageReader,
262 public MrSIDImageReaderInterface
263 {
264 LT_DISALLOW_COPY_CONSTRUCTOR(MrSIDSingleImageReaderBase);
265 public:
266 // LTIImageStage
267 virtual lt_int64 getEncodingCost(const LTIScene& scene) const;
268 virtual lt_uint32 getModifications(const LTIScene &scene) const;
269
270 protected:
271 MrSIDSingleImageReaderBase(bool supportBandSelection);
272 ~MrSIDSingleImageReaderBase(void);
273
274 LT_STATUS init(MrSIDImageStageManager *manager);
275
276 MrSIDImageStageManager *m_manager;
277 };
278
279 LT_END_NAMESPACE(LizardTech)
280
281 #endif // MRSIDIMAGEREADERBASE_H

LizardTech