Composed pixel value calculation for two overlaped rasters. More...
#include <Composer.h>
Classes | |
class | ComposeIntoRaster3ThreadParams |
The parameters passed to composeIntoRaster1Thread method. More... | |
struct | RasterBlockInfo |
Raster block info. More... | |
Public Member Functions | |
bool | composeIntoRaster3 () |
Execute a composition of the given input rasters and write the result into raster 3. | |
Composer () | |
void | getComposedValues (const double &line, const double &col, double *const values) |
Compose a pixel value using the current parameters. | |
const std::string & | getErrorMessage () const |
Return the current error message if there is any. | |
bool | initialize (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, const unsigned int threadsNumber, const bool enableProgressInterface, ComposerRule const *const rulePtr, const bool enableRasterCache) |
Inititate the composer instance. | |
~Composer () | |
Protected Member Functions | |
void | clear () |
Clear all internal allocated resources. | |
void | initState () |
Reset the instance to its initial default state. | |
void | setErrorMessage (const std::string &newErrorMessage) |
Set the current error message. | |
Static Protected Member Functions | |
static void | composeIntoRaster3Thread (ComposeIntoRaster3ThreadParams *paramsPtr) |
Thread entry for the method composeIntoRaster1. | |
Protected Attributes | |
bool | m_enableProgressInterface |
Enable progress interface. | |
bool | m_enableRasterCache |
enable/disable the use of raster cache. | |
std::string | m_errorMessage |
Current error message. | |
bool | m_forceRaster1NoDataValue |
Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored) | |
bool | m_forceRaster2NoDataValue |
Use noDataValue as the input raster 2 no-data value (The original rasters no-data values will be ignored) | |
te::rst::Interpolator::Method | m_interpMethod1 |
The interpolation method to use when reading raster 1 data. | |
te::rst::Interpolator::Method | m_interpMethod2 |
The interpolation method to use when reading raster 2 data. | |
double | m_outputNoDataValue |
The output raster no-data value. | |
std::vector< double > | m_pixelOffsets1 |
The values offset to be applied to raster 1 pixel values before the composeed value calcule (one element for each used raster channel/band). | |
std::vector< double > | m_pixelOffsets2 |
The values offset to be applied to raster 2 pixel values before the composeed value calcule (one element for each used raster channel/band). | |
std::vector< double > | m_pixelScales1 |
The values scale to be applied to raster 1 pixel values before the composeed value calcule (one element for each used raster channel/band). | |
std::vector< double > | m_pixelScales2 |
The values scale to be applied to raster 2 pixel values before the composeed value calcule (one element for each used raster channel/band). | |
std::vector< unsigned int > | m_raster1Bands |
Input raster 1 band indexes to use. | |
te::rst::Raster const * | m_raster1Ptr |
Raster 1. | |
std::vector< unsigned int > | m_raster2Bands |
Input raster 2 band indexes to use. | |
te::rst::Raster const * | m_raster2Ptr |
Raster 2. | |
std::vector< unsigned int > | m_raster3Bands |
Input raster 3 band indexes to use. | |
te::rst::Raster * | m_raster3Ptr |
Raster 3. | |
std::unique_ptr< ComposerRule > | m_rulePtr |
Composer rule pointer. | |
unsigned int | m_threadsNumber |
The number of threads to use (0:automatic , 1:disabled, any other integer dictates the number of threads).. | |
Private Member Functions | |
Composer (const Composer &other) | |
Composer & | operator= (const Composer &other) |
Composed pixel value calculation for two overlaped rasters.
A rule used by the te::rst::Composer classe.
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.
Definition at line 54 of file Composer.h.
te::rp::Composer::Composer | ( | ) |
Default constructor.
te::rp::Composer::~Composer | ( | ) |
Default destructor.
|
private |
|
protected |
Clear all internal allocated resources.
bool te::rp::Composer::composeIntoRaster3 | ( | ) |
Execute a composition of the given input rasters and write the result into raster 3.
|
staticprotected |
Thread entry for the method composeIntoRaster1.
|
inline |
Compose a pixel value using the current parameters.
line | Line (raster 3 reference). |
col | Column (raster 3 reference). |
values | A pointer to a pre-allocated vector where the composeed values will be stored. |
Definition at line 119 of file Composer.h.
References TERP_DEBUG_TRUE_OR_THROW.
const std::string & te::rp::Composer::getErrorMessage | ( | ) | const |
Return the current error message if there is any.
bool te::rp::Composer::initialize | ( | 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, | ||
const unsigned int | threadsNumber, | ||
const bool | enableProgressInterface, | ||
ComposerRule const *const | rulePtr, | ||
const bool | enableRasterCache | ||
) |
Inititate the composer instance.
raster1 | Raster 1. |
raster1Bands | Raster 1 band indexes to use. |
raster2 | Raster 2. |
raster2Bands | Raster 2 band indexes to use (this vector has the same size as raster1Bands). |
raster3 | Raster 3. |
raster3Bands | Raster 3 band indexes to use (this vector has the same size as raster1Bands). |
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 compose. |
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 composeed value calcule (one element for each used raster channel/band). |
pixelScales1 | The values scale to be applied to raster 1 pixel values before the composeed value calcule (one element for each used raster channel/band). |
pixelOffsets2 | The values offset to be applied to raster 2 pixel values before the composeed value calcule (one element for each used raster channel/band). |
pixelScales2 | The values scale to be applied to raster 2 pixel values before the composeed value calcule (one element for each used raster channel/band). |
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. |
rulePtr | A pointer to a valid composer rule. |
enableRasterCache | Enable/disable the use of raster cache. |
|
protected |
Reset the instance to its initial default state.
|
protected |
Set the current error message.
newErrorMessage | New error message; |
|
protected |
Enable progress interface.
Definition at line 201 of file Composer.h.
|
protected |
enable/disable the use of raster cache.
Definition at line 220 of file Composer.h.
|
protected |
Current error message.
Definition at line 219 of file Composer.h.
|
protected |
Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)
Definition at line 202 of file Composer.h.
|
protected |
Use noDataValue as the input raster 2 no-data value (The original rasters no-data values will be ignored)
Definition at line 203 of file Composer.h.
|
protected |
The interpolation method to use when reading raster 1 data.
Definition at line 208 of file Composer.h.
|
protected |
The interpolation method to use when reading raster 2 data.
Definition at line 209 of file Composer.h.
|
protected |
The output raster no-data value.
Definition at line 210 of file Composer.h.
|
protected |
The values offset to be applied to raster 1 pixel values before the composeed value calcule (one element for each used raster channel/band).
Definition at line 214 of file Composer.h.
|
protected |
The values offset to be applied to raster 2 pixel values before the composeed value calcule (one element for each used raster channel/band).
Definition at line 216 of file Composer.h.
|
protected |
The values scale to be applied to raster 1 pixel values before the composeed value calcule (one element for each used raster channel/band).
Definition at line 215 of file Composer.h.
|
protected |
The values scale to be applied to raster 2 pixel values before the composeed value calcule (one element for each used raster channel/band).
Definition at line 217 of file Composer.h.
|
protected |
Input raster 1 band indexes to use.
Definition at line 211 of file Composer.h.
|
protected |
Raster 1.
Definition at line 205 of file Composer.h.
|
protected |
Input raster 2 band indexes to use.
Definition at line 212 of file Composer.h.
|
protected |
Raster 2.
Definition at line 206 of file Composer.h.
|
protected |
Input raster 3 band indexes to use.
Definition at line 213 of file Composer.h.
|
protected |
Raster 3.
Definition at line 207 of file Composer.h.
|
protected |
Composer rule pointer.
Definition at line 218 of file Composer.h.
|
protected |
The number of threads to use (0:automatic , 1:disabled, any other integer dictates the number of threads)..
Definition at line 204 of file Composer.h.