MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
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 
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  LT_STATUS setResamplePixelCenter(bool usePixelCenter);
103 
104  void setMagSnapThreshold(double threshold);
105 
106  // for LizardTech internal use only
107  // call this before initialize() if you want non-sq. pixels
108  // (the deltaMag in the constructor is ignored)
109  void setDeltaMagXY(double deltaMagX, double deltaMagY);
110 
111  // for LizardTech internal use only
112  static double magForIcon(const LTIImage &image,
113  lt_uint32 iconSize);
114  static double magForIcon(lt_uint32 width, lt_uint32 height,
115  lt_uint32 iconSize);
116 
117  static LT_STATUS push(LTIImageStage *&pipeline, const LTIScene &dstScene, LTIResampleMethod method = LTI_RESAMPLE_NEAREST);
118  static LT_STATUS push(LTIImageStage *&pipeline, double mag, LTIResampleMethod method = LTI_RESAMPLE_NEAREST);
119 
120 protected:
121  LT_STATUS decodeBegin(const LTIPixel &pixelProps,
122  const LTIScene &fullScene);
123  LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer,
124  const LTIScene &stripScene);
125  LT_STATUS decodeEnd(void);
126 
127 protected:
128  enum Mode
129  {
135  };
136 
137  bool getChildScene(const LTIScene &scene,
138  Mode &mode,
139  double &xScale,
140  double &yScale,
141  LTIScene &childScene) const;
142 
143  enum
144  {
145  // The largest possible mag is based on the 2gb
146  // scene limitation. Thus the largest scene we
147  // should ever expect is approximately the square
148  // root of (2gb / 3) pixels on a side. If we
149  // assume the smallest image we'll ever encounter
150  // is 32x32 then the largest magnification can
151  // be calculated. It's big, but we need a real number!
152  kMaxMagnification = 512 // 51200% zoom!
153  };
154 
155 private:
156  struct StripCache;
157 
158  double m_deltaMagX;
159  double m_deltaMagY;
160 
161  double m_magSnapThreshold;
162 
163  Mode m_mode;
164  double m_xScale;
165  double m_yScale;
166  LTIScene m_childScene;
167  double m_dx;
168  double m_dy;
169  double m_curY;
170 
171  lt_int32 m_childStrip;
172  lt_int32 m_myStrip;
173 
174  StripCache *m_stripCache0;
175  StripCache *m_stripCache1;
176 
177  LTIResampler *m_resampler;
178  bool m_usePixelCenter;
179 };
180 
181 
183 
184 #endif // LTI_MULTIRESFILTER_H
representation of a scene
Definition: lti_scene.h:64
bool getReaderScene(const LTIScene &decodeScene, LTIScene &readerScene) const
static double magForIcon(const LTIImage &image, lt_uint32 iconSize)
bool getChildScene(const LTIScene &scene, Mode &mode, double &xScale, double &yScale, LTIScene &childScene) const
LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer, const LTIScene &stripScene)
add resolutions to the image
#define LT_END_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:85
void setDeltaMagXY(double deltaMagX, double deltaMagY)
signed char lt_int8
signed 8-bit integer
Definition: lt_types.h:44
signed int lt_int32
signed 32-bit integer
Definition: lt_types.h:52
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:39
abstract class for implementing an image transform
LT_STATUS decodeEnd(void)
LT_STATUS setResamplePixelCenter(bool usePixelCenter)
void setMagSnapThreshold(double threshold)
basic properties of a pixel
Definition: lti_pixel.h:36
static LT_STATUS push(LTIImageStage *&pipeline, const LTIScene &dstScene, LTIResampleMethod method=LTI_RESAMPLE_NEAREST)
lt_int64 getEncodingCost(const LTIScene &scene) const
virtual lt_uint32 getModifications(const LTIScene &scene) const
class to hold data passed between image stages
LTIPipelineInfo
Definition: lti_types.h:228
LT_STATUS setResampleMethod(LTIResampleMethod resampleMethod)
Set resampling method.
LTIResampleMethod
constants representing resampling methods
Definition: lti_types.h:176
abstract class representing an image
Definition: lti_image.h:32
abstract class for decoding from an image
#define LT_BEGIN_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:84
#define LTI_REFERENCE_COUNTED_BOILERPLATE(classname)
unsigned int lt_uint32
unsigned 32-bit integer
Definition: lt_types.h:54
LT_STATUS getDimsAtMag(double mag, lt_uint32 &width, lt_uint32 &height) const
bool getPipelineInfo(LTIPipelineInfo info) const
LT_STATUS initialize(LTIImageStage *srcImage)
initializer
LT_STATUS decodeBegin(const LTIPixel &pixelProps, const LTIScene &fullScene)

LizardTech