Blended pixel value calculation for two overlaped rasters. More...
#include <Blender.h>
Classes | |
class | BlendIntoRaster1ThreadParams |
The parameters passed to blendIntoRaster1Thread method. More... | |
struct | RasterBlockInfo |
Raster block info. More... | |
Public Types | |
enum | BlendMethod { InvalidBlendMethod, NoBlendMethod, EuclideanDistanceMethod, SumMethod } |
Public Member Functions | |
Blender () | |
bool | blendIntoRaster1 () |
Execute blending of the given input rasters and write the result into raster1. More... | |
void | getBlendedValues (const double &line, const double &col, double *const values) |
Blend a pixel value using the current parameters. More... | |
bool | initialize (te::rst::Raster &raster1, const std::vector< unsigned int > &raster1Bands, const te::rst::Raster &raster2, const std::vector< unsigned int > &raster2Bands, const BlendMethod &blendMethod, const te::rst::Interpolator::Method &interpMethod1, const te::rst::Interpolator::Method &interpMethod2, const double &noDataValue, const bool forceRaster1NoDataValue, const bool forceRaster2NoDataValue, const std::vector< double > &pixelOffsets1, const std::vector< double > &pixelScales1, const std::vector< double > &pixelOffsets2, const std::vector< double > &pixelScales2, te::gm::MultiPolygon const *const r1ValidDataDelimiterPtr, te::gm::MultiPolygon const *const r2ValidDataDelimiterPtr, const te::gm::GeometricTransformation &geomTransformation, const unsigned int threadsNumber, const bool enableProgressInterface) |
Inititate the blender instance. More... | |
~Blender () | |
Protected Types | |
typedef void(Blender::* | BlendFunctPtr) (const double &line, const double &col, double *const values) |
Type definition for the a bleding function pointer. More... | |
Protected Member Functions | |
void | clear () |
Clear all internal allocated resources. More... | |
void | euclideanDistanceMethodImp (const double &line1, const double &col1, double *const values) |
Implementation for EuclideanDistanceMethod. More... | |
bool | getSegments (te::gm::Geometry const *const geometryPtr, std::vector< std::pair< te::gm::Coord2D, te::gm::Coord2D > > &segments) const |
Extract segments from the given geometry. More... | |
bool | getTileIndexers (te::gm::Geometry const *const geometryPtr, boost::ptr_vector< te::rst::TileIndexer > &tileIndexers) const |
Creater polygon tile indexers from the given geometry (only if it is a polygon or a collection of polygons). More... | |
void | initState () |
Reset the instance to its initial default state. More... | |
void | noBlendMethodImp (const double &line1, const double &col1, double *const values) |
Implementation for NoBlendMethod. More... | |
void | setBlendFunctionPonter (const BlendMethod blendMethod) |
Set the value of m_blendFuncPtr following the given blend method. More... | |
void | sumMethodImp (const double &line1, const double &col1, double *const values) |
Implementation for SumMethod. More... | |
Static Protected Member Functions | |
static void | blendIntoRaster1Thread (BlendIntoRaster1ThreadParams *paramsPtr) |
Thread entry for the method blendIntoRaster1. More... | |
Protected Attributes | |
BlendFunctPtr | m_blendFuncPtr |
The current blend function. More... | |
BlendMethod | m_blendMethod |
The blend method to apply. More... | |
bool | m_enableProgressInterface |
Enable progress interface. More... | |
double | m_euclideanDistanceMethodImp_aux1 |
double | m_euclideanDistanceMethodImp_aux2 |
te::gm::Point | m_euclideanDistanceMethodImp_auxPoint |
unsigned int | m_euclideanDistanceMethodImp_BandIdx |
double | m_euclideanDistanceMethodImp_currDist |
std::complex< double > | m_euclideanDistanceMethodImp_cValue1 |
std::complex< double > | m_euclideanDistanceMethodImp_cValue2 |
double | m_euclideanDistanceMethodImp_dist1 |
double | m_euclideanDistanceMethodImp_dist2 |
unsigned int | m_euclideanDistanceMethodImp_IntersectionTileIndexersIdx |
double | m_euclideanDistanceMethodImp_Point2Col |
double | m_euclideanDistanceMethodImp_Point2Line |
bool | m_euclideanDistanceMethodImp_PointInsideIntersection |
std::size_t | m_euclideanDistanceMethodImp_vecIdx |
bool | m_forceRaster1NoDataValue |
Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored) More... | |
bool | m_forceRaster2NoDataValue |
Use noDataValue as the input raster 2 no-data value (The original rasters no-data values will be ignored) More... | |
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). More... | |
std::auto_ptr< te::rst::Interpolator > | m_interp1Ptr |
Raster 1 interpolator instance pointer. More... | |
std::auto_ptr< te::rst::Interpolator > | m_interp2Ptr |
Raster 2 interpolator instance pointer. More... | |
te::rst::Interpolator::Method | m_interpMethod1 |
The interpolation method to use when reading raster 1 data. More... | |
te::rst::Interpolator::Method | m_interpMethod2 |
The interpolation method to use when reading raster 2 data. More... | |
std::auto_ptr< te::gm::Geometry > | m_intersectionPtr |
The Intersection geometry ( raster 1 indexed coods). More... | |
boost::ptr_vector< te::rst::TileIndexer > | m_intersectionTileIndexers |
The Intersection geometry tile indexers( raster 1 indexed coods), one indexer for each intersection polygon. More... | |
unsigned int | m_noBlendMethodImp_BandIdx |
std::complex< double > | m_noBlendMethodImp_cValue |
double | m_noBlendMethodImp_Point1XProj1 |
double | m_noBlendMethodImp_Point1XProj2 |
double | m_noBlendMethodImp_Point1YProj1 |
double | m_noBlendMethodImp_Point1YProj2 |
double | m_noBlendMethodImp_Point2Col |
double | m_noBlendMethodImp_Point2Line |
double | m_noBlendMethodImp_Value |
double | m_outputNoDataValue |
The output raster no-data value. More... | |
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). More... | |
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). More... | |
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). More... | |
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). More... | |
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). More... | |
std::size_t | m_r1IntersectionSegmentsPointsSize |
Size of m_r1IntersectionSegmentsPoints;. More... | |
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. More... | |
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). More... | |
std::size_t | m_r2IntersectionSegmentsPointsSize |
Size of m_r2IntersectionSegmentsPoints;. More... | |
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. More... | |
std::vector< unsigned int > | m_raster1Bands |
Input raster 1 band indexes to use. More... | |
std::vector< double > | m_raster1NoDataValues |
Raster 1 no-data values (on value per band). More... | |
te::rst::Raster * | m_raster1Ptr |
Input raster 1. More... | |
std::vector< unsigned int > | m_raster2Bands |
Input raster 2 band indexes to use. More... | |
std::vector< double > | m_raster2NoDataValues |
Raster 2 no-data values (on value per band). More... | |
te::rst::Raster const * | m_raster2Ptr |
Input raster 2. More... | |
te::gm::Point | m_sumMethodImp_auxPoint |
unsigned int | m_sumMethodImp_BandIdx |
std::complex< double > | m_sumMethodImp_cValue1 |
std::complex< double > | m_sumMethodImp_cValue2 |
unsigned int | m_sumMethodImp_IntersectionTileIndexersIdx |
double | m_sumMethodImp_Point2Col |
double | m_sumMethodImp_Point2Line |
bool | m_sumMethodImp_PointInsideIntersection |
unsigned int | m_threadsNumber |
The number of threads to use (0:automatic , 1:disabled, any other integer dictates the number of threads).. More... | |
Blended pixel value calculation for two overlaped rasters.
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.
|
protected |
Type definition for the a bleding function pointer.
line | Raster 1 Line. |
col | Raster 1 Column. |
values | A pointer to a pre-allocated vector where the blended values will be stored. |
te::rp::Blender::Blender | ( | ) |
Default constructor.
te::rp::Blender::~Blender | ( | ) |
Default destructor.
bool te::rp::Blender::blendIntoRaster1 | ( | ) |
Execute blending of the given input rasters and write the result into raster1.
|
staticprotected |
Thread entry for the method blendIntoRaster1.
|
protected |
Clear all internal allocated resources.
|
protected |
Implementation for EuclideanDistanceMethod.
line | Raster 1 Line. |
col | Raster 1 Column. |
values | A pointer to a pre-allocated vector where the blended values will be stored. |
|
inline |
Blend a pixel value using the current parameters.
line | Line (raster 1 reference). |
col | Column (raster 1 reference). |
values | A pointer to a pre-allocated vector where the blended values will be stored. |
Definition at line 131 of file Blender.h.
References TERP_DEBUG_TRUE_OR_THROW.
|
protected |
Extract segments from the given geometry.
geometryPtr | Input geometry. |
segments | Found segments (appended here). |
|
protected |
Creater polygon tile indexers from the given geometry (only if it is a polygon or a collection of polygons).
geometryPtr | Input geometry. |
tileIndexers | Created indexers (appended here). |
bool te::rp::Blender::initialize | ( | te::rst::Raster & | raster1, |
const std::vector< unsigned int > & | raster1Bands, | ||
const te::rst::Raster & | raster2, | ||
const std::vector< unsigned int > & | raster2Bands, | ||
const BlendMethod & | blendMethod, | ||
const te::rst::Interpolator::Method & | interpMethod1, | ||
const te::rst::Interpolator::Method & | interpMethod2, | ||
const double & | noDataValue, | ||
const bool | forceRaster1NoDataValue, | ||
const bool | forceRaster2NoDataValue, | ||
const std::vector< double > & | pixelOffsets1, | ||
const std::vector< double > & | pixelScales1, | ||
const std::vector< double > & | pixelOffsets2, | ||
const std::vector< double > & | pixelScales2, | ||
te::gm::MultiPolygon const *const | r1ValidDataDelimiterPtr, | ||
te::gm::MultiPolygon const *const | r2ValidDataDelimiterPtr, | ||
const te::gm::GeometricTransformation & | geomTransformation, | ||
const unsigned int | threadsNumber, | ||
const bool | enableProgressInterface | ||
) |
Inititate the blender instance.
raster1 | Input raster 1. |
raster1Bands | Input raster 1 band indexes to use. |
raster2 | Input raster 2. |
raster2Bands | Input raster 2 band indexes to use (this vector has the same size as raster1Bands). |
blendMethod | The blend method to apply. |
interpMethod1 | The interpolation method to use when reading raster 1 data. |
interpMethod2 | The interpolation method to use when reading raster 2 data. |
noDataValue | The value returned where there is no pixel data bo blend. |
forceRaster1NoDataValue | Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored) |
forceRaster2NoDataValue | Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored) |
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). |
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). |
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). |
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). |
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. |
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. |
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). |
threadsNumber | Enable/disable the use of threads when applicable (0:automatic , 1:disabled, any other integer dictates the number of threads). |
enableProgressInterface | Enable/disable the use of a progress interface when applicable. |
|
protected |
Reset the instance to its initial default state.
|
protected |
Implementation for NoBlendMethod.
line | Raster 1 Line. |
col | Raster 1 Column. |
values | A pointer to a pre-allocated vector where the blended values will be stored. |
|
protected |
Set the value of m_blendFuncPtr following the given blend method.
|
protected |
Implementation for SumMethod.
line | Raster 1 Line. |
col | Raster 1 Column. |
values | A pointer to a pre-allocated vector where the blended values will be stored. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |