te::rp::ComposerRuleValidPixel Class Reference

A basic composer rule capable of choosing the valid pixels (all bands with no no-data values). More...

#include <ComposerRuleValidPixel.h>

Inheritance diagram for te::rp::ComposerRuleValidPixel:
te::rp::ComposerRule

Public Member Functions

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

Protected Member Functions

ComposerRuleclone () const
 Create a clone of this instance. More...
 
void getComposedValues (const double &line, const double &col, double *const composedValuesPtr) const
 Compose a pixel value using the current parameters. More...
 
bool initialize (const te::rst::Raster &raster1, const std::vector< unsigned int > &raster1Bands, const te::rst::Raster &raster2, const std::vector< unsigned int > &raster2Bands, te::rst::Raster &raster3, const std::vector< unsigned int > &raster3Bands, 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)
 Inititate the instance. More...
 
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...
 
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 composed 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 composed 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 composed 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 composed value calcule (one element for each used raster channel/band). 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...
 
std::vector< unsigned int > m_raster3Bands
 Input raster 3 band indexes to use. More...
 
te::rst::Rasterm_raster3Ptr
 Input raster 3. More...
 

Private Member Functions

void clear ()
 
 ComposerRuleValidPixel (const ComposerRuleValidPixel &other)
 
void initState ()
 
const ComposerRuleValidPixeloperator= (const ComposerRuleValidPixel &other)
 

Private Attributes

te::srs::Converter m_converter1
 
te::srs::Converter m_converter2
 
bool m_getComposedValues_pixelIsValid
 
std::complex< double > m_getComposedValues_PixelValue
 
double m_getComposedValues_raster3X
 
double m_getComposedValues_raster3Y
 
std::size_t m_getComposedValues_rasterBandsIdx
 
double m_getComposedValues_rasterCol
 
double m_getComposedValues_rasterRow
 
double m_getComposedValues_rasterX
 
double m_getComposedValues_rasterY
 
std::unique_ptr< te::rst::Interpolatorm_interpolator1Ptr
 
std::unique_ptr< te::rst::Interpolatorm_interpolator2Ptr
 
std::vector< std::complex< double > > m_noDataValues1
 
std::vector< std::complex< double > > m_noDataValues2
 
std::size_t m_raster1BandsSize
 

Detailed Description

A basic composer rule capable of choosing the valid pixels (all bands with no no-data values).

composer rule capable of choosing the valid pixels (all bands with no no-data values).

Definition at line 38 of file ComposerRuleValidPixel.h.

Constructor & Destructor Documentation

◆ ComposerRuleValidPixel() [1/2]

te::rp::ComposerRuleValidPixel::ComposerRuleValidPixel ( )

◆ ~ComposerRuleValidPixel()

te::rp::ComposerRuleValidPixel::~ComposerRuleValidPixel ( )

◆ ComposerRuleValidPixel() [2/2]

te::rp::ComposerRuleValidPixel::ComposerRuleValidPixel ( const ComposerRuleValidPixel other)
private

Member Function Documentation

◆ clear()

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

◆ clone()

ComposerRule* te::rp::ComposerRuleValidPixel::clone ( ) const
protectedvirtual

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.

Implements te::rp::ComposerRule.

◆ getComposedValues()

void te::rp::ComposerRuleValidPixel::getComposedValues ( const double &  line,
const double &  col,
double *const  composedValuesPtr 
) const
protectedvirtual

Compose a pixel value using the current parameters.

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

Implements te::rp::ComposerRule.

◆ getErrorMessage()

const std::string& te::rp::ComposerRule::getErrorMessage ( ) const
inherited

Return the current error message if there is any.

Returns
Return the current error message if there is any.

◆ initialize()

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

Inititate the instance.

Parameters
raster1Raster 1.
raster1BandsRaster 1 band indexes to use.
raster2Raster 2.
raster2BandsRaster 2 band indexes to use (this vector has the same size as raster1Bands).
raster3Raster 3.
raster3BandsRaster 3 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.
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 composed value calcule (one element for each used raster channel/band).
pixelScales1The values scale to be applied to raster 1 pixel values before the composed value calcule (one element for each used raster channel/band).
pixelOffsets2The values offset to be applied to raster 2 pixel values before the composed value calcule (one element for each used raster channel/band).
pixelScales2The values scale to be applied to raster 2 pixel values before the composed value calcule (one element for each used raster channel/band).
Returns
true if ok, false on errors
Note
Aboute scale and offset parametrs: outValue = ( inputValue * scale ) + offset

Reimplemented from te::rp::ComposerRule.

◆ initState()

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

◆ operator=()

const ComposerRuleValidPixel& te::rp::ComposerRuleValidPixel::operator= ( const ComposerRuleValidPixel other)
private

◆ setErrorMessage()

void te::rp::ComposerRule::setErrorMessage ( const std::string &  newErrorMessage)
protectedinherited

Set the current error message.

Parameters
newErrorMessageNew error message;

Member Data Documentation

◆ m_converter1

te::srs::Converter te::rp::ComposerRuleValidPixel::m_converter1
private

Definition at line 77 of file ComposerRuleValidPixel.h.

◆ m_converter2

te::srs::Converter te::rp::ComposerRuleValidPixel::m_converter2
private

Definition at line 79 of file ComposerRuleValidPixel.h.

◆ m_errorMessage

std::string te::rp::ComposerRule::m_errorMessage
protectedinherited

Current error message.

Definition at line 75 of file ComposerRule.h.

◆ m_forceRaster1NoDataValue

bool te::rp::ComposerRule::m_forceRaster1NoDataValue
protectedinherited

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

