te::rp::BlenderRule Class Referenceabstract

#include <BlenderRule.h>

Public Member Functions

const std::string & getErrorMessage () const
 Return the current error message if there is any. More...
 
virtual ~BlenderRule ()
 

Protected Member Functions

 BlenderRule ()
 
 BlenderRule (const BlenderRule &other)
 
virtual BlenderRuleclone () const =0
 Create a clone of this instance. More...
 
virtual void getBlendedValues (const double &line1, const double &col1, const double &line2, const double &col2, double *const blendedValuesPtr) const =0
 Blend a pixel value using the current parameters. More...
 
virtual bool initialize (const te::rst::Raster &raster1, const std::vector< unsigned int > &raster1Bands, const te::rst::Raster &raster2, const std::vector< unsigned int > &raster2Bands, 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)
 Inititate the blender instance. More...
 
const BlenderRuleoperator= (const BlenderRule &other)
 
void setErrorMessage (const std::string &newErrorMessage)
 Set the current error message. More...
 

Protected Attributes

std::string m_errorMessage
 Current error message. More...
 
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...
 
std::unique_ptr< te::gm::GeometricTransformationm_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...
 
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...
 
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::unique_ptr< te::gm::MultiPolygonm_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::unique_ptr< te::gm::MultiPolygonm_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...
 
te::rst::Raster const * m_raster1Ptr
 Input raster 1. More...
 
std::vector< unsigned int > m_raster2Bands
 Input raster 2 band indexes to use. More...
 
te::rst::Raster const * m_raster2Ptr
 Input raster 2. More...
 

Private Member Functions

void clear ()
 
void initState ()
 

Friends

class Blender
 

Detailed Description

Definition at line 44 of file BlenderRule.h.

Constructor & Destructor Documentation

◆ ~BlenderRule()

virtual te::rp::BlenderRule::~BlenderRule ( )
virtual

◆ BlenderRule() [1/2]

te::rp::BlenderRule::BlenderRule ( const BlenderRule other)
protected

◆ BlenderRule() [2/2]

te::rp::BlenderRule::BlenderRule ( )
protected

Member Function Documentation

◆ clear()

void te::rp::BlenderRule::clear ( )
private

◆ clone()

virtual BlenderRule* te::rp::BlenderRule::clone ( ) const
protectedpure virtual

Create a clone of this instance.

Returns
A clone of this instance.
Note
The caller of this method must take othe owndershipd of the returned pointer.

◆ getBlendedValues()

virtual void te::rp::BlenderRule::getBlendedValues ( const double &  line1,
const double &  col1,
const double &  line2,
const double &  col2,
double *const  blendedValuesPtr 
) const
protectedpure virtual

Blend a pixel value using the current parameters.

Parameters
line1Line (raster 1 reference).
col1Column (raster 1 reference).
line2Line (raster 2).
col2Column (raster 2).
blendedValuesPtrA pointer to a pre-allocated vector where the blended values will be stored.
Note
The caller of this method must be aware that the returned blended value may be outside the original input rasters valid values range.
Raster 1 values have precedence over raster 2 values (when applicable).

◆ getErrorMessage()

const std::string& te::rp::BlenderRule::getErrorMessage ( ) const

Return the current error message if there is any.

Returns
Return the current error message if there is any.

◆ initialize()

virtual bool te::rp::BlenderRule::initialize ( const te::rst::Raster raster1,
const std::vector< unsigned int > &  raster1Bands,
const te::rst::Raster raster2,
const std::vector< unsigned int > &  raster2Bands,
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 
)
protectedvirtual

Inititate the blender instance.

Parameters
raster1Input raster 1.
raster1BandsInput raster 1 band indexes to use.
raster2Input raster 2.
raster2BandsInput raster 2 band indexes to use (this vector has the same size as raster1Bands).
interpMethod1The interpolation method to use when reading raster 1 data.
interpMethod2The interpolation method to use when reading raster 2 data.
noDataValueThe value returned where there is no pixel data bo blend.
forceRaster1NoDataValueUse noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)
forceRaster2NoDataValueUse noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)
pixelOffsets1The values offset to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
pixelScales1The values scale to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
pixelOffsets2The values offset to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
pixelScales2The values scale to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
r1ValidDataDelimiterPtrA 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.
r2ValidDataDelimiterPtrA 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.
geomTransformationA 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).
Returns
true if ok, false on errors
Note
Aboute scale and offset parametrs: outValue = ( inputValue * scale ) + offset

