MrSID Decode SDK for Raster Reference Manual  9.1.0.4045
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"
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
44  <LTIOverridePixelProps
45  <LTIOverrideBackgroundPixel
46  <LTIOverrideGeoCoord
47  <LTIOverrideMagnification
48  <LTIOverrideIsSelective
49  <LTIOverrideStripHeight
50  <LTIOverrideDelegates
51  <LTIOverridePixelLookupTables
52  <LTIOverrideMetadata
53  <LTIImageStage> > > > > > > > > >
54 #endif
55 {
57 public:
58  enum AlphaMode
59  {
63  };
64 
88  LT_STATUS initialize(LTIImageStageManager *imageStageManager,
89  const LTIPixel* backgroundPixel,
90  bool useMultires,
91  bool mergeMetadata = true,
92  AlphaMode alphaMode = DoNothing);
93 
105  bool useMultires);
106 
107  // LTIImage
108  LT_STATUS getDimsAtMag(double mag,
109  lt_uint32 &width,
110  lt_uint32 &height) const;
111 
112  // LTIImageStage
113  lt_int64 getEncodingCost(const LTIScene& scene) const;
114  bool getReaderScene(const LTIScene &decodeScene,
115  LTIScene &readerScene) const;
116  virtual lt_uint32 getModifications(const LTIScene &scene) const;
117  LTIMaskSource *getMask() const;
118  bool getPipelineInfo(LTIPipelineInfo info) const;
119 
125  void setFillMethod(LTIPixelFillMethod method,
126  double fuzzyThreshold /*= LTISceneBuffer::DefaultFuzzyThreshold*/);
127 
131  LTIPixelFillMethod getFillMethod(void) const;
132  double getFuzzyThreshold(void) const;
133 
138  void setResampleMethod(LTIResampleMethod resampleMethod);
139 
140  void setMagSnapThreshold(double threshold);
141 
146 
147  // for LizardTech internal use only
148  bool getReaderScene(lt_uint32 child,
149  const LTIScene &decodeScene,
150  LTIScene &mosaicScene,
151  LTIScene &readerScene) const;
152  // for LizardTech internal use only
153  bool getOverviewReaderScene(const LTIScene &decodeScene,
154  LTIScene &mosaicScene,
155  LTIScene &readerScene) const;
156 
157  // for LizardTech internal use only
159  {
160  public:
161  virtual LT_STATUS found(const LTIScene &scene,
162  lt_uint32 imageNum,
163  LTIEmbeddedImage &embedded,
164  LTIImageStage &image) = 0;
165  };
166 
167  // for LizardTech internal use only
169  InSceneCallback &callback);
170 
171  // for LizardTech internal use only
172  void setDeleteImages(bool deleteImages);
173  // for LizardTech internal use only
174  bool getDeleteImages(void) const;
175 
176  // for LizardTech internal use only
178  LTIEmbeddedImage *&embedded,
179  LTIImageStage *&raw);
180  // for LizardTech internal use only
182 
183  // for LizardTech internal use only
184  // does not take ownship of pipelineBuilder
185  // don't call this function in inside a decodeBegin()/decodeStrip()/decodeEnd() loop
186  LT_STATUS setPipelineBuilder(LTIPipelineBuilder *pipelineBuilder);
187 
188  // for LizardTech internal use only
189  const LTIRTree &getRTree(void) const;
190  // for LizardTech internal use only
192 
193  // for LizardTech internal use only
194  bool hasOverviewImage(void) const;
195  // for LizardTech internal use only
196  double getOverviewMag(void) const;
197 
198 protected:
199  LT_STATUS decodeBegin(const LTIPixel &pixelProps,
200  const LTIScene &fullScene);
201  LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer,
202  const LTIScene &stripScene);
203  LT_STATUS decodeEnd(void);
204 
205 private:
206  class ListImageStagesInSceneCallback;
207  struct TileInfo;
208 
209  LT_STATUS setupPixelProps(TileInfo *tiles, lt_uint32 numTiles,
210  const LTIPixel *background,
211  bool mergeMetadata);
212 
213  LT_STATUS setupGeoProps(TileInfo *tiles, lt_uint32 numTiles,
214  bool useMultires);
215 
216  LT_STATUS setupBuffers(lt_uint32 numTiles);
217  LT_STATUS setupOverview(void);
218 
219  LTIImageStageManager *m_imageStageManager;
220 
221  LTIRTree *m_rtree;
222 
223  // open image book keeping
224  LTIImageStage **m_rImage;
225  LTIEmbeddedImage **m_fImage;
226  int *m_sImage;
227  LTIPixelFillMethod m_fillMethod;
228  double m_fuzzyThreshold;
229  AlphaMode m_alphaMode;
230  LTIResampleMethod m_resampleMethod;
231  double m_magSnapThreshold;
232  bool m_deleteImages;
233 
234  LTIPipelineBuilder *m_pipelineBuilder;
235 
236  // imageInScene
237  lt_uint32 *m_inSceneList;
238 
239  LTIEmbeddedImage *m_overview;
240  double m_overviewMag;
241 };
242 
243 #ifndef DOXYGEN_EXCLUDE
244 
245 class LTIPipelineBuilder
246 {
247 public:
248  virtual LT_STATUS buildPipeline(lt_uint32 tileId,
249  LTIImageStage *&pipeline) = 0;
250 };
251 
252 #endif
253 
254 LT_END_NAMESPACE(LizardTech)
255 
256 
257 #endif // LTI_MOSAIC_FILTER_H
class to hold data passed between image stages
LT_STATUS decodeBegin(const LTIPixel &pixelProps, const LTIScene &fullScene)
start strip-based read
LT_STATUS loadImage(lt_uint32 i, LTIEmbeddedImage *&embedded, LTIImageStage *&raw)
void setFillMethod(LTIPixelFillMethod method, double fuzzyThreshold)
Set the fill method which controls how noData pixels are matched.
double getOverviewMag(void) const
unsigned int lt_uint32
unsigned 32-bit integer
Definition: lt_types.h:54
bool hasOverviewImage(void) const
void setDeleteImages(bool deleteImages)
const LTIRTree & getRTree(void) const
abstract class for decoding from an image
lt_int64 getEncodingCost(const LTIScene &scene) const
get the cost to encode this scene
#define LT_BEGIN_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:84
representation of a scene
Definition: lti_scene.h:64
LTIMaskSource * getMask() const
LTIResampleMethod getResampleMethod(void) const
Get the fill method.
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:39
static LT_STATUS checkResolutionConformance(LTIImageStageManager *imageStageManager, bool useMultires)
Check if a set of images can be mosaicked together.
virtual lt_uint32 getModifications(const LTIScene &scene) const
get the modification bitfield for this image
LT_STATUS setPipelineBuilder(LTIPipelineBuilder *pipelineBuilder)
void setResampleMethod(LTIResampleMethod resampleMethod)
Set resampling method.
LTIPipelineInfo
Definition: lti_types.h:223
LT_STATUS getDimsAtMag(double mag, lt_uint32 &width, lt_uint32 &height) const
get image width and height at given magnification
double getFuzzyThreshold(void) const
LT_STATUS forEachImageStageInScene(const LTIScene &scene, InSceneCallback &callback)
LTIPixelFillMethod getFillMethod(void) const
Get the fill method.
bool getReaderScene(const LTIScene &decodeScene, LTIScene &readerScene) const
get the underlying scene to be used
LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer, const LTIScene &stripScene)
read a strip from the image
bool getPipelineInfo(LTIPipelineInfo info) const
#define LT_END_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:85
LT_STATUS initialize(LTIImageStageManager *imageStageManager, const LTIPixel *backgroundPixel, bool useMultires, bool mergeMetadata=true, AlphaMode alphaMode=DoNothing)
initializer
bool getOverviewReaderScene(const LTIScene &decodeScene, LTIScene &mosaicScene, LTIScene &readerScene) const
LT_STATUS decodeEnd(void)
finish strip-based read
LTIImageStageManager & getImageStageManager(void) const
create a single mosaicked image from a set of images
LT_STATUS closeImage(lt_uint32 i)
LTIPixelFillMethod
constants representing pixel filling methods
Definition: lti_types.h:187
abstract class for managing a list of image stages
create a larger frame for the image
void setMagSnapThreshold(double threshold)
bool getDeleteImages(void) const
virtual LT_STATUS found(const LTIScene &scene, lt_uint32 imageNum, LTIEmbeddedImage &embedded, LTIImageStage &image)=0
basic properties of a pixel
Definition: lti_pixel.h:36
LTIResampleMethod
constants representing resampling methods
Definition: lti_types.h:176
#define LTI_REFERENCE_COUNTED_BOILERPLATE(classname)

LizardTech