svn-gvsig-desktop / trunk / libraries / libjni-mrsid / include / filters / lti_mosaicFilter.h @ 3539
History | View | Annotate | Download (5.59 KB)
1 |
/* $Id: lti_mosaicFilter.h 3539 2006-01-09 12:23:20Z nacho $ */
|
---|---|
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 |
// //
|
10 |
////////////////////////////////////////////////////////////////////////// */
|
11 |
/* PUBLIC */
|
12 |
|
13 |
#ifndef LTI_MOSAICFILTER_H
|
14 |
#define LTI_MOSAICFILTER_H
|
15 |
|
16 |
// lt_lib_mrsid_core
|
17 |
#include "lti_imageFilter.h" |
18 |
|
19 |
|
20 |
LT_BEGIN_NAMESPACE(LizardTech) |
21 |
|
22 |
#if defined(LT_COMPILER_MS)
|
23 |
#pragma warning(push,4) |
24 |
#endif
|
25 |
|
26 |
|
27 |
class LTIEmbeddedImage; |
28 |
class LTIStaticZoomFilter; |
29 |
|
30 |
|
31 |
/**
|
32 |
* create a single mosaicked image from a set of images
|
33 |
*
|
34 |
* This class create a single mosaicked image from a set of images.
|
35 |
*
|
36 |
* The set of input images are all assumed to be in the same coordinate
|
37 |
* space. In general, all the images must have the same resolution;
|
38 |
* differences that are within a small epsilon or exactly a power of two
|
39 |
* are optionally allowed.
|
40 |
*/
|
41 |
class LTIMosaicFilter : public LTIImageFilter |
42 |
{ |
43 |
public:
|
44 |
/**
|
45 |
* constructor
|
46 |
*
|
47 |
* Creates an image stage which is a mosaic of the set of input images.
|
48 |
*
|
49 |
* The "res correct" feature allows images with slightly different
|
50 |
* resolutions to be mosaicked. This allows for proper handling of
|
51 |
* situations where one image has a resolution of 0.5000 and another has a
|
52 |
* resolution of 0.4999.
|
53 |
*
|
54 |
* The "multires" feature allows images whose resolutions which differ by
|
55 |
* a power of two to be mosaicked together. (The LTIStaticZoomFilter class
|
56 |
* is used to implement this feature.)
|
57 |
*
|
58 |
* NoData and background pixel settings are honored by the mosaic process.
|
59 |
*
|
60 |
* @param images array of base images to be mosaicked together
|
61 |
* @param numImages number of images in the \a images array
|
62 |
* @param backgroundPixel color of the background pixel for the new image stage
|
63 |
* @param useResCorrect allow images to have slightly different resolutions
|
64 |
* @param useMultires allow images whose resolutions differ by a power of two
|
65 |
* @param takeOwnership set to true to have the filter delete the \a sourceImage
|
66 |
*/
|
67 |
LTIMosaicFilter(LTIImageStage** images, |
68 |
lt_uint32 numImages, |
69 |
const LTIPixel* backgroundPixel,
|
70 |
bool useResCorrect,
|
71 |
bool useMultires,
|
72 |
bool takeOwnership);
|
73 |
virtual ~LTIMosaicFilter(); |
74 |
virtual LT_STATUS initialize(); |
75 |
|
76 |
// must be called AFTER initialize()
|
77 |
LT_STATUS setUsingFuzzyNoData(bool fuzzy);
|
78 |
bool getUsingFuzzyNoData(void) const; |
79 |
|
80 |
lt_int64 getPhysicalFileSize() const;
|
81 |
|
82 |
lt_uint32 getStripHeight() const;
|
83 |
LT_STATUS setStripHeight(lt_uint32 stripHeight); |
84 |
|
85 |
lt_int64 getEncodingCost(const LTIScene& scene) const; |
86 |
|
87 |
bool isSelective() const; |
88 |
|
89 |
LT_STATUS projectPointAtMag(double upperLeft,
|
90 |
double mag,
|
91 |
double& newUpperLeft) const; |
92 |
|
93 |
LT_STATUS projectDimAtMag(double dim,
|
94 |
double mag,
|
95 |
double& newDim) const; |
96 |
|
97 |
LT_STATUS getDimsAtMag(double mag,
|
98 |
lt_uint32& width, |
99 |
lt_uint32& height) const;
|
100 |
|
101 |
bool getReaderScene(const LTIScene &decodeScene, LTIScene &readerScene) const; |
102 |
|
103 |
bool getReaderScene(lt_uint32 child,
|
104 |
const LTIScene &decodeScene,
|
105 |
LTIScene &readerScene) const;
|
106 |
|
107 |
/**
|
108 |
* Check if a set of images can be mosaicked together. The parameters to
|
109 |
* this function mirror those of the constructor: this function will
|
110 |
* return LT_STS_Success if and only if the images' resolutions are such
|
111 |
* that a mosaic can be produced.
|
112 |
*
|
113 |
* @param images array of base images to be mosaicked together
|
114 |
* @param numImages number of images in the \a images array
|
115 |
* @param useResCorrect allow images to have slightly different resolutions
|
116 |
* @param useMultires allow images whose resolutions differ by a power of two
|
117 |
* @return status code indicating success or failure
|
118 |
*/
|
119 |
static LT_STATUS checkResolutionConformance(LTIImageStage** images,
|
120 |
lt_uint32 numImages, |
121 |
bool useResCorrect,
|
122 |
bool useMultires);
|
123 |
|
124 |
protected:
|
125 |
virtual LT_STATUS decodeBegin(const LTIScene& scene);
|
126 |
virtual LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
|
127 |
virtual LT_STATUS decodeEnd(); |
128 |
|
129 |
//LTIImageStage* getUnderlying(lt_uint32 i) const;
|
130 |
|
131 |
private:
|
132 |
typedef LTIImageFilter Super;
|
133 |
|
134 |
|
135 |
LT_STATUS checkCompat() const;
|
136 |
LT_STATUS checkCompatResCorrect() const;
|
137 |
LT_STATUS checkCompatResCorrectForImage(lt_uint32 i) const;
|
138 |
|
139 |
LT_STATUS fixMultires(); |
140 |
|
141 |
LTIImageStage** m_imagesUnderlying; |
142 |
LTIImageStage** m_images; |
143 |
|
144 |
lt_uint32 m_numImages; |
145 |
bool m_useResCorrect;
|
146 |
bool m_useMultires;
|
147 |
bool m_takeOwnership;
|
148 |
|
149 |
LTIPixel* m_userBackgroundPixel; |
150 |
|
151 |
// nope
|
152 |
LTIMosaicFilter(const LTIMosaicFilter&);
|
153 |
LTIMosaicFilter& operator=(const LTIMosaicFilter&);
|
154 |
}; |
155 |
|
156 |
|
157 |
LT_END_NAMESPACE(LizardTech) |
158 |
|
159 |
#if defined(LT_COMPILER_MS)
|
160 |
#pragma warning(pop)
|
161 |
#endif
|
162 |
|
163 |
#endif // LTI_MOSAICFILTER_H |