te::map::RasterTransform Class Reference

A Raster Transform is a class that defines functions to transform a styled raster. More...

#include <RasterTransform.h>

Public Types

typedef std::map< RasterThreshold, te::color::RGBAColorCategorizedMap
 
typedef std::map< RasterThreshold, te::color::ColorBarInterpolatedMap
 
typedef std::pair< double, double > RasterThreshold
 
enum  RasterTransfFunctions {
  NO_TRANSF =0, MONO2THREE_TRANSF =1, EXTRACT2RGB_TRANSF =2, RED2THREE_TRANSF =3,
  GREEN2THREE_TRANSF =4, BLUE2THREE_TRANSF =5, CATEGORIZE_TRANSF =6, INTERPOLATE_TRANSF =7,
  RECODE_TRANSF = 8, BAND2BAND_TRANSF =9, EXTRACT2RGBA_TRANSF
}
 
typedef std::map< int, te::color::RGBAColorRecodedMap
 
typedef te::color::RGBAColor(RasterTransform::* RGBAFunction) (double, double)
 
enum  RGBChannels { RED_CHANNEL =0, GREEN_CHANNEL =1, BLUE_CHANNEL =2, ALPHA_CHANNEL =3 }
 The three channels of a display. More...
 
typedef void(RasterTransform::* TransformFunction) (double, double, double, double)
 

Public Member Functions

void apply (double icol, double ilin, double ocol, double olin)
 
te::color::RGBAColor apply (double icol, double ilin)
 
void clearRGBMap ()
 
CategorizedMapgetCategorizedMap ()
 
double getContrastB ()
 Gets the constrast value for blue band. More...
 
double getContrastG ()
 Gets the constrast value for green band. More...
 
double getContrastM ()
 Gets the constrast value for gray band. More...
 
double getContrastR ()
 Gets the constrast value for red band. More...
 
short getDestBand ()
 
double getGain ()
 Gets the gain. More...
 
te::rst::RastergetInputRaster ()
 Gets the input raster. More...
 
InterpolatedMapgetInterpolatedMap ()
 
double getOffset ()
 Gets the offset. More...
 
te::rst::RastergetOutputRaster ()
 Gets the output raster. More...
 
RecodedMapgetRecodedMap ()
 
std::map< RGBChannels, short > & getRGBMap ()
 
short getSrcBand ()
 
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 setContrastB (double value)
 Sets the constrast value for blue band. More...
 
void setContrastG (double value)
 Sets the constrast value for green band. More...
 
void setContrastM (double value)
 Sets the constrast value for gray band. More...
 
void setContrastR (double value)
 Sets the constrast value for red band. More...
 
void setDestBand (short n)
 
void setGain (double value)
 Sets the gain. More...
 
void setInterpolatedMap (InterpolatedMap map)
 
void setLinearTransfParameters (double vmin, double vmax, double rmin, double rmax)
 Set parameters of linear transformation. More...
 
void setOffset (double value)
 Sets the offset. More...
 
void setRecodedMap (RecodedMap map)
 
void setRGBAFunction (RasterTransform::RGBAFunction transfFuncPtr)
 
void setRGBMap (std::map< RGBChannels, short > &rgbMap)
 Sets the rgb map values. More...
 
void setSrcBand (short n)
 
void setTransfFunction (RasterTransfFunctions func)
 
void setTransfFunction (RasterTransform::TransformFunction transfFuncPtr)
 
void setTransparency (double value)
 Sets the transparency. More...
 
 ~RasterTransform ()
 Destructor. More...
 

Protected Member Functions

bool checkNoValue (double &value, int band)
 Function used to check if value is or not a valid value. More...
 
void fixValue (double &value)
 
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)
 
te::color::RGBAColor getInterpolate (double icol, double ilin)
 
te::color::RGBAColor getInterpolatedColor (double value)
 
te::color::RGBAColor getMono2ThreeBand (double icol, double ilin)
 
te::color::RGBAColor getRecode (double icol, double ilin)
 
te::color::RGBAColor getRecodedColor (double value)
 
te::color::RGBAColor getRed2ThreeBand (double icol, double ilin)
 
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 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

double m_bContrast
 Contrast value used in blue band. More...
 
CategorizedMap m_categorizeMap
 Attribute to define the categorized transformation. More...
 
double m_gain
 Gain factor. More...
 
double m_gContrast
 Contrast value used in green band. More...
 
InterpolatedMap m_interpolateMap
 Attribute to define the interpolated transformation. More...
 
double m_mContrast
 Contrast value used in gray band. More...
 
short m_monoBand
 Value for the gray band. More...
 
short m_monoBandOut
 Value for output gray band channel. More...
 
double m_offset
 Offset factor. More...
 
te::rst::Rasterm_rasterIn
 Pointer to a input raster. More...
 
