MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

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"
18 #include "lti_imageStageOverrides.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
39 class LTIMultiResFilter : public LTIOverrideDimensions
40 <LTIOverrideGeoCoord
41 <LTIOverrideMagnification
42 <LTIOverrideStripHeight
43 <LTIImageFilter> > > >
44 #endif
45 {
46 LTI_REFERENCE_COUNTED_BOILERPLATE(LTIMultiResFilter);
47 public:
60 LT_STATUS initialize(LTIImageStage* srcImage);
61
77 LT_STATUS initialize(LTIImageStage* srcImage,
78 lt_int8 scaleFactor);
79
80 LT_STATUS initialize(LTIImageStage* srcImage,
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
101 LT_STATUS setResampleMethod(LTIResampleMethod resampleMethod);
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 {
130 MODE_INVALID,
131 MODE_RESAMPLE,
132 MODE_PASSTHROUGH,
133 MODE_DOWNSAMPLE_FULLREAD,
134 MODE_ALL_AT_ONCE
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
182 LT_END_NAMESPACE(LizardTech)
183
184 #endif // LTI_MULTIRESFILTER_H

LizardTech