Blender.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/rp/Blender.h
22  \brief Blended pixel value calculation for two overlaped rasters.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_BLENDER_H
26 #define __TERRALIB_RP_INTERNAL_BLENDER_H
27 
28 #include "Config.h"
29 #include "Macros.h"
30 #include "../raster/Grid.h"
31 #include "../raster/Raster.h"
32 #include "../raster/Interpolator.h"
33 #include "../raster/RasterSynchronizer.h"
34 #include "../raster/TileIndexer.h"
35 #include "../geometry/Polygon.h"
36 #include "../geometry/MultiPolygon.h"
37 #include "../geometry/Point.h"
38 #include "../geometry/GeometricTransformation.h"
39 
40 #include <boost/noncopyable.hpp>
41 #include <boost/ptr_container/ptr_vector.hpp>
42 
43 #include <vector>
44 #include <complex>
45 #include <memory>
46 
47 namespace te
48 {
49  namespace rp
50  {
51  /*!
52  \class Blender
53  \brief Blended pixel value calculation for two overlaped rasters.
54  \details The overlap between the two images is modeled by the given geometric transformation direct mapping input raster 1 indexed coords (line, column) to input raster 2 indexed coords.
55  \note Optimized for rasters where all bands have the same blocking scheme.
56  \ingroup rp_aux
57  */
58  class TERPEXPORT Blender : public boost::noncopyable
59  {
60  public:
61 
62  /*! \enum BlendMethod Pixel Blend methods. */
64  {
65  InvalidBlendMethod, //!< Invalid blending method.
66  NoBlendMethod, //!< No blending performed.
67  EuclideanDistanceMethod, //!< Euclidean distance method.
68  SumMethod, //!< Pixels will be summed inside the raster overlapped area.
69  MaxMethod, //!< Keep the maximum value of two overlapping pixels.
70  MinMethod //!< Keep the minimum value of two overlapping pixels.
71  };
72 
73  /*! Default constructor. */
74  Blender();
75 
76  /*! Default destructor. */
77  ~Blender();
78 
79  /*!
80  \brief Inititate the blender instance.
81  \param raster1 Input raster 1.
82  \param raster1Bands Input raster 1 band indexes to use.
83  \param raster2 Input raster 2.
84  \param raster2Bands Input raster 2 band indexes to use (this vector has the same size as raster1Bands).
85  \param blendMethod The blend method to apply.
86  \param interpMethod1 The interpolation method to use when reading raster 1 data.
87  \param interpMethod2 The interpolation method to use when reading raster 2 data.
88  \param noDataValue The value returned where there is no pixel data bo blend.
89  \param forceRaster1NoDataValue Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)
90  \param forceRaster2NoDataValue Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)
91  \param pixelOffsets1 The values offset to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
92  \param pixelScales1 The values scale to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
93  \param pixelOffsets2 The values offset to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
94  \param pixelScales2 The values scale to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
95  \param r1ValidDataDelimiterPtr A pointer to a geometry (raster 1 world/projected coords) delimiting the raster region with valid data, or null if all raster data area is valid.
96  \param r2ValidDataDelimiterPtr A pointer to a geometry (raster 2 world/projected coords) delimiting the raster region with valid data, or null if all raster data area is valid.
97  \param geomTransformation A transformation mapping raster 1 pixels ( te::gm::GTParameters::TiePoint::first ) to raster 2 pixels ( te::gm::GTParameters::TiePoint::second ) (Note: all coords are indexed by lines/columns).
98  \param threadsNumber Enable/disable the use of threads when applicable (0:automatic , 1:disabled, any other integer dictates the number of threads).
99  \param enableProgressInterface Enable/disable the use of a progress interface when applicable.
100  \return true if ok, false on errors
101  \note Aboute scale and offset parametrs: outValue = ( ( inputValue + offsetA ) * scale ) + offsetB
102  */
103  bool initialize(
104  te::rst::Raster& raster1,
105  const std::vector< unsigned int >& raster1Bands,
106  const te::rst::Raster& raster2,
107  const std::vector< unsigned int >& raster2Bands,
108  const BlendMethod& blendMethod,
109  const te::rst::Interpolator::Method& interpMethod1,
110  const te::rst::Interpolator::Method& interpMethod2,
111  const double& noDataValue,
112  const bool forceRaster1NoDataValue,
113  const bool forceRaster2NoDataValue,
114  const std::vector< double >& pixelOffsets1,
115  const std::vector< double >& pixelScales1,
116  const std::vector< double >& pixelOffsets2,
117  const std::vector< double >& pixelScales2,
118  te::gm::MultiPolygon const * const r1ValidDataDelimiterPtr,
119  te::gm::MultiPolygon const * const r2ValidDataDelimiterPtr,
120  const te::gm::GeometricTransformation& geomTransformation,
121  const unsigned int threadsNumber,
122  const bool enableProgressInterface );
123 
124 
125  /*!
126  \brief Blend a pixel value using the current parameters.
127  \param line Line (raster 1 reference).
128  \param col Column (raster 1 reference).
129  \param values A pointer to a pre-allocated vector where the blended values will be stored.
130  \note The caller of this method must be aware that the returned blended value may be outside the original input rasters valid values range.
131  \note Raster 1 values have precedence over raster 2 values (when applicable).
132  */
133  inline void getBlendedValues( const double& line, const double& col,
134  double* const values )
135  {
136  TERP_DEBUG_TRUE_OR_THROW( m_blendFuncPtr, "Invalid blend function pointer" );
137  (this->*m_blendFuncPtr)( line, col, values );
138  };
139 
140  /*!
141  \brief Execute blending of the given input rasters and write the result into raster1.
142  \note Raster 1 values have precedence over raster 2 values (when applicable).
143  */
144  bool blendIntoRaster1();
145 
146  protected:
147 
148  /*!
149  \brief Type definition for the a bleding function pointer.
150  \param line Raster 1 Line.
151  \param col Raster 1 Column.
152  \param values A pointer to a pre-allocated vector where the blended values will be stored.
153  \note The caller of this method must be aware that the returned blended value may be outside the original input rasters valid values range.
154  \note Raster 1 values have precedence over raster 2 values (when applicable).
155  */
156  typedef void (Blender::*BlendFunctPtr)( const double& line,
157  const double& col, double* const values );
158 
159  /*!
160  \brief Raster block info
161  */
163  {
165  unsigned int m_blkX;
166  unsigned int m_blkY;
172  };
173 
174  /*!
175  \brief The parameters passed to blendIntoRaster1Thread method.
176  */
178  {
179  public :
180 
181  bool* m_returnValuePtr; //!< A pointer to the threadreturn value.
182  bool* m_abortValuePtr; //!< A pointer to the abort execution value.
183  te::rst::RasterSynchronizer* m_sync1Ptr; //!< Raster 1 syncronizer pointer.
184  te::rst::RasterSynchronizer* m_sync2Ptr; //!< Raster 1 syncronizer pointer.
185  std::vector< RasterBlockInfo >* m_raster1BlocksInfosPtr; //!< blocks to process.
186  boost::mutex* m_mutexPtr; //!< mutex pointer.
187  boost::mutex* m_blockProcessedSignalMutexPtr; //!< Mutex used to update the main process progress update.
188  boost::condition_variable* m_blockProcessedSignalPtr; //!< Signal used to update the main process progress update.
189  unsigned int* m_runningThreadsCounterPtr; //!< a pointer to the running threads counter.
190  std::vector< unsigned int > m_raster1Bands; //!< Input raster 1 band indexes to use.
191  std::vector< unsigned int > m_raster2Bands; //!< Input raster 2 band indexes to use (this vector has the same size as raster1Bands).
192  BlendMethod m_blendMethod; //!< The blend method to apply.
193  te::rst::Interpolator::Method m_interpMethod2; //!< The interpolation method to use when reading raster 2 data.
194  double m_noDataValue; //!< The value returned where there is no pixel data bo blend.
195  bool m_forceRaster1NoDataValue; //!< Use noDataValue as the input rasters no-data value (The original rasters no-data values will be ignored)
196  bool m_forceRaster2NoDataValue; //!< Use noDataValue as the input rasters no-data value (The original rasters no-data values will be ignored)
197  std::vector< double > m_pixelOffsets1; //!< The values offset to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
198  std::vector< double > m_pixelScales1; //!< The values scale to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
199  std::vector< double > m_pixelOffsets2; //!< The values offset to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
200  std::vector< double > m_pixelScales2; //!< The values scale to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
201  std::auto_ptr< te::gm::MultiPolygon > m_r1ValidDataDelimiterPtr; //!< A pointer to a geometry (raster 1 world/projected coords) delimiting the raster region with valid data, or null if all raster data area is valid.
202  std::auto_ptr< te::gm::MultiPolygon > m_r2ValidDataDelimiterPtr; //!< A pointer to a geometry (raster 2 world/projected coords) delimiting the raster region with valid data, or null if all raster data area is valid.
203  std::auto_ptr< te::gm::GeometricTransformation > m_geomTransformationPtr; //!< A transformation mapping raster 1 pixels ( te::gm::GTParameters::TiePoint::first ) to raster 2 pixels ( te::gm::GTParameters::TiePoint::second ) (Note: all coords are indexed by lines/columns).
204  unsigned long int m_maxRasterCachedBlocks; //!< The maximum number of raster cache blocks.
205  bool m_useProgress; //!< If enabled each thread will use its own progress interface, if false only a signal will be emitted on each processed block.
206 
208 
210 
212 
214  };
215 
216  bool m_enableProgressInterface; //!< Enable progress interface.
217  bool m_forceRaster1NoDataValue; //!< Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)
218  bool m_forceRaster2NoDataValue; //!< Use noDataValue as the input raster 2 no-data value (The original rasters no-data values will be ignored)
219  unsigned int m_threadsNumber; //!< The number of threads to use (0:automatic , 1:disabled, any other integer dictates the number of threads)..
220  BlendMethod m_blendMethod; //!< The blend method to apply.
221  BlendFunctPtr m_blendFuncPtr; //!< The current blend function.
222  te::rst::Raster * m_raster1Ptr; //!< Input raster 1.
223  te::rst::Raster const * m_raster2Ptr; //!< Input raster 2.
224  std::auto_ptr< te::gm::MultiPolygon > m_r1ValidDataDelimiterPtr; //!< A pointer to a geometry (raster 1 world/projected coords) delimiting the raster region with valid data, or null if all raster data area is valid.
225  std::auto_ptr< te::gm::MultiPolygon > m_r2ValidDataDelimiterPtr; //!< A pointer to a geometry (raster 2 world/projected coords) delimiting the raster region with valid data, or null if all raster data area is valid.
226  std::auto_ptr< te::gm::Geometry > m_intersectionPtr; //!< The Intersection geometry ( raster 1 indexed coods).
227  std::vector< std::pair< te::gm::Coord2D, te::gm::Coord2D > > m_r1IntersectionSegmentsPoints; //!< A sub-set of the intersection polygon wich is part of raster 1 valid data polygon ( raster 1 indexed coods).
228  std::size_t m_r1IntersectionSegmentsPointsSize; //!< Size of m_r1IntersectionSegmentsPoints;
229  std::vector< std::pair< te::gm::Coord2D, te::gm::Coord2D > > m_r2IntersectionSegmentsPoints; //!< A sub-set of the intersection polygon wich is part of raster 2 valid data polygon ( raster 1 indexed coods).
230  std::size_t m_r2IntersectionSegmentsPointsSize; //!< Size of m_r2IntersectionSegmentsPoints;
231  te::gm::GeometricTransformation* m_geomTransformationPtr; //!< A transformation mapping raster 1 pixels ( te::gm::GTParameters::TiePoint::first ) to raster 2 ( te::gm::GTParameters::TiePoint::second ) (Note: all coords are indexed by lines/columns).
232  te::rst::Interpolator::Method m_interpMethod1; //!< The interpolation method to use when reading raster 1 data.
233  te::rst::Interpolator::Method m_interpMethod2; //!< The interpolation method to use when reading raster 2 data.
234  double m_outputNoDataValue; //!< The output raster no-data value.
235  std::auto_ptr< te::rst::Interpolator > m_interp1Ptr; //!< Raster 1 interpolator instance pointer.
236  std::auto_ptr< te::rst::Interpolator > m_interp2Ptr; //!< Raster 2 interpolator instance pointer.
237  std::vector< unsigned int > m_raster1Bands; //!< Input raster 1 band indexes to use.
238  std::vector< unsigned int > m_raster2Bands; //!< Input raster 2 band indexes to use.
239  std::vector< double > m_pixelOffsets1; //!< The values offset to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
240  std::vector< double > m_pixelScales1; //!< The values scale to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
241  std::vector< double > m_pixelOffsets2; //!< The values offset to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
242  std::vector< double > m_pixelScales2; //!< The values scale to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
243  std::vector< double > m_raster1NoDataValues; //!< Raster 1 no-data values (on value per band).
244  std::vector< double > m_raster2NoDataValues; //!< Raster 2 no-data values (on value per band).
245  boost::ptr_vector< te::rst::TileIndexer > m_intersectionTileIndexers; //!< The Intersection geometry tile indexers( raster 1 indexed coods), one indexer for each intersection polygon.
246 
247  // variables used by the noBlendMethodImp method
254  std::complex< double > m_noBlendMethodImp_cValue;
257 
258  // variables used by the euclideanDistanceMethodImp method
262  std::complex< double > m_euclideanDistanceMethodImp_cValue1;
263  std::complex< double > m_euclideanDistanceMethodImp_cValue2;
273 
274  // variables used by the sumMethodImp method
278  std::complex< double > m_sumMethodImp_cValue1;
279  std::complex< double > m_sumMethodImp_cValue2;
280  unsigned int m_sumMethodImp_BandIdx;
283 
284  // variables used by the maxMethodImp method
288  std::complex< double > m_maxMethodImp_cValue1;
289  std::complex< double > m_maxMethodImp_cValue2;
290  unsigned int m_maxMethodImp_BandIdx;
293 
294  // variables used by the minMethodImp method
298  std::complex< double > m_minMethodImp_cValue1;
299  std::complex< double > m_minMethodImp_cValue2;
300  unsigned int m_minMethodImp_BandIdx;
303 
304  /*! \brief Reset the instance to its initial default state. */
305  void initState();
306 
307  /*! \brief Clear all internal allocated resources. */
308  void clear();
309 
310  /*! \brief Set the value of m_blendFuncPtr following the given blend method. */
311  void setBlendFunctionPonter( const BlendMethod blendMethod );
312 
313  /*!
314  \brief Implementation for NoBlendMethod.
315  \param line Raster 1 Line.
316  \param col Raster 1 Column.
317  \param values A pointer to a pre-allocated vector where the blended values will be stored.
318  */
319  void noBlendMethodImp( const double& line1, const double& col1,
320  double* const values );
321 
322  /*!
323  \brief Implementation for EuclideanDistanceMethod.
324  \param line Raster 1 Line.
325  \param col Raster 1 Column.
326  \param values A pointer to a pre-allocated vector where the blended values will be stored.
327  */
328  void euclideanDistanceMethodImp( const double& line1, const double& col1,
329  double* const values );
330 
331  /*!
332  \brief Implementation for SumMethod.
333  \param line Raster 1 Line.
334  \param col Raster 1 Column.
335  \param values A pointer to a pre-allocated vector where the blended values will be stored.
336  */
337  void sumMethodImp( const double& line1, const double& col1,
338  double* const values );
339 
340  /*!
341  \brief Implementation for MaxMethod.
342  \param line Raster 1 Line.
343  \param col Raster 1 Column.
344  \param values A pointer to a pre-allocated vector where the blended values will be stored.
345  */
346  void maxMethodImp( const double& line1, const double& col1,
347  double* const values );
348 
349  /*!
350  \brief Implementation for MinMethod.
351  \param line Raster 1 Line.
352  \param col Raster 1 Column.
353  \param values A pointer to a pre-allocated vector where the blended values will be stored.
354  */
355  void minMethodImp( const double& line1, const double& col1,
356  double* const values );
357 
358  /*!
359  \brief Thread entry for the method blendIntoRaster1.
360 
361  */
362  static void blendIntoRaster1Thread( BlendIntoRaster1ThreadParams* paramsPtr );
363 
364  /*!
365  \brief Extract segments from the given geometry.
366  \param geometryPtr Input geometry.
367  \param segments Found segments (appended here).
368  \return true if OK, false on errors.
369  */
370  bool getSegments( te::gm::Geometry const * const geometryPtr,
371  std::vector< std::pair< te::gm::Coord2D, te::gm::Coord2D > >& segments ) const;
372 
373 
374  /*!
375  \brief Creater polygon tile indexers from the given geometry (only if it is a polygon or a collection of polygons).
376  \param geometryPtr Input geometry.
377  \param tileIndexers Created indexers (appended here).
378  \return true if OK, false on errors.
379  \note No indexers will be returned for geometries other than polygons or collections of polygons.
380  */
381  bool getTileIndexers( te::gm::Geometry const * const geometryPtr,
382  boost::ptr_vector< te::rst::TileIndexer >& tileIndexers ) const;
383  };
384 
385  } // end namespace rp
386 } // end namespace te
387 
388 #endif // __TERRALIB_RP_INTERNAL_ALGORITHM_H
389 
double m_euclideanDistanceMethodImp_aux1
Definition: Blender.h:269
te::rst::Interpolator::Method m_interpMethod1
The interpolation method to use when reading raster 1 data.
Definition: Blender.h:232
std::vector< std::pair< te::gm::Coord2D, te::gm::Coord2D > > m_r2IntersectionSegmentsPoints
A sub-set of the intersection polygon wich is part of raster 2 valid data polygon ( raster 1 indexed ...
Definition: Blender.h:229
MultiPolygon is a MultiSurface whose elements are Polygons.
Definition: MultiPolygon.h:50
te::gm::Point m_maxMethodImp_auxPoint
Definition: Blender.h:285
Keep the maximum value of two overlapping pixels.
Definition: Blender.h:69
unsigned long int m_maxRasterCachedBlocks
The maximum number of raster cache blocks.
Definition: Blender.h:204
bool * m_abortValuePtr
A pointer to the abort execution value.
Definition: Blender.h:182
std::vector< unsigned int > m_raster2Bands
Input raster 2 band indexes to use.
Definition: Blender.h:238
double m_euclideanDistanceMethodImp_Point2Col
Definition: Blender.h:261
std::vector< RasterBlockInfo > * m_raster1BlocksInfosPtr
blocks to process.
Definition: Blender.h:185
The parameters passed to blendIntoRaster1Thread method.
Definition: Blender.h:177
bool m_useProgress
If enabled each thread will use its own progress interface, if false only a signal will be emitted on...
Definition: Blender.h:205
boost::condition_variable * m_blockProcessedSignalPtr
Signal used to update the main process progress update.
Definition: Blender.h:188
double m_euclideanDistanceMethodImp_currDist
Definition: Blender.h:265
std::vector< double > m_pixelScales1
The values scale to be applied to raster 1 pixel values before the blended value calcule (one element...
Definition: Blender.h:198
Blended pixel value calculation for two overlaped rasters.
Definition: Blender.h:58
double m_sumMethodImp_Point2Col
Definition: Blender.h:277
std::auto_ptr< te::gm::MultiPolygon > m_r2ValidDataDelimiterPtr
A pointer to a geometry (raster 2 world/projected coords) delimiting the raster region with valid dat...
Definition: Blender.h:202
std::vector< double > m_pixelOffsets1
The values offset to be applied to raster 1 pixel values before the blended value calcule (one elemen...
Definition: Blender.h:197
unsigned int m_minMethodImp_IntersectionTileIndexersIdx
Definition: Blender.h:301
std::vector< double > m_pixelScales2
The values scale to be applied to raster 2 pixel values before the blended value calcule (one element...
Definition: Blender.h:242
double m_sumMethodImp_Point2Line
Definition: Blender.h:276
std::complex< double > m_sumMethodImp_cValue2
Definition: Blender.h:279
te::rst::Raster const * m_raster2Ptr
Input raster 2.
Definition: Blender.h:223
double m_outputNoDataValue
The output raster no-data value.
Definition: Blender.h:234
te::gm::Point m_minMethodImp_auxPoint
Definition: Blender.h:295
std::complex< double > m_minMethodImp_cValue2
Definition: Blender.h:299
boost::mutex * m_mutexPtr
mutex pointer.
Definition: Blender.h:186
std::vector< double > m_raster2NoDataValues
Raster 2 no-data values (on value per band).
Definition: Blender.h:244
unsigned int m_maxMethodImp_BandIdx
Definition: Blender.h:290
double m_minMethodImp_Point2Line
Definition: Blender.h:296
std::complex< double > m_maxMethodImp_cValue2
Definition: Blender.h:289
std::auto_ptr< te::gm::Geometry > m_intersectionPtr
The Intersection geometry ( raster 1 indexed coods).
Definition: Blender.h:226
unsigned int m_maxMethodImp_IntersectionTileIndexersIdx
Definition: Blender.h:291
std::vector< unsigned int > m_raster2Bands
Input raster 2 band indexes to use (this vector has the same size as raster1Bands).
Definition: Blender.h:191
bool * m_returnValuePtr
A pointer to the threadreturn value.
Definition: Blender.h:181
unsigned int * m_runningThreadsCounterPtr
a pointer to the running threads counter.
Definition: Blender.h:189
An access synchronizer to be used in SynchronizedRaster raster instances.
2D Geometric transformation base class.
te::rst::RasterSynchronizer * m_sync2Ptr
Raster 1 syncronizer pointer.
Definition: Blender.h:184
std::size_t m_r1IntersectionSegmentsPointsSize
Size of m_r1IntersectionSegmentsPoints;.
Definition: Blender.h:228
std::complex< double > m_sumMethodImp_cValue1
Definition: Blender.h:278
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:92
double m_euclideanDistanceMethodImp_dist2
Definition: Blender.h:267
No blending performed.
Definition: Blender.h:66
double m_noBlendMethodImp_Point1XProj1
Definition: Blender.h:248
std::complex< double > m_noBlendMethodImp_cValue
Definition: Blender.h:254
double m_euclideanDistanceMethodImp_dist1
Definition: Blender.h:266
bool m_sumMethodImp_PointInsideIntersection
Definition: Blender.h:282
Raster block info.
Definition: Blender.h:162
double m_maxMethodImp_Point2Line
Definition: Blender.h:286
bool m_enableProgressInterface
Enable progress interface.
Definition: Blender.h:216
std::complex< double > m_maxMethodImp_cValue1
Definition: Blender.h:288
bool m_forceRaster1NoDataValue
Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be igno...
Definition: Blender.h:217
std::auto_ptr< te::rst::Interpolator > m_interp2Ptr
Raster 2 interpolator instance pointer.
Definition: Blender.h:236
unsigned int m_minMethodImp_BandIdx
Definition: Blender.h:300
double m_euclideanDistanceMethodImp_aux2
Definition: Blender.h:270
std::auto_ptr< te::gm::MultiPolygon > m_r1ValidDataDelimiterPtr
A pointer to a geometry (raster 1 world/projected coords) delimiting the raster region with valid dat...
Definition: Blender.h:224
std::vector< double > m_pixelOffsets1
The values offset to be applied to raster 1 pixel values before the blended value calcule (one elemen...
Definition: Blender.h:239
A point with x and y coordinate values.
Definition: Point.h:50
bool m_maxMethodImp_PointInsideIntersection
Definition: Blender.h:292
An abstract class for raster data strucutures.
Definition: Raster.h:71
std::size_t m_r2IntersectionSegmentsPointsSize
Size of m_r2IntersectionSegmentsPoints;.
Definition: Blender.h:230
te::rst::Raster * m_raster1Ptr
Input raster 1.
Definition: Blender.h:222
Pixels will be summed inside the raster overlapped area.
Definition: Blender.h:68
unsigned int m_sumMethodImp_IntersectionTileIndexersIdx
Definition: Blender.h:281
URI C++ Library.
Invalid blending method.
Definition: Blender.h:65
boost::ptr_vector< te::rst::TileIndexer > m_intersectionTileIndexers
The Intersection geometry tile indexers( raster 1 indexed coods), one indexer for each intersection p...
Definition: Blender.h:245
std::vector< double > m_pixelOffsets2
The values offset to be applied to raster 2 pixel values before the blended value calcule (one elemen...
Definition: Blender.h:241
std::vector< double > m_raster1NoDataValues
Raster 1 no-data values (on value per band).
Definition: Blender.h:243
unsigned int m_rasterCols2ProcessBound
Definition: Blender.h:171
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
double m_noBlendMethodImp_Point1YProj2
Definition: Blender.h:251
te::rst::RasterSynchronizer * m_sync1Ptr
Raster 1 syncronizer pointer.
Definition: Blender.h:183
std::vector< double > m_pixelScales1
The values scale to be applied to raster 1 pixel values before the blended value calcule (one element...
Definition: Blender.h:240
bool m_forceRaster2NoDataValue
Use noDataValue as the input raster 2 no-data value (The original rasters no-data values will be igno...
Definition: Blender.h:218
void getBlendedValues(const double &line, const double &col, double *const values)
Blend a pixel value using the current parameters.
Definition: Blender.h:133
double m_noBlendMethodImp_Point2Col
Definition: Blender.h:253
BlendFunctPtr m_blendFuncPtr
The current blend function.
Definition: Blender.h:221
std::vector< unsigned int > m_raster1Bands
Input raster 1 band indexes to use.
Definition: Blender.h:237
std::size_t m_euclideanDistanceMethodImp_vecIdx
Definition: Blender.h:268
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:74
std::complex< double > m_minMethodImp_cValue1
Definition: Blender.h:298
unsigned int m_blkTotalPixelsNumber
Definition: Blender.h:167
bool m_euclideanDistanceMethodImp_PointInsideIntersection
Definition: Blender.h:272
std::auto_ptr< te::gm::MultiPolygon > m_r1ValidDataDelimiterPtr
A pointer to a geometry (raster 1 world/projected coords) delimiting the raster region with valid dat...
Definition: Blender.h:201
unsigned int m_euclideanDistanceMethodImp_BandIdx
Definition: Blender.h:264
Configuration flags for the Raster Processing module of TerraLib.
bool m_forceRaster1NoDataValue
Use noDataValue as the input rasters no-data value (The original rasters no-data values will be ignor...
Definition: Blender.h:195
double m_noBlendMethodImp_Point1XProj2
Definition: Blender.h:250
double m_noDataValue
The value returned where there is no pixel data bo blend.
Definition: Blender.h:194
unsigned int m_noBlendMethodImp_BandIdx
Definition: Blender.h:256
te::gm::Point m_sumMethodImp_auxPoint
Definition: Blender.h:275
te::gm::GeometricTransformation * m_geomTransformationPtr
A transformation mapping raster 1 pixels ( te::gm::GTParameters::TiePoint::first ) to raster 2 ( te::...
Definition: Blender.h:231
unsigned int m_rasterRows2ProcessBound
Definition: Blender.h:169
Euclidean distance method.
Definition: Blender.h:67
te::rst::Interpolator::Method m_interpMethod2
The interpolation method to use when reading raster 2 data.
Definition: Blender.h:233
std::auto_ptr< te::rst::Interpolator > m_interp1Ptr
Raster 1 interpolator instance pointer.
Definition: Blender.h:235
double m_noBlendMethodImp_Point2Line
Definition: Blender.h:252
boost::mutex * m_blockProcessedSignalMutexPtr
Mutex used to update the main process progress update.
Definition: Blender.h:187
bool m_forceRaster2NoDataValue
Use noDataValue as the input rasters no-data value (The original rasters no-data values will be ignor...
Definition: Blender.h:196
double m_noBlendMethodImp_Value
Definition: Blender.h:255
BlendMethod m_blendMethod
The blend method to apply.
Definition: Blender.h:192
unsigned int m_sumMethodImp_BandIdx
Definition: Blender.h:280
std::vector< double > m_pixelOffsets2
The values offset to be applied to raster 2 pixel values before the blended value calcule (one elemen...
Definition: Blender.h:199
double m_maxMethodImp_Point2Col
Definition: Blender.h:287
std::auto_ptr< te::gm::MultiPolygon > m_r2ValidDataDelimiterPtr
A pointer to a geometry (raster 2 world/projected coords) delimiting the raster region with valid dat...
Definition: Blender.h:225
unsigned int m_threadsNumber
The number of threads to use (0:automatic , 1:disabled, any other integer dictates the number of thre...
Definition: Blender.h:219
unsigned int m_firstRasterRow2Process
Definition: Blender.h:168
std::complex< double > m_euclideanDistanceMethodImp_cValue1
Definition: Blender.h:262
unsigned int m_euclideanDistanceMethodImp_IntersectionTileIndexersIdx
Definition: Blender.h:271
double m_euclideanDistanceMethodImp_Point2Line
Definition: Blender.h:260
#define TERP_DEBUG_TRUE_OR_THROW(value, message)
Checks if value is true and throws an exception if not.
Definition: Macros.h:357
BlendMethod m_blendMethod
The blend method to apply.
Definition: Blender.h:220
std::vector< unsigned int > m_raster1Bands
Input raster 1 band indexes to use.
Definition: Blender.h:190
std::auto_ptr< te::gm::GeometricTransformation > m_geomTransformationPtr
A transformation mapping raster 1 pixels ( te::gm::GTParameters::TiePoint::first ) to raster 2 pixels...
Definition: Blender.h:203
double m_noBlendMethodImp_Point1YProj1
Definition: Blender.h:249
te::gm::Point m_euclideanDistanceMethodImp_auxPoint
Definition: Blender.h:259
bool m_minMethodImp_PointInsideIntersection
Definition: Blender.h:302
std::complex< double > m_euclideanDistanceMethodImp_cValue2
Definition: Blender.h:263
std::vector< double > m_pixelScales2
The values scale to be applied to raster 2 pixel values before the blended value calcule (one element...
Definition: Blender.h:200
te::rst::Interpolator::Method m_interpMethod2
The interpolation method to use when reading raster 2 data.
Definition: Blender.h:193
double m_minMethodImp_Point2Col
Definition: Blender.h:297
std::vector< std::pair< te::gm::Coord2D, te::gm::Coord2D > > m_r1IntersectionSegmentsPoints
A sub-set of the intersection polygon wich is part of raster 1 valid data polygon ( raster 1 indexed ...
Definition: Blender.h:227
unsigned int m_firstRasterCol2Process
Definition: Blender.h:170