te::rst::Rasterm_rasterOut
 Pointer to a output raster. More...
 
double m_rContrast
 Contrast value used in red band. More...
 
RecodedMap m_recodeMap
 Attribute to define the recoded transformation. More...
 
RGBAFunction m_RGBAFuncPtr
 Function used in transformation operation. More...
 
std::map< RGBChannels, short > m_rgbMap
 Map used to set the band order. More...
 
double m_rstMaxValue
 Max value from input raster. More...
 
double m_rstMinValue
 Min value from input raster. More...
 
TransformFunction m_transfFuncPtr
 Function used in transformation operation. More...
 
double m_transp
 Transparency factor. More...
 

Detailed Description

A Raster Transform is a class that defines functions to transform a styled raster.

See also

Definition at line 62 of file RasterTransform.h.

Member Typedef Documentation

typedef std::pair<double, double> te::map::RasterTransform::RasterThreshold

Definition at line 69 of file RasterTransform.h.

Definition at line 73 of file RasterTransform.h.

typedef te::color::RGBAColor(RasterTransform::* te::map::RasterTransform::RGBAFunction) (double, double)

Definition at line 67 of file RasterTransform.h.

typedef void(RasterTransform::* te::map::RasterTransform::TransformFunction) (double, double, double, double)

Definition at line 66 of file RasterTransform.h.

Member Enumeration Documentation

Enumerator
NO_TRANSF 
MONO2THREE_TRANSF 
EXTRACT2RGB_TRANSF 
RED2THREE_TRANSF 
GREEN2THREE_TRANSF 
BLUE2THREE_TRANSF 
CATEGORIZE_TRANSF 
INTERPOLATE_TRANSF 
RECODE_TRANSF 
BAND2BAND_TRANSF 
EXTRACT2RGBA_TRANSF 

Definition at line 85 of file RasterTransform.h.

The three channels of a display.

Enumerator
RED_CHANNEL 
GREEN_CHANNEL 
BLUE_CHANNEL 
ALPHA_CHANNEL 

Definition at line 76 of file RasterTransform.h.

Constructor & Destructor Documentation

te::map::RasterTransform::RasterTransform ( te::rst::Raster input,
te::rst::Raster output 
)

Constructor.

Parameters
input
output
Note
te::map::RasterTransform::~RasterTransform ( )

Destructor.

Member Function Documentation

void te::map::RasterTransform::apply ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
inline

Applies the selected transformation method

Definition at line 229 of file RasterTransform.h.

te::color::RGBAColor te::map::RasterTransform::apply ( double  icol,
double  ilin 
)
inline

Definition at line 231 of file RasterTransform.h.

bool te::map::RasterTransform::checkNoValue ( double &  value,
int  band 
)
protected

Function used to check if value is or not a valid value.

Returns
True if the value is EQUAL to NoValue and false in other case.
void te::map::RasterTransform::clearRGBMap ( )
inline

Clears current mapping from bands to channel

Definition at line 170 of file RasterTransform.h.

void te::map::RasterTransform::fixValue ( double &  value)
protected

Function used to adjust the value in raster range

te::color::RGBAColor te::map::RasterTransform::getBlue2ThreeBand ( double  icol,
double  ilin 
)
protected

This transformation repeats the value of the first band in input three bands of the output

te::color::RGBAColor te::map::RasterTransform::getCategorize ( double  icol,
double  ilin 
)
protected

This transformation get the value of the selected band in input and get the categorized value

te::color::RGBAColor te::map::RasterTransform::getCategorizedColor ( double  value)
protected

Function used to get the categorized color given a pixel value

CategorizedMap& te::map::RasterTransform::getCategorizedMap ( )
inline

Gets the categorize map information

Definition at line 191 of file RasterTransform.h.

double te::map::RasterTransform::getContrastB ( )
inline

Gets the constrast value for blue band.

Definition at line 155 of file RasterTransform.h.

double te::map::RasterTransform::getContrastG ( )
inline

Gets the constrast value for green band.

Definition at line 149 of file RasterTransform.h.

double te::map::RasterTransform::getContrastM ( )
inline

Gets the constrast value for gray band.

Definition at line 161 of file RasterTransform.h.

double te::map::RasterTransform::getContrastR ( )
inline

Gets the constrast value for red band.

Definition at line 143 of file RasterTransform.h.

short te::map::RasterTransform::getDestBand ( )
inline

Gets the destination of the mono band

Definition at line 185 of file RasterTransform.h.

te::color::RGBAColor te::map::RasterTransform::getExtractRGB ( double  icol,
double  ilin 
)
protected

This transformation is used to define a particular mapping from input bands to RGB channels

te::color::RGBAColor te::map::RasterTransform::getExtractRGBA ( double  icol,
double  ilin 
)
protected

This transformation is used to define a particular mapping from input bands to RGBA channels

double te::map::RasterTransform::getGain ( )
inline

Gets the gain.

Definition at line 131 of file RasterTransform.h.

te::color::RGBAColor te::map::RasterTransform::getGreen2ThreeBand ( double  icol,
double  ilin 
)
protected

This transformation repeats the value of the first band in input three bands of the output

te::rst::Raster* te::map::RasterTransform::getInputRaster ( )
inline

Gets the input raster.

Definition at line 116 of file RasterTransform.h.

te::color::RGBAColor te::map::RasterTransform::getInterpolate ( double  icol,
double  ilin 
)
protected

This transformation get the value of the selected band in input and get the interpolated value

te::color::RGBAColor te::map::RasterTransform::getInterpolatedColor ( double  value)
protected

Function used to get the interpolated color given a pixel value

InterpolatedMap& te::map::RasterTransform::getInterpolatedMap ( )
inline

Gets the categorize map information

Definition at line 197 of file RasterTransform.h.

te::color::RGBAColor te::map::RasterTransform::getMono2ThreeBand ( double  icol,
double  ilin 
)
protected

This transformation repeats the value of the first band in input three bands of the output

double te::map::RasterTransform::getOffset ( )
inline

Gets the offset.

Definition at line 137 of file RasterTransform.h.

te::rst::Raster* te::map::RasterTransform::getOutputRaster ( )
inline

Gets the output raster.

Definition at line 119 of file RasterTransform.h.

te::color::RGBAColor te::map::RasterTransform::getRecode ( double  icol,
double  ilin 
)
protected

This transformation get the value of the selected band in input and get the recoded value

te::color::RGBAColor te::map::RasterTransform::getRecodedColor ( double  value)
protected

Function used to get the recoded color given a pixel value

RecodedMap& te::map::RasterTransform::getRecodedMap ( )
inline

Gets the recode map information

Definition at line 203 of file RasterTransform.h.

te::color::RGBAColor te::map::RasterTransform::getRed2ThreeBand ( double  icol,
double  ilin 
)
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 ( )
inline

Returns the mapping from a particular input band to a particular output channel

Definition at line 173 of file RasterTransform.h.

short te::map::RasterTransform::getSrcBand ( )
inline

Gets the mono band to be transformed

Definition at line 179 of file RasterTransform.h.

RasterTransfFunctions te::map::RasterTransform::getTransfFunction ( )

Returns the identifier of the transformation function currently set

double te::map::RasterTransform::getTransparency ( )
inline

Gets the transparency.

Definition at line 125 of file RasterTransform.h.

void te::map::RasterTransform::setBand2Band ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
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 
)
inline

Sets the mapping from a particular input band to a particular output channel

Definition at line 167 of file RasterTransform.h.

void te::map::RasterTransform::setBlue2ThreeBand ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
protected

This transformation repeats the value of the first band in input three bands of the output

void te::map::RasterTransform::setCategorize ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
protected

This transformation get the value of the selected band in input and set the categorized value in output bands of the output

void te::map::RasterTransform::setCategorizedMap ( CategorizedMap  map)
inline

Sets the categorize map information

Definition at line 188 of file RasterTransform.h.

void te::map::RasterTransform::setContrastB ( double  value)
inline

Sets the constrast value for blue band.

Definition at line 152 of file RasterTransform.h.

void te::map::RasterTransform::setContrastG ( double  value)
inline

Sets the constrast value for green band.

Definition at line 146 of file RasterTransform.h.

void te::map::RasterTransform::setContrastM ( double  value)
inline

Sets the constrast value for gray band.

Definition at line 158 of file RasterTransform.h.

void te::map::RasterTransform::setContrastR ( double  value)
inline

Sets the constrast value for red band.

Definition at line 140 of file RasterTransform.h.

void te::map::RasterTransform::setDestBand ( short  n)
inline

Sets the destination of the mono band

Definition at line 182 of file RasterTransform.h.

void te::map::RasterTransform::setExtractRGB ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
protected

This transformation is used to define a particular mapping from input bands to RGB channels

void te::map::RasterTransform::setExtractRGBA ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
protected

This transformation is used to define a particular mapping from input bands to RGBA channels

void te::map::RasterTransform::setGain ( double  value)
inline

Sets the gain.

Definition at line 128 of file RasterTransform.h.

void te::map::RasterTransform::setGreen2ThreeBand ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
protected

This transformation repeats the value of the first band in input three bands of the output

void te::map::RasterTransform::setInterpolate ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
protected

This transformation get the value of the selected band in input and set the interpolated value in output bands of the output

void te::map::RasterTransform::setInterpolatedMap ( InterpolatedMap  map)
inline

Sets the interpolate map information

Definition at line 194 of file RasterTransform.h.

void te::map::RasterTransform::setLinearTransfParameters ( double  vmin,
double  vmax,
double  rmin,
double  rmax 
)

Set parameters of linear transformation.

Parameters
vminsmallest input value
vmaxlargest input value
rminsmallest value of the output range
rmaxlargest value of the output range
void te::map::RasterTransform::setMono2ThreeBand ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
protected

This transformation repeats the value of the first band in input three bands of the output

void te::map::RasterTransform::setOffset ( double  value)
inline

Sets the offset.

Definition at line 134 of file RasterTransform.h.

void te::map::RasterTransform::setRecode ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
protected

This transformation get the value of the selected band in input and set the recoded value in output bands of the output

void te::map::RasterTransform::setRecodedMap ( RecodedMap  map)
inline

Sets the recode map information

Definition at line 200 of file RasterTransform.h.

void te::map::RasterTransform::setRed2ThreeBand ( double  icol,
double  ilin,
double  ocol,
double  olin 
)
protected

This transformation repeats the value of the first band in input three bands of the output

void te::map::RasterTransform::setRGBAFunction ( RasterTransform::RGBAFunction  transfFuncPtr)
inline

Sets the transformation method to be used

Definition at line 226 of file RasterTransform.h.

void te::map::RasterTransform::setRGBMap ( std::map< RGBChannels, short > &  rgbMap)

Sets the rgb map values.

void te::map::RasterTransform::setSrcBand ( short  n)
inline

Sets the mono band to be transformed

Definition at line 176 of file RasterTransform.h.

void te::map::RasterTransform::setTransfFunction ( RasterTransfFunctions  func)

Sets the associated transformation function from an identifier

void te::map::RasterTransform::setTransfFunction ( RasterTransform::TransformFunction  transfFuncPtr)
inline

Sets the transformation method to be used

Definition at line 223 of file RasterTransform.h.

void te::map::RasterTransform::setTransparency ( double  value)
inline

Sets the transparency.

Definition at line 122 of file RasterTransform.h.

Member Data Documentation

double te::map::RasterTransform::m_bContrast
private

Contrast value used in blue band.

Definition at line 324 of file RasterTransform.h.

CategorizedMap te::map::RasterTransform::m_categorizeMap
private

Attribute to define the categorized transformation.

Definition at line 334 of file RasterTransform.h.

double te::map::RasterTransform::m_gain
private

Gain factor.

Definition at line 318 of file RasterTransform.h.

double te::map::RasterTransform::m_gContrast
private

Contrast value used in green band.

Definition at line 323 of file RasterTransform.h.

InterpolatedMap te::map::RasterTransform::m_interpolateMap
private

Attribute to define the interpolated transformation.

Definition at line 335 of file RasterTransform.h.

double te::map::RasterTransform::m_mContrast
private

Contrast value used in gray band.

Definition at line 325 of file RasterTransform.h.

short te::map::RasterTransform::m_monoBand
private

Value for the gray band.

Definition at line 328 of file RasterTransform.h.

short te::map::RasterTransform::m_monoBandOut
private

Value for output gray band channel.

Definition at line 329 of file RasterTransform.h.

double te::map::RasterTransform::m_offset
private

Offset factor.

Definition at line 319 of file RasterTransform.h.

te::rst::Raster* te::map::RasterTransform::m_rasterIn
private

Pointer to a input raster.

Definition at line 314 of file RasterTransform.h.

te::rst::Raster* te::map::RasterTransform::m_rasterOut
private

Pointer to a output raster.

Definition at line 315 of file RasterTransform.h.

double te::map::RasterTransform::m_rContrast
private

Contrast value used in red band.

Definition at line 322 of file RasterTransform.h.

RecodedMap te::map::RasterTransform::m_recodeMap
private

Attribute to define the recoded transformation.

Definition at line 336 of file RasterTransform.h.

RGBAFunction te::map::RasterTransform::m_RGBAFuncPtr
private

Function used in transformation operation.

Definition at line 332 of file RasterTransform.h.

std::map<RGBChannels, short> te::map::RasterTransform::m_rgbMap
private

Map used to set the band order.

Definition at line 327 of file RasterTransform.h.

double te::map::RasterTransform::m_rstMaxValue
private

Max value from input raster.

Definition at line 321 of file RasterTransform.h.

double te::map::RasterTransform::m_rstMinValue
private

Min value from input raster.

Definition at line 320 of file RasterTransform.h.

TransformFunction te::map::RasterTransform::m_transfFuncPtr
private

Function used in transformation operation.

Definition at line 331 of file RasterTransform.h.

double te::map::RasterTransform::m_transp
private

Transparency factor.

Definition at line 317 of file RasterTransform.h.


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