A Raster Transform is a class that defines functions to transform a styled raster. More...
#include <RasterTransform.h>
Classes | |
class | BandBufferInfo |
struct | TransformBandInfo |
Public Member Functions | |
te::color::RGBAColor | apply (double icol, double ilin) |
void | apply (double icol, double ilin, double ocol, double olin) |
void | clearRGBMap () |
short | getBChannelMapping (RGBChannels channel) |
CategorizedMap & | getCategorizedMap () |
ChannelDomain | getChannelDomain () const |
Return the used channels domain. More... | |
std::vector< double > | getGain () const |
Gets the gain. More... | |
double | getGammaB () |
Gets the constrast value for blue band. More... | |
double | getGammaG () |
Gets the constrast value for green band. More... | |
double | getGammaM () |
Gets the constrast value for gray band. More... | |
double | getGammaR () |
Gets the constrast value for red band. More... | |
te::rst::Raster * | getInputRaster () |
Gets the input raster. More... | |
InterpolatedMap & | getInterpolatedMap () |
std::vector< double > | getOffset () |
Gets the offset. More... | |
te::rst::Raster * | getOutputRaster () |
Gets the output raster. More... | |
RecodedMap & | getRecodedMap () |
std::map< RGBChannels, short > | getRGBMap () |
RasterTransfFunctions | getTransfFunction () |
double | getTransparency () |
Gets the transparency. More... | |
RasterTransform (te::rst::Raster *input, te::rst::Raster *output) | |
Constructor. More... | |
void | setBChannelMapping (short bIn, RGBChannels bOut) |
void | setCategorizedMap (CategorizedMap map) |
void | setChannelDomain (const ChannelDomain domain) |
Set the used channels domain. More... | |
void | setContrastGainsAndOffsets (const std::vector< double > &contrastGains, const std::vector< double > &contrastOffsets1, const std::vector< double > &contrastOffsets2) |
Set gain and offset parameters to be used by the CONTRAST_TRANSF method. More... | |
void | setContrastType (const ContrastType &newType) |
Set the current contrast type. More... | |
void | setGain (double value, int band) |
Sets the gain. More... | |
void | setGammaB (double value) |
Sets the constrast value for blue band. More... | |
void | setGammaG (double value) |
Sets the constrast value for green band. More... | |
void | setGammaM (double value) |
Sets the constrast value for gray band. More... | |
void | setGammaR (double value) |
Sets the constrast value for red band. More... | |
void | setInputRasterResampleSize (int inputX0, int inputY0, int inputWidth, int inputHeight, int outWidth, int outHeight) |
Set the input/output window that will be transformed. This method enables cache strategy. More... | |
void | setInterpolatedMap (InterpolatedMap map) |
void | setLinearTransfParameters (double vmin, double vmax, double rmin, double rmax) |
Set parameters of linear transformation. More... | |
void | setLinearTransfParameters (double vmin, double vmax, double rmin, double rmax, int band) |
Set parameters of linear transformation for each band. More... | |
void | setOffset (double value, int band) |
Sets the offset 1. More... | |
void | setRecodedMap (RecodedMap map) |
void | setRGBAFunction (RasterTransform::RGBAFunction transfFuncPtr) |
void | setRGBMap (std::map< RGBChannels, short > &rgbMap) |
Sets the rgb map values. More... | |
void | setTransfFunction (RasterTransfFunctions func) |
void | setTransfFunction (RasterTransform::TransformFunction transfFuncPtr) |
void | setTransfParameters (double rmin, double rmax, double gain, double offset1, double offset2, int band) |
Set parameters of a non linear transformation for each band. More... | |
void | setTransparency (double value) |
Sets the transparency. More... | |
~RasterTransform () | |
Destructor. More... | |
Protected Types | |
typedef void(RasterTransform::* | ContrastTransformFunction) (const unsigned int &, const double &, double &) const |
Type definition for the internal contrast transform function. More... | |
Protected Member Functions | |
void | applyLinearContrast (const unsigned int &bandIdx, const double &inputValue, double &outputValue) const |
void | applyLogContrast (const unsigned int &bandIdx, const double &inputValue, double &outputValue) const |
void | applySquareContrast (const unsigned int &bandIdx, const double &inputValue, double &outputValue) const |
void | applySquareRootContrast (const unsigned int &bandIdx, const double &inputValue, double &outputValue) const |
double | checkAlphaValue (double icol, double ilin) |
Function used to check the alpha value. More... | |
bool | checkNoValue (double &value, int band) const |
Function used to check if value is or not a valid value. More... | |
void | fixValue (double &value, short &band) const |
te::color::RGBAColor | getBlue2ThreeBand (double icol, double ilin) |
te::color::RGBAColor | getCategorize (double icol, double ilin) |
te::color::RGBAColor | getCategorizedColor (double value) |
te::color::RGBAColor | getExtractRGB (double icol, double ilin) |
te::color::RGBAColor | getExtractRGBA (double icol, double ilin) |
te::color::RGBAColor | getGreen2ThreeBand (double icol, double ilin) |
void | getImaginaryValueChannelDomainGetFunction (unsigned int c, unsigned int r, double &value, std::size_t b) |
te::color::RGBAColor | getInterpolate (double icol, double ilin) |
te::color::RGBAColor | getInterpolatedColor (double value) |
te::color::RGBAColor | getMono2ThreeBand (double icol, double ilin) |
void | getRealValueChannelDomainGetFunction (unsigned int c, unsigned int r, double &value, std::size_t b) |
te::color::RGBAColor | getRecode (double icol, double ilin) |
te::color::RGBAColor | getRecodedColor (double value) |
te::color::RGBAColor | getRed2ThreeBand (double icol, double ilin) |
void | getSQRTChannelDomainGetFunction (unsigned int c, unsigned int r, double &value, std::size_t b) |
void | setBand2Band (double icol, double ilin, double ocol, double olin) |
void | setBlue2ThreeBand (double icol, double ilin, double ocol, double olin) |
void | setCategorize (double icol, double ilin, double ocol, double olin) |
void | setContrastFuncPtr (const RasterTransform::ContrastType contrastType) |
Configures the contrast function pointer. More... | |
void | setExtractRGB (double icol, double ilin, double ocol, double olin) |
void | setExtractRGBA (double icol, double ilin, double ocol, double olin) |
void | setGreen2ThreeBand (double icol, double ilin, double ocol, double olin) |
void | setInterpolate (double icol, double ilin, double ocol, double olin) |
void | setMono2ThreeBand (double icol, double ilin, double ocol, double olin) |
void | setRecode (double icol, double ilin, double ocol, double olin) |
void | setRed2ThreeBand (double icol, double ilin, double ocol, double olin) |
Private Attributes | |
short | m_alphaBand |
Value for the alpha band. More... | |
BandBufferInfo ** | m_arrayBuffer |
Array of band buffer info from input data. More... | |
short | m_blueBand |
Value for the blue band. More... | |
CategorizedMap | m_categorizeMap |
Attribute to define the categorized transformation. More... | |
ChannelDomainGetFunction | m_channelDomainGetFuncPtr |
Function used to get raster data from the selected domain (real/imaginary). More... | |
ContrastTransformFunction | m_contrastTransfFuncPtr |
Function used in contrast transformation operation. More... | |
ChannelDomain | m_currentChannelDomain |
Current channel domain. More... | |
ContrastType | m_currentContrastType |
Current contrast type. More... | |
short | m_greenBand |
Value for the green band. More... | |
std::size_t | m_inputNBands |
Number of bands from input raster. More... | |
InterpolatedMap | m_interpolateMap |
Attribute to define the interpolated transformation. More... | |
short | m_monoBand |
Value for the gray band. More... | |
te::rst::Raster * | m_rasterIn |
Pointer to a input raster. More... | |
te::rst::Raster * | m_rasterOut |
Pointer to a output raster. More... | |
RecodedMap | m_recodeMap |
Attribute to define the recoded transformation. More... | |
short | m_redBand |
Value for the red band. More... | |
RGBAFunction | m_RGBAFuncPtr |
Function used in transformation operation. More... | |
TransformFunction | m_transfFuncPtr |
Function used in transformation operation. More... | |
TransformBandInfo ** | m_transformBandInfo |
Array of band transformation information. More... | |
double | m_transp |
Global transparency value for transformation. More... | |
bool | m_useBufferCache |
Flag used to indicate if a buffer from input image will be used. More... | |
A Raster Transform is a class that defines functions to transform a styled raster.
Definition at line 65 of file RasterTransform.h.
typedef std::map<RasterThreshold, te::color::RGBAColor> te::map::RasterTransform::CategorizedMap |
Definition at line 75 of file RasterTransform.h.
typedef void(RasterTransform::* te::map::RasterTransform::ChannelDomainGetFunction) (unsigned int c, unsigned int r, double &value, std::size_t band) |
Definition at line 71 of file RasterTransform.h.
|
protected |
Type definition for the internal contrast transform function.
Definition at line 316 of file RasterTransform.h.
typedef std::map<RasterThreshold, te::color::ColorBar> te::map::RasterTransform::InterpolatedMap |
Definition at line 76 of file RasterTransform.h.
typedef std::pair<double, double> te::map::RasterTransform::RasterThreshold |
Definition at line 73 of file RasterTransform.h.
typedef std::map<int, te::color::RGBAColor> te::map::RasterTransform::RecodedMap |
Definition at line 77 of file RasterTransform.h.
typedef te::color::RGBAColor(RasterTransform::* te::map::RasterTransform::RGBAFunction) (double, double) |
Definition at line 70 of file RasterTransform.h.
typedef void(RasterTransform::* te::map::RasterTransform::TransformFunction) (double, double, double, double) |
Definition at line 69 of file RasterTransform.h.
Enumerator | |
---|---|
REAL_CHANNEL_DOMAIN | Use real numbers domain. |
IMAGINARY_CHANNEL_DOMAIN | Use imaginary numbers domain. |
SQRT_CHANNEL_DOMAIN | Use the square root of the sum of squared real and imaginary values. |
Definition at line 81 of file RasterTransform.h.
Definition at line 116 of file RasterTransform.h.
Definition at line 99 of file RasterTransform.h.
The channels of a display.
Enumerator | |
---|---|
RED_CHANNEL | |
GREEN_CHANNEL | |
BLUE_CHANNEL | |
ALPHA_CHANNEL | |
MONO_CHANNEL |
Definition at line 89 of file RasterTransform.h.
te::map::RasterTransform::RasterTransform | ( | te::rst::Raster * | input, |
te::rst::Raster * | output | ||
) |
Constructor.
input | |
output |
te::map::RasterTransform::~RasterTransform | ( | ) |
Destructor.
|
inline |
Definition at line 286 of file RasterTransform.h.
|
inline |
Applies the selected transformation method
Definition at line 284 of file RasterTransform.h.
|
inlineprotected |
This transformation aplies a linear contrast
Definition at line 503 of file RasterTransform.h.
|
inlineprotected |
This transformation aplies a log contrast
Definition at line 525 of file RasterTransform.h.
|
inlineprotected |
This transformation aplies a square contrast
Definition at line 511 of file RasterTransform.h.
|
inlineprotected |
This transformation aplies a square root contrast
Definition at line 518 of file RasterTransform.h.
|
protected |
Function used to check the alpha value.
|
inlineprotected |
Function used to check if value is or not a valid value.
Definition at line 543 of file RasterTransform.h.
void te::map::RasterTransform::clearRGBMap | ( | ) |
Clears current mapping from bands to channel
|
inlineprotected |
Function used to adjust the value in raster range
Definition at line 533 of file RasterTransform.h.
short te::map::RasterTransform::getBChannelMapping | ( | RGBChannels | channel | ) |
|
protected |
This transformation repeats the value of the first band in input three bands of the output
|
protected |
This transformation get the value of the selected band in input and get the categorized value
|
protected |
Function used to get the categorized color given a pixel value
|
inline |
Gets the categorize map information
Definition at line 209 of file RasterTransform.h.
ChannelDomain te::map::RasterTransform::getChannelDomain | ( | ) | const |
Return the used channels domain.
|
protected |
This transformation is used to define a particular mapping from input bands to RGB channels
|
protected |
This transformation is used to define a particular mapping from input bands to RGBA channels
std::vector< double > te::map::RasterTransform::getGain | ( | ) | const |
Gets the gain.
double te::map::RasterTransform::getGammaB | ( | ) |
Gets the constrast value for blue band.
double te::map::RasterTransform::getGammaG | ( | ) |
Gets the constrast value for green band.
double te::map::RasterTransform::getGammaM | ( | ) |
Gets the constrast value for gray band.
double te::map::RasterTransform::getGammaR | ( | ) |
Gets the constrast value for red band.
|
protected |
This transformation repeats the value of the first band in input three bands of the output
|
inlineprotected |
Definition at line 570 of file RasterTransform.h.
|
inline |
Gets the input raster.
Definition at line 138 of file RasterTransform.h.
|
protected |
This transformation get the value of the selected band in input and get the interpolated value
|
protected |
Function used to get the interpolated color given a pixel value
|
inline |
Gets the categorize map information
Definition at line 215 of file RasterTransform.h.
|
protected |
This transformation repeats the value of the first band in input three bands of the output
std::vector< double > te::map::RasterTransform::getOffset | ( | ) |
Gets the offset.
|
inline |
Gets the output raster.
Definition at line 141 of file RasterTransform.h.
|
inlineprotected |
Definition at line 564 of file RasterTransform.h.
|
protected |
This transformation get the value of the selected band in input and get the recoded value
|
protected |
Function used to get the recoded color given a pixel value
|
inline |
Gets the recode map information
Definition at line 221 of file RasterTransform.h.
|
protected |
This transformation repeats the value of the first band in input three bands of the output
std::map< RGBChannels, short > te::map::RasterTransform::getRGBMap | ( | ) |
Returns the mapping from a particular input band to a particular output channel
|
inlineprotected |
Definition at line 578 of file RasterTransform.h.
RasterTransfFunctions te::map::RasterTransform::getTransfFunction | ( | ) |
Returns the identifier of the transformation function currently set
|
inline |
Gets the transparency.
Definition at line 147 of file RasterTransform.h.
|
protected |
This transformation repeats the value of the n band in input to b band in output
void te::map::RasterTransform::setBChannelMapping | ( | short | bIn, |
RGBChannels | bOut | ||
) |
Sets the mapping from a particular input band to a particular output channel
|
protected |
This transformation repeats the value of the first band in input three bands of the output
|
protected |
This transformation get the value of the selected band in input and set the categorized value in output bands of the output
|
inline |
Sets the categorize map information
Definition at line 206 of file RasterTransform.h.
void te::map::RasterTransform::setChannelDomain | ( | const ChannelDomain | domain | ) |
Set the used channels domain.
domain | The new domain. |
|
protected |
Configures the contrast function pointer.
contrastType | Contrast type.. |
void te::map::RasterTransform::setContrastGainsAndOffsets | ( | const std::vector< double > & | contrastGains, |
const std::vector< double > & | contrastOffsets1, | ||
const std::vector< double > & | contrastOffsets2 | ||
) |
Set gain and offset parameters to be used by the CONTRAST_TRANSF method.
contrastGains | A vector of gains for each raster band. |
contrastOffsets1 | A vector of offsets1 for each raster band. |
contrastOffsets2 | A vector of offsets2 for each raster band. |
void te::map::RasterTransform::setContrastType | ( | const ContrastType & | newType | ) |
Set the current contrast type.
newType | New contrast type. |
|
protected |
This transformation is used to define a particular mapping from input bands to RGB channels
|
protected |
This transformation is used to define a particular mapping from input bands to RGBA channels
void te::map::RasterTransform::setGain | ( | double | value, |
int | band | ||
) |
Sets the gain.
void te::map::RasterTransform::setGammaB | ( | double | value | ) |
Sets the constrast value for blue band.
void te::map::RasterTransform::setGammaG | ( | double | value | ) |
Sets the constrast value for green band.
void te::map::RasterTransform::setGammaM | ( | double | value | ) |
Sets the constrast value for gray band.
void te::map::RasterTransform::setGammaR | ( | double | value | ) |
Sets the constrast value for red band.
|
protected |
This transformation repeats the value of the first band in input three bands of the output
void te::map::RasterTransform::setInputRasterResampleSize | ( | int | inputX0, |
int | inputY0, | ||
int | inputWidth, | ||
int | inputHeight, | ||
int | outWidth, | ||
int | outHeight | ||
) |
Set the input/output window that will be transformed. This method enables cache strategy.
inputX0 | Start point (upper left X) from input image |
inputY0 | Start point (upper left Y) from input image |
inputWidth | Width of input image that will be transformed |
inputHeight | Height of input image that will be transformed |
outWidth | Width of output image that will receive the transformed input image (canvas size) |
outHeight | Height of output image that will receive the transformed input image (canvas size) |
\NOTE: This method was defined to increase draw speed.
|
protected |
This transformation get the value of the selected band in input and set the interpolated value in output bands of the output
|
inline |
Sets the interpolate map information
Definition at line 212 of file RasterTransform.h.
void te::map::RasterTransform::setLinearTransfParameters | ( | double | vmin, |
double | vmax, | ||
double | rmin, | ||
double | rmax | ||
) |
Set parameters of linear transformation.
vmin | smallest input value |
vmax | largest input value |
rmin | smallest value of the output range |
rmax | largest value of the output range |
void te::map::RasterTransform::setLinearTransfParameters | ( | double | vmin, |
double | vmax, | ||
double | rmin, | ||
double | rmax, | ||
int | band | ||
) |
Set parameters of linear transformation for each band.
vmin | smallest input value |
vmax | largest input value |
rmin | smallest value of the output range |
rmax | largest value of the output range |
band | band id |
|
protected |
This transformation repeats the value of the first band in input three bands of the output
void te::map::RasterTransform::setOffset | ( | double | value, |
int | band | ||
) |
Sets the offset 1.
|
protected |
This transformation get the value of the selected band in input and set the recoded value in output bands of the output
|
inline |
Sets the recode map information
Definition at line 218 of file RasterTransform.h.
|
protected |
This transformation repeats the value of the first band in input three bands of the output
|
inline |
Sets the transformation method to be used
Definition at line 281 of file RasterTransform.h.
void te::map::RasterTransform::setRGBMap | ( | std::map< RGBChannels, short > & | rgbMap | ) |
Sets the rgb map values.
void te::map::RasterTransform::setTransfFunction | ( | RasterTransfFunctions | func | ) |
Sets the associated transformation function from an identifier
|
inline |
Sets the transformation method to be used
Definition at line 278 of file RasterTransform.h.
void te::map::RasterTransform::setTransfParameters | ( | double | rmin, |
double | rmax, | ||
double | gain, | ||
double | offset1, | ||
double | offset2, | ||
int | band | ||
) |
Set parameters of a non linear transformation for each band.
rmin | smallest value of the output range |
rmax | largest value of the output range |
gain | value used as gain |
offset1 | value used as offset |
offset2 | value used as offset2 |
band | band id |
|
inline |
Sets the transparency.
Definition at line 144 of file RasterTransform.h.
|
private |
Value for the alpha band.
Definition at line 597 of file RasterTransform.h.
|
private |
Array of band buffer info from input data.
Definition at line 614 of file RasterTransform.h.
|
private |
Value for the blue band.
Definition at line 596 of file RasterTransform.h.
|
private |
Attribute to define the categorized transformation.
Definition at line 609 of file RasterTransform.h.
|
private |
Function used to get raster data from the selected domain (real/imaginary).
Definition at line 603 of file RasterTransform.h.
|
private |
Function used in contrast transformation operation.
Definition at line 604 of file RasterTransform.h.
|
private |
Current channel domain.
Definition at line 602 of file RasterTransform.h.
|
private |
Current contrast type.
Definition at line 601 of file RasterTransform.h.
|
private |
Value for the green band.
Definition at line 595 of file RasterTransform.h.
|
private |
Number of bands from input raster.
Definition at line 591 of file RasterTransform.h.
|
private |
Attribute to define the interpolated transformation.
Definition at line 610 of file RasterTransform.h.
|
private |
Value for the gray band.
Definition at line 593 of file RasterTransform.h.
|
private |
Pointer to a input raster.
Definition at line 588 of file RasterTransform.h.
|
private |
Pointer to a output raster.
Definition at line 589 of file RasterTransform.h.
|
private |
Attribute to define the recoded transformation.
Definition at line 611 of file RasterTransform.h.
|
private |
Value for the red band.
Definition at line 594 of file RasterTransform.h.
|
private |
Function used in transformation operation.
Definition at line 607 of file RasterTransform.h.
|
private |
Function used in transformation operation.
Definition at line 606 of file RasterTransform.h.
|
private |
Array of band transformation information.
Definition at line 616 of file RasterTransform.h.
|
private |
Global transparency value for transformation.
Definition at line 599 of file RasterTransform.h.
|
private |
Flag used to indicate if a buffer from input image will be used.
Definition at line 613 of file RasterTransform.h.