Definition at line 60 of file ComposerRule.h.

◆ m_forceRaster2NoDataValue

bool te::rp::ComposerRule::m_forceRaster2NoDataValue
protectedinherited

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

Definition at line 61 of file ComposerRule.h.

◆ m_getComposedValues_pixelIsValid

bool te::rp::ComposerRuleValidPixel::m_getComposedValues_pixelIsValid
mutableprivate

Definition at line 90 of file ComposerRuleValidPixel.h.

◆ m_getComposedValues_PixelValue

std::complex< double > te::rp::ComposerRuleValidPixel::m_getComposedValues_PixelValue
mutableprivate

Definition at line 92 of file ComposerRuleValidPixel.h.

◆ m_getComposedValues_raster3X

double te::rp::ComposerRuleValidPixel::m_getComposedValues_raster3X
mutableprivate

Definition at line 93 of file ComposerRuleValidPixel.h.

◆ m_getComposedValues_raster3Y

double te::rp::ComposerRuleValidPixel::m_getComposedValues_raster3Y
mutableprivate

Definition at line 94 of file ComposerRuleValidPixel.h.

◆ m_getComposedValues_rasterBandsIdx

std::size_t te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterBandsIdx
mutableprivate

Definition at line 91 of file ComposerRuleValidPixel.h.

◆ m_getComposedValues_rasterCol

double te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterCol
mutableprivate

Definition at line 98 of file ComposerRuleValidPixel.h.

◆ m_getComposedValues_rasterRow

double te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterRow
mutableprivate

Definition at line 97 of file ComposerRuleValidPixel.h.

◆ m_getComposedValues_rasterX

double te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterX
mutableprivate

Definition at line 95 of file ComposerRuleValidPixel.h.

◆ m_getComposedValues_rasterY

double te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterY
mutableprivate

Definition at line 96 of file ComposerRuleValidPixel.h.

◆ m_interpMethod1

te::rst::Interpolator::Method te::rp::ComposerRule::m_interpMethod1
protectedinherited

The interpolation method to use when reading raster 1 data.

Definition at line 65 of file ComposerRule.h.

◆ m_interpMethod2

te::rst::Interpolator::Method te::rp::ComposerRule::m_interpMethod2
protectedinherited

The interpolation method to use when reading raster 2 data.

Definition at line 66 of file ComposerRule.h.

◆ m_interpolator1Ptr

std::unique_ptr< te::rst::Interpolator > te::rp::ComposerRuleValidPixel::m_interpolator1Ptr
private

Definition at line 81 of file ComposerRuleValidPixel.h.

◆ m_interpolator2Ptr

std::unique_ptr< te::rst::Interpolator > te::rp::ComposerRuleValidPixel::m_interpolator2Ptr
private

Definition at line 83 of file ComposerRuleValidPixel.h.

◆ m_noDataValues1

std::vector< std::complex< double > > te::rp::ComposerRuleValidPixel::m_noDataValues1
private

Definition at line 85 of file ComposerRuleValidPixel.h.

◆ m_noDataValues2

std::vector< std::complex< double > > te::rp::ComposerRuleValidPixel::m_noDataValues2
private

Definition at line 87 of file ComposerRuleValidPixel.h.

◆ m_outputNoDataValue

double te::rp::ComposerRule::m_outputNoDataValue
protectedinherited

The output raster no-data value.

Definition at line 67 of file ComposerRule.h.

◆ m_pixelOffsets1

std::vector< double > te::rp::ComposerRule::m_pixelOffsets1
protectedinherited

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

Definition at line 71 of file ComposerRule.h.

◆ m_pixelOffsets2

std::vector< double > te::rp::ComposerRule::m_pixelOffsets2
protectedinherited

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

Definition at line 73 of file ComposerRule.h.

◆ m_pixelScales1

std::vector< double > te::rp::ComposerRule::m_pixelScales1
protectedinherited

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

Definition at line 72 of file ComposerRule.h.

◆ m_pixelScales2

std::vector< double > te::rp::ComposerRule::m_pixelScales2
protectedinherited

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

Definition at line 74 of file ComposerRule.h.

◆ m_raster1Bands

std::vector< unsigned int > te::rp::ComposerRule::m_raster1Bands
protectedinherited

Input raster 1 band indexes to use.

Definition at line 68 of file ComposerRule.h.

◆ m_raster1BandsSize

std::size_t te::rp::ComposerRuleValidPixel::m_raster1BandsSize
private

Definition at line 75 of file ComposerRuleValidPixel.h.

◆ m_raster1Ptr

te::rst::Raster const* te::rp::ComposerRule::m_raster1Ptr
protectedinherited

Input raster 1.

Definition at line 62 of file ComposerRule.h.

◆ m_raster2Bands

std::vector< unsigned int > te::rp::ComposerRule::m_raster2Bands
protectedinherited

Input raster 2 band indexes to use.

Definition at line 69 of file ComposerRule.h.

◆ m_raster2Ptr

te::rst::Raster const* te::rp::ComposerRule::m_raster2Ptr
protectedinherited

Input raster 2.

Definition at line 63 of file ComposerRule.h.

◆ m_raster3Bands

std::vector< unsigned int > te::rp::ComposerRule::m_raster3Bands
protectedinherited

Input raster 3 band indexes to use.

Definition at line 70 of file ComposerRule.h.

◆ m_raster3Ptr

te::rst::Raster* te::rp::ComposerRule::m_raster3Ptr
protectedinherited

Input raster 3.

Definition at line 64 of file ComposerRule.h.


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