00001
00024 #ifndef INC_SPATMOD_IMAGEFILTERSTEREO_H
00025 #define INC_SPATMOD_IMAGEFILTERSTEREO_H
00026
00027 #ifndef INC_SPATMOD_IMAGEFILTER_H
00028 #include <spatmod/imagefilter.h>
00029 #endif
00030
00031 #ifndef INC_SPATMOD_IMAGESECTION_H
00032 #include <spatmod/imagesection.h>
00033 #endif
00034
00035 #ifndef INC_SPATMOD_IMAGESAMPLEITERATOR_H
00036 #include <spatmod/imagesampleiterator.h>
00037 #endif
00038
00039 #ifndef INC_SPATMOD_IMAGERESAMPLEMETHOD_H
00040 #include <spatmod/imageresamplemethod.h>
00041 #endif
00042
00043 #ifndef INC_MI32_TRANS2MAPGEN_H
00044 #include <mi32/trans2dmapgen.h>
00045 #endif
00046
00047 #ifndef INC_MI32_RECT_H
00048 #include <mi32/rect.h>
00049 #endif
00050
00051 #ifndef INC_MI32_STEREODEVICE_H
00052 #include <mi32/stereodevice.h>
00053 #endif
00054
00055 namespace SPATMOD {
00056 namespace IMAGE {
00057
00058 class BUFFER;
00059
00060
00061
00091 class FILTER_STEREO : public FILTER {
00092 public:
00093
00095 FILTER_STEREO (
00096 STAGE *pStageDrape,
00097 bool TakeOwnershipDrape,
00098 STAGE *pStageTerrain,
00099 bool TakeOwnershipTerrain,
00100 double DisplacementScale,
00101 double DisplacementZeroValue,
00102 const DIMENSIONS& Dimensions,
00103 const GEOREFERENCE& Georeference,
00104 RESAMPLEMETHOD ResampleMethod,
00105 bool InterlaceStartRight = false
00106 );
00107
00109 FILTER_STEREO (
00110 STAGE *pStageDrape,
00111 bool TakeOwnershipDrape,
00112 STAGE *pStageTerrain,
00113 bool TakeOwnershipTerrain,
00114 double DisplacementScale,
00115 double DisplacementZeroValue,
00116 const BASE& RefImage,
00117 RESAMPLEMETHOD ResampleMethod,
00118 bool InterlaceStartRight = false
00119 );
00120
00121
00122 virtual ~FILTER_STEREO ();
00123
00128 void SetAccuracy (
00129 double accuracy
00130 ) { m_Accuracy = accuracy; }
00131
00134 void SetStereoDevice (
00135 const STEREODEVICE& StereoDevice
00136 );
00137
00138 private:
00139 #ifndef GENERATING_DOXYGEN_OUTPUT
00140 STEREODEVICE m_StereoDevice;
00141 RESAMPLEMETHOD m_ResampleMethodDrape;
00142 RESAMPLEMETHOD m_ResampleMethodTerrain;
00143 TRANS2D_MAPGEN m_TransToPrev[2];
00144 DRECT2D m_RectTotalPrev[2];
00145 double m_DisplacementScale;
00146 double m_DisplacementZeroValue;
00147 double m_DisplacementMax;
00148 double m_Accuracy;
00149 bool m_InterlaceStartRight;
00150 bool m_PullSinglePixels;
00151
00152 ERRVALUE ComputePrevMaxSectionSize (
00153 const SECTION_ITERATOR& TgtIterator,
00154 int StageIdx,
00155 DRECT2D& PrevRectAll,
00156 UINT32& PrevMaxColumns,
00157 UINT32& PrevMaxRows
00158 ) const;
00159
00160 ERRVALUE DoPullBegin (
00161 const SECTION_ITERATOR& TgtIterator,
00162 int StageIdx
00163 );
00164
00165 ERRVALUE GetTerrainDisplacement (
00166 DOUBLE_ARRAY<double>& TerrainShift,
00167 const DOUBLE_ARRAY<DPOINT2D>& TerrainCoord,
00168 BUFFER& TerrainBuffer,
00169 INT32 TerrainBaseRow,
00170 INT32 TerrainBaseColumn
00171 ) const;
00172
00173
00174 virtual ERRVALUE v_Initialize ();
00175 virtual ERRVALUE v_PullBegin (const SECTION_ITERATOR& iterator);
00176 virtual ERRVALUE v_PullSubSection (const SECTION& SubSection, BUFFER& buffer);
00177 virtual float v_QueryIterator (const SECTION_ITERATOR& iterator) const;
00178
00179
00180 FILTER_STEREO (const FILTER_STEREO&);
00181 FILTER_STEREO& operator= (const FILTER_STEREO&);
00182 #endif // GENERATING_DOXYGEN_OUTPUT
00183
00184 };
00185
00186
00187
00188 }
00189 }
00190
00191 #endif // INC_SPATMOD_IMAGEFILTERSTEREO_H
00192