00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012
00013 #ifndef MRSIDIMAGEREADERBASE_H
00014 #define MRSIDIMAGEREADERBASE_H
00015
00016
00017 #include "lti_types.h"
00018 #include "lti_geoImageReader.h"
00019
00020 LT_BEGIN_NAMESPACE(LizardTech)
00021
00022 class MrSIDImageStageManager;
00023 class MrSIDPasswordDelegate;
00024 class MrSIDSimplePasswordDelegate;
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 enum MrSIDMemoryUsage
00036 {
00037 MRSID_MEMORY_USAGE_INVALID = 0,
00038 MRSID_MEMORY_USAGE_DEFAULT = 1,
00039 MRSID_MEMORY_USAGE_SMALL = 2,
00040 MRSID_MEMORY_USAGE_MEDIUM = 3,
00041 MRSID_MEMORY_USAGE_LARGE = 4
00042 };
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 enum MrSIDStreamUsage
00054 {
00055 MRSID_STREAM_USAGE_INVALID = 0,
00056 MRSID_STREAM_USAGE_KEEPOPEN = 2,
00057 MRSID_STREAM_USAGE_KEEPCLOSED = 3,
00058 MRSID_STREAM_USAGE_DEFAULT = MRSID_STREAM_USAGE_KEEPCLOSED
00059 };
00060
00061
00068 class MrSIDImageReaderInterface
00069 {
00070 LT_DISALLOW_COPY_CONSTRUCTOR(MrSIDImageReaderInterface);
00071 public:
00072 virtual ~MrSIDImageReaderInterface();
00073
00083 virtual lt_uint8 getNumLevels() const = 0;
00084
00095 virtual bool isLocked() const = 0;
00096
00110 void setPasswordDelegate(MrSIDPasswordDelegate* passwordDelegate);
00111
00126 void setPassword(const lt_utf8* password);
00127
00128 public:
00143 virtual void setMaxWorkerThreads(int numThreads) = 0;
00144
00156 virtual int getMaxWorkerThreads() const = 0;
00157
00158 public:
00173 static LT_STATUS getMrSIDGeneration(const LTFileSpec& fileSpec, lt_uint8& gen, bool &raster);
00174
00189 static LT_STATUS getMrSIDGeneration(LTIOStreamInf& stream, lt_uint8 &gen, bool &raster);
00190
00205 static LT_STATUS getMrSIDGeneration(const lt_uint8 version[8], lt_uint8& gen, bool &raster);
00206
00219 LT_STATUS getMrSIDGeneration(lt_uint8 &gen, bool &raster) const;
00220
00235 LT_STATUS getMrSIDVersion(lt_uint8& major, lt_uint8& minor,
00236 lt_uint8& tweak, char& letter) const;
00237
00238 protected:
00239 MrSIDImageReaderInterface();
00240 LT_STATUS init(MrSIDMemoryUsage memoryUsage,
00241 MrSIDStreamUsage streamUsage,
00242 const lt_uint8 preamble[8]);
00243
00244 static LT_STATUS getGeoCoordFromMetadata(LTIMetadataDatabase &metadata,
00245 LTIGeoCoord &geoCoord,
00246 bool &hasGeo);
00247
00248 static LTIOStreamInf *openWorldFileStream(const LTFileSpec &fileSpec,
00249 bool useWorldFile);
00250
00251 MrSIDMemoryUsage m_memoryUsage;
00252 MrSIDStreamUsage m_streamUsage;
00253 lt_uint8 m_magic[8];
00254
00255 private:
00256 MrSIDPasswordDelegate* m_pwdDelegate;
00257 MrSIDSimplePasswordDelegate* m_localPwdDelegate;
00258 };
00259
00260
00261 class MrSIDSingleImageReaderBase : public LTIGeoImageReader,
00262 public MrSIDImageReaderInterface
00263 {
00264 LT_DISALLOW_COPY_CONSTRUCTOR(MrSIDSingleImageReaderBase);
00265 public:
00266
00267 virtual lt_int64 getEncodingCost(const LTIScene& scene) const;
00268 virtual lt_uint32 getModifications(const LTIScene &scene) const;
00269
00270 protected:
00271 MrSIDSingleImageReaderBase(bool supportBandSelection);
00272 ~MrSIDSingleImageReaderBase(void);
00273
00274 LT_STATUS init(MrSIDImageStageManager *manager);
00275
00276 MrSIDImageStageManager *m_manager;
00277 };
00278
00279 LT_END_NAMESPACE(LizardTech)
00280
00281 #endif // MRSIDIMAGEREADERBASE_H