MrSID Decode SDK for Raster Reference Manual  9.1.0.4045
lti_multiresFilter.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 LTI_MULTIRESFILTER_H
14 #define LTI_MULTIRESFILTER_H
15 
16 // lt_lib_mrsid_core
17 #include "lti_imageFilter.h"
19 #include "lti_scene.h"
20 
21 LT_BEGIN_NAMESPACE(LizardTech)
22 
23 class LTIResampler;
24 
36 #ifdef SWIG
37 class LTIMultiResFilter : public LTIImageFilter
38 #else
40  <LTIOverrideGeoCoord
41  <LTIOverrideMagnification
42  <LTIOverrideStripHeight
43  <LTIImageFilter> > > >
44 #endif
45 {
47 public:
61 
78  lt_int8 scaleFactor);
79 
81  double deltaMag,
82  double minMag,
83  double maxMag);
84 
85  // LTIImage
86  LT_STATUS getDimsAtMag(double mag,
87  lt_uint32 &width,
88  lt_uint32 &height) const;
89 
90  // LTIImageStage
91  lt_int64 getEncodingCost(const LTIScene& scene) const;
92  bool getReaderScene(const LTIScene &decodeScene,
93  LTIScene &readerScene) const;
94  virtual lt_uint32 getModifications(const LTIScene &scene) const;
95  bool getPipelineInfo(LTIPipelineInfo info) const;
96 
102 
103  void setMagSnapThreshold(double threshold);
104 
105  // for LizardTech internal use only
106  // call this before initialize() if you want non-sq. pixels
107  // (the deltaMag in the constructor is ignored)
108  void setDeltaMagXY(double deltaMagX, double deltaMagY);
109 
110  // for LizardTech internal use only
111  static double magForIcon(const LTIImage &image,
112  lt_uint32 iconSize);
113  static double magForIcon(lt_uint32 width, lt_uint32 height,
114  lt_uint32 iconSize);
115 
116 protected:
117  LT_STATUS decodeBegin(const LTIPixel &pixelProps,
118  const LTIScene &fullScene);
119  LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer,
120  const LTIScene &stripScene);
121  LT_STATUS decodeEnd(void);
122 
123 protected:
124  enum Mode
125  {
131  };
132 
133  bool getChildScene(const LTIScene &scene,
134  Mode &mode,
135  double &xScale,
136  double &yScale,
137  LTIScene &childScene) const;
138 
139  enum
140  {
141  // The largest possible mag is based on the 2gb
142  // scene limitation. Thus the largest scene we
143  // should ever expect is approximately the square
144  // root of (2gb / 3) pixels on a side. If we
145  // assume the smallest image we'll ever encounter
146  // is 32x32 then the largest magnification can
147  // be calculated. It's big, but we need a real number!
148  kMaxMagnification = 512 // 51200% zoom!
149  };
150 
151 private:
152  struct StripCache;
153 
154  double m_deltaMagX;
155  double m_deltaMagY;
156 
157  double m_magSnapThreshold;
158 
159  Mode m_mode;
160  double m_xScale;
161  double m_yScale;
162  LTIScene m_childScene;
163  double m_dx;
164  double m_dy;
165  double m_curY;
166 
167  lt_int32 m_childStrip;
168  lt_int32 m_myStrip;
169 
170  lt_uint32 m_cacheStripHeight;
171  StripCache *m_stripCache0;
172  StripCache *m_stripCache1;
173 
174  LTIResampler *m_resampler;
175 };
176 
177 
178 LT_END_NAMESPACE(LizardTech)
179 
180 #endif // LTI_MULTIRESFILTER_H

LizardTech