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 static LT_STATUS getMrSIDGeneration(const LTFileSpec& fileSpec, lt_uint8& gen, bool &raster);
00144
00159 static LT_STATUS getMrSIDGeneration(LTIOStreamInf& stream, lt_uint8 &gen, bool &raster);
00160
00175 static LT_STATUS getMrSIDGeneration(const lt_uint8 version[8], lt_uint8& gen, bool &raster);
00176
00189 LT_STATUS getMrSIDGeneration(lt_uint8 &gen, bool &raster) const;
00190
00205 LT_STATUS getMrSIDVersion(lt_uint8& major, lt_uint8& minor,
00206 lt_uint8& tweak, char& letter) const;
00207
00208 protected:
00209 MrSIDImageReaderInterface();
00210 LT_STATUS init(MrSIDMemoryUsage memoryUsage,
00211 MrSIDStreamUsage streamUsage,
00212 const lt_uint8 preamble[8]);
00213
00214 static LT_STATUS getGeoCoordFromMetadata(LTIMetadataDatabase &metadata,
00215 LTIGeoCoord &geoCoord,
00216 bool &hasGeo);
00217
00218 static LTIOStreamInf *openWorldFileStream(const LTFileSpec &fileSpec,
00219 bool useWorldFile);
00220
00221 MrSIDMemoryUsage m_memoryUsage;
00222 MrSIDStreamUsage m_streamUsage;
00223 lt_uint8 m_magic[8];
00224
00225 private:
00226 MrSIDPasswordDelegate* m_pwdDelegate;
00227 MrSIDSimplePasswordDelegate* m_localPwdDelegate;
00228 };
00229
00230
00231 class MrSIDSingleImageReaderBase : public LTIGeoImageReader,
00232 public MrSIDImageReaderInterface
00233 {
00234 LT_DISALLOW_COPY_CONSTRUCTOR(MrSIDSingleImageReaderBase);
00235 public:
00236
00237 virtual lt_int64 getEncodingCost(const LTIScene& scene) const;
00238 virtual lt_uint32 getModifications(const LTIScene &scene) const;
00239
00240 protected:
00241 MrSIDSingleImageReaderBase(bool supportBandSelection);
00242 ~MrSIDSingleImageReaderBase(void);
00243
00244 LT_STATUS init(MrSIDImageStageManager *manager);
00245
00246 MrSIDImageStageManager *m_manager;
00247 };
00248
00249 LT_END_NAMESPACE(LizardTech)
00250
00251 #endif // MRSIDIMAGEREADERBASE_H