20#ifndef __TERRALIB_RP_INTERNAL_COMPOSER_H
21#define __TERRALIB_RP_INTERNAL_COMPOSER_H
26#include "../raster/Grid.h"
27#include "../raster/Raster.h"
28#include "../raster/Interpolator.h"
29#include "../raster/RasterSynchronizer.h"
30#include "../raster/TileIndexer.h"
31#include "../geometry/Polygon.h"
32#include "../geometry/MultiPolygon.h"
33#include "../geometry/Point.h"
34#include "../geometry/GeometricTransformation.h"
36#include <boost/ptr_container/ptr_vector.hpp>
91 const std::vector< unsigned int >& raster1Bands,
93 const std::vector< unsigned int >& raster2Bands,
95 const std::vector< unsigned int >& raster3Bands,
98 const double& noDataValue,
99 const bool forceRaster1NoDataValue,
100 const bool forceRaster2NoDataValue,
101 const std::vector< double >& pixelOffsets1,
102 const std::vector< double >& pixelScales1,
103 const std::vector< double >& pixelOffsets2,
104 const std::vector< double >& pixelScales2,
105 const unsigned int threadsNumber,
106 const bool enableProgressInterface,
108 const bool enableRasterCache );
120 double*
const values )
123 m_rulePtr->getComposedValues( line, col, values );
#define TERP_DEBUG_TRUE_OR_THROW(value, message)
Checks if value is true and throws an exception if not.
The parameters passed to composeIntoRaster1Thread method.
std::vector< unsigned int > const * m_raster3BandsPtr
Input raster 3 band indexes to use (this vector has the same size as raster1Bands).
std::vector< double > const * m_pixelScales2Ptr
The values scale to be applied to raster 2 pixel values before the composeed value calcule (one eleme...
te::rst::RasterSynchronizer * m_sync1Ptr
Raster 1 syncronizer pointer.
std::vector< double > const * m_pixelScales1Ptr
The values scale to be applied to raster 1 pixel values before the composeed value calcule (one eleme...
std::vector< unsigned int > const * m_raster2BandsPtr
Input raster 2 band indexes to use (this vector has the same size as raster1Bands).
ComposeIntoRaster3ThreadParams(const ComposeIntoRaster3ThreadParams &)
te::rst::Interpolator::Method m_interpMethod2
The interpolation method to use when reading raster 2 data.
bool m_forceRaster1NoDataValue
Use noDataValue as the input rasters no-data value (The original rasters no-data values will be ignor...
std::condition_variable * m_blockProcessedSignalPtr
Signal used to update the main process progress update.
unsigned long int m_maxRasterCachedBlocks
The maximum number of raster cache blocks.
std::vector< double > const * m_pixelOffsets1Ptr
The values offset to be applied to raster 1 pixel values before the composeed value calcule (one elem...
ComposerRule const * m_rulePtr
unsigned int * m_processedBlocksNmbPtr
std::mutex * m_blockProcessedSignalMutexPtr
Mutex used to update the main process progress update.
~ComposeIntoRaster3ThreadParams()
ComposeIntoRaster3ThreadParams()
std::vector< unsigned int > const * m_raster1BandsPtr
Input raster 1 band indexes to use.
std::vector< double > const * m_pixelOffsets2Ptr
The values offset to be applied to raster 2 pixel values before the composeed value calcule (one elem...
unsigned int * m_runningThreadsCounterPtr
a pointer to the running threads counter.
te::rst::RasterSynchronizer * m_sync2Ptr
Raster 2 syncronizer pointer.
bool m_forceRaster2NoDataValue
Use noDataValue as the input rasters no-data value (The original rasters no-data values will be ignor...
bool m_useProgress
If enabled each thread will use its own progress interface, if false only a signal will be emitted on...
double m_noDataValue
The value returned where there is no pixel data bo compose.
te::rst::RasterSynchronizer * m_sync3Ptr
Raster 3 syncronizer pointer.
bool * m_returnValuePtr
A pointer to the threadreturn value.
bool * m_abortValuePtr
A pointer to the abort execution value.
ComposeIntoRaster3ThreadParams & operator=(const ComposeIntoRaster3ThreadParams &)
std::vector< RasterBlockInfo > * m_raster3BlocksInfosPtr
blocks to process.
te::rst::Interpolator::Method m_interpMethod1
The interpolation method to use when reading raster 2 data.
std::mutex * m_mutexPtr
mutex pointer.
Composed pixel value calculation for two overlaped rasters.
te::rst::Interpolator::Method m_interpMethod1
The interpolation method to use when reading raster 1 data.
te::rst::Raster * m_raster3Ptr
Raster 3.
te::rst::Interpolator::Method m_interpMethod2
The interpolation method to use when reading raster 2 data.
void clear()
Clear all internal allocated resources.
const std::string & getErrorMessage() const
Return the current error message if there is any.
std::vector< unsigned int > m_raster2Bands
Input raster 2 band indexes to use.
te::rst::Raster const * m_raster1Ptr
Raster 1.
void initState()
Reset the instance to its initial default state.
bool composeIntoRaster3()
Execute a composition of the given input rasters and write the result into raster 3.
bool m_forceRaster2NoDataValue
Use noDataValue as the input raster 2 no-data value (The original rasters no-data values will be igno...
unsigned int m_threadsNumber
The number of threads to use (0:automatic , 1:disabled, any other integer dictates the number of thre...
std::vector< double > m_pixelScales2
The values scale to be applied to raster 2 pixel values before the composeed value calcule (one eleme...
std::vector< double > m_pixelScales1
The values scale to be applied to raster 1 pixel values before the composeed value calcule (one eleme...
std::string m_errorMessage
Current error message.
std::vector< double > m_pixelOffsets2
The values offset to be applied to raster 2 pixel values before the composeed value calcule (one elem...
bool m_enableRasterCache
enable/disable the use of raster cache.
Composer(const Composer &other)
bool m_enableProgressInterface
Enable progress interface.
void getComposedValues(const double &line, const double &col, double *const values)
Compose a pixel value using the current parameters.
std::vector< unsigned int > m_raster1Bands
Input raster 1 band indexes to use.
std::vector< double > m_pixelOffsets1
The values offset to be applied to raster 1 pixel values before the composeed value calcule (one elem...
void setErrorMessage(const std::string &newErrorMessage)
Set the current error message.
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.
std::vector< unsigned int > m_raster3Bands
Input raster 3 band indexes to use.
Composer & operator=(const Composer &other)
std::unique_ptr< ComposerRule > m_rulePtr
Composer rule pointer.
bool m_forceRaster1NoDataValue
Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be igno...
double m_outputNoDataValue
The output raster no-data value.
te::rst::Raster const * m_raster2Ptr
Raster 2.
static void composeIntoRaster3Thread(ComposeIntoRaster3ThreadParams *paramsPtr)
Thread entry for the method composeIntoRaster1.
An access synchronizer to be used in SynchronizedRaster raster instances.
An abstract class for raster data strucutures.
InterpolationMethod
Allowed interpolation methods.
unsigned int m_rasterRows2ProcessBound
unsigned int m_firstRasterRow2Process
unsigned int m_blkTotalPixelsNumber
unsigned int m_firstRasterCol2Process
unsigned int m_rasterCols2ProcessBound
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Proxy configuration file for TerraView (see terraview_config.h).