◆ initState()

void te::rp::BlenderRule::initState ( )
private

◆ operator=()

const BlenderRule& te::rp::BlenderRule::operator= ( const BlenderRule other)
protected

◆ setErrorMessage()

void te::rp::BlenderRule::setErrorMessage ( const std::string &  newErrorMessage)
protected

Set the current error message.

Parameters
newErrorMessageNew error message;

Friends And Related Function Documentation

◆ Blender

friend class Blender
friend

Definition at line 59 of file BlenderRule.h.

Member Data Documentation

◆ m_errorMessage

std::string te::rp::BlenderRule::m_errorMessage
protected

Current error message.

Definition at line 77 of file BlenderRule.h.

◆ m_forceRaster1NoDataValue

bool te::rp::BlenderRule::m_forceRaster1NoDataValue
protected

Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)

Definition at line 61 of file BlenderRule.h.

◆ m_forceRaster2NoDataValue

bool te::rp::BlenderRule::m_forceRaster2NoDataValue
protected

Use noDataValue as the input raster 2 no-data value (The original rasters no-data values will be ignored)

Definition at line 62 of file BlenderRule.h.

◆ m_geomTransformationPtr

std::unique_ptr< te::gm::GeometricTransformation > te::rp::BlenderRule::m_geomTransformationPtr
protected

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).

Definition at line 67 of file BlenderRule.h.

◆ m_interpMethod1

te::rst::Interpolator::Method te::rp::BlenderRule::m_interpMethod1
protected

The interpolation method to use when reading raster 1 data.

Definition at line 68 of file BlenderRule.h.

◆ m_interpMethod2

te::rst::Interpolator::Method te::rp::BlenderRule::m_interpMethod2
protected

The interpolation method to use when reading raster 2 data.

Definition at line 69 of file BlenderRule.h.

◆ m_outputNoDataValue

double te::rp::BlenderRule::m_outputNoDataValue
protected

The output raster no-data value.

Definition at line 70 of file BlenderRule.h.

◆ m_pixelOffsets1

std::vector< double > te::rp::BlenderRule::m_pixelOffsets1
protected

The values offset to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).

Definition at line 73 of file BlenderRule.h.

◆ m_pixelOffsets2

std::vector< double > te::rp::BlenderRule::m_pixelOffsets2
protected

The values offset to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).

Definition at line 75 of file BlenderRule.h.

◆ m_pixelScales1

std::vector< double > te::rp::BlenderRule::m_pixelScales1
protected

The values scale to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).

Definition at line 74 of file BlenderRule.h.

◆ m_pixelScales2

std::vector< double > te::rp::BlenderRule::m_pixelScales2
protected

The values scale to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).

Definition at line 76 of file BlenderRule.h.

◆ m_r1ValidDataDelimiterPtr

std::unique_ptr< te::gm::MultiPolygon > te::rp::BlenderRule::m_r1ValidDataDelimiterPtr
protected

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.

Definition at line 65 of file BlenderRule.h.

◆ m_r2ValidDataDelimiterPtr

std::unique_ptr< te::gm::MultiPolygon > te::rp::BlenderRule::m_r2ValidDataDelimiterPtr
protected

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.

Definition at line 66 of file BlenderRule.h.

◆ m_raster1Bands

std::vector< unsigned int > te::rp::BlenderRule::m_raster1Bands
protected

Input raster 1 band indexes to use.

Definition at line 71 of file BlenderRule.h.

◆ m_raster1Ptr

te::rst::Raster const* te::rp::BlenderRule::m_raster1Ptr
protected

Input raster 1.

Definition at line 63 of file BlenderRule.h.

◆ m_raster2Bands

std::vector< unsigned int > te::rp::BlenderRule::m_raster2Bands
protected

Input raster 2 band indexes to use.

Definition at line 72 of file BlenderRule.h.

◆ m_raster2Ptr

te::rst::Raster const* te::rp::BlenderRule::m_raster2Ptr
protected

Input raster 2.

Definition at line 64 of file BlenderRule.h.


The documentation for this class was generated from the following file: