MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

lti_mosaicFilter.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_MOSAIC_FILTER_H
14 #define LTI_MOSAIC_FILTER_H
15
16 // lt_lib_mrsid_core
17 #include "lti_imageStage.h"
18 #include "lti_imageStageOverrides.h"
19 #include "lti_imageStageManager.h"
20 #include "lti_sceneBuffer.h"
21
22
23
24 LT_BEGIN_NAMESPACE(LizardTech)
25
26 class LTIRTree;
27 class LTIEmbeddedImage;
28 class LTIPipelineBuilder;
29
40 #ifdef SWIG
41 class LTIMosaicFilter : public LTIImageStage
42 #else
43 class LTIMosaicFilter : public LTIOverrideDimensions
44 <LTIOverridePixelProps
45 <LTIOverrideBackgroundPixel
46 <LTIOverrideGeoCoord
47 <LTIOverrideMagnification
48 <LTIOverrideIsSelective
49 <LTIOverrideStripHeight
50 <LTIOverrideDelegates
51 <LTIOverridePixelLookupTables
52 <LTIOverrideMetadata
53 <LTIImageStage> > > > > > > > > >
54 #endif
55 {
56 LTI_REFERENCE_COUNTED_BOILERPLATE(LTIMosaicFilter);
57 public:
58 enum AlphaMode
59 {
60 DoNothing,
61 FromMerge,
62 FromSourceRectangle,
63 };
64
88 LT_STATUS initialize(LTIImageStageManager *imageStageManager,
89 const LTIPixel* backgroundPixel,
90 bool useMultires,
91 bool mergeMetadata = true,
92 AlphaMode alphaMode = DoNothing);
93
104 static LT_STATUS checkResolutionConformance(LTIImageStageManager *imageStageManager,
105 bool useMultires);
106
107 // LTIImage
108 LT_STATUS getDimsAtMag(double mag,
109 lt_uint32 &width,
110 lt_uint32 &height) const;
111 lt_uint32 getModifications(const LTIScene &scene) const;
112 LT_STATUS getMetadataBlob(const char *type, LTIOStreamInf *&stream) const;
113
114 // LTIImageStage
115 lt_int64 getEncodingCost(const LTIScene& scene) const;
116 bool getReaderScene(const LTIScene &decodeScene,
117 LTIScene &readerScene) const;
118 LTIMaskSource *getMask() const;
119 bool getPipelineInfo(LTIPipelineInfo info) const;
120
126 void setFillMethod(LTIPixelFillMethod method,
127 double fuzzyThreshold /*= LTISceneBuffer::DefaultFuzzyThreshold*/);
128
132 LTIPixelFillMethod getFillMethod(void) const;
133 double getFuzzyThreshold(void) const;
134
139 void setResampleMethod(LTIResampleMethod resampleMethod);
140
141 void setMagSnapThreshold(double threshold);
142
146 LTIResampleMethod getResampleMethod(void) const;
147
148 void setResamplePixelCenter(bool usePixelCenter);
149
150 // for LizardTech internal use only
151 bool getReaderScene(lt_uint32 child,
152 const LTIScene &decodeScene,
153 LTIScene &mosaicScene,
154 LTIScene &readerScene) const;
155 // for LizardTech internal use only
156 bool getOverviewReaderScene(const LTIScene &decodeScene,
157 LTIScene &mosaicScene,
158 LTIScene &readerScene) const;
159
160 // for LizardTech internal use only
161 class InSceneCallback
162 {
163 public:
164 virtual LT_STATUS found(const LTIScene &scene,
165 lt_uint32 imageNum,
166 LTIEmbeddedImage &embedded,
167 LTIImageStage &image) = 0;
168 };
169
170 // for LizardTech internal use only
171 LT_STATUS forEachImageStageInScene(const LTIScene &scene,
172 InSceneCallback &callback);
173
174 // for LizardTech internal use only
175 void setDeleteImages(bool deleteImages);
176 // for LizardTech internal use only
177 bool getDeleteImages(void) const;
178
179 // for LizardTech internal use only
180 LT_STATUS loadImage(lt_uint32 i,
181 LTIEmbeddedImage *&embedded,
182 LTIImageStage *&raw);
183 // for LizardTech internal use only
184 LT_STATUS closeImage(lt_uint32 i);
185
186 // for LizardTech internal use only
187 // does not take ownship of pipelineBuilder
188 // don't call this function in inside a decodeBegin()/decodeStrip()/decodeEnd() loop
189 LT_STATUS setPipelineBuilder(LTIPipelineBuilder *pipelineBuilder);
190
191 // for LizardTech internal use only
192 const LTIRTree &getRTree(void) const;
193 // for LizardTech internal use only
194 LTIImageStageManager &getImageStageManager(void) const;
195
196 // for LizardTech internal use only
197 bool hasOverviewImage(void) const;
198 // for LizardTech internal use only
199 double getOverviewMag(void) const;
200
201 protected:
202 LT_STATUS decodeBegin(const LTIPixel &pixelProps,
203 const LTIScene &fullScene);
204 LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer,
205 const LTIScene &stripScene);
206 LT_STATUS decodeEnd(void);
207
208 private:
209 class ListImageStagesInSceneCallback;
210 struct TileInfo;
211
212 LT_STATUS setupPixelProps(TileInfo *tiles, lt_uint32 numTiles,
213 const LTIPixel *background,
214 bool mergeMetadata);
215
216 LT_STATUS setupGeoProps(TileInfo *tiles, lt_uint32 numTiles,
217 bool useMultires);
218
219 LT_STATUS setupBuffers(lt_uint32 numTiles);
220 LT_STATUS setupOverview(void);
221
222 LTIImageStageManager *m_imageStageManager;
223
224 LTIRTree *m_rtree;
225
226 // open image book keeping
227 LTIImageStage **m_rImage;
228 LTIEmbeddedImage **m_fImage;
229 int *m_sImage;
230 LTIPixelFillMethod m_fillMethod;
231 double m_fuzzyThreshold;
232 AlphaMode m_alphaMode;
233 LTIResampleMethod m_resampleMethod;
234 bool m_usePixelCenter;
235 double m_magSnapThreshold;
236 bool m_deleteImages;
237
238 LTIPipelineBuilder *m_pipelineBuilder;
239
240 // imageInScene
241 lt_uint32 *m_inSceneList;
242
243 LTIEmbeddedImage *m_overview;
244 double m_overviewMag;
245 };
246
247 #ifndef DOXYGEN_EXCLUDE
248
249 class LTIPipelineBuilder
250 {
251 public:
252 virtual LT_STATUS buildPipeline(lt_uint32 imageNumber,
253 LTIImageStage *&pipeline) = 0;
254 };
255
256 #endif
257
258 LT_END_NAMESPACE(LizardTech)
259
260
261 #endif // LTI_MOSAIC_FILTER_H

LizardTech