QgsRasterShader Class Reference
[QGIS core library]

Interface for all raster shaders. More...

#include <qgsrastershader.h>

Collaboration diagram for QgsRasterShader:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 QgsRasterShader (double theMinimumValue=0.0, double theMaximumValue=255.0)
 ~QgsRasterShader ()
double maximumValue ()
 Return the maximum value for the raster shader.
double minimumValue ()
 Return the minimum value for the raster shader.
QgsRasterShaderFunctionrasterShaderFunction ()
bool shade (double, int *, int *, int *)
 generates and new RGB value based on one input value
bool shade (double, double, double, int *, int *, int *)
 generates and new RGB value based on original RGB value
void setRasterShaderFunction (QgsRasterShaderFunction *)
 A public method that allows the user to set their own shader function.
void setMaximumValue (double)
 Set the maximum value.
void setMinimumValue (double)
 Return the minimum value.

Private Attributes

double mMinimumValue
 User defineable minimum value for the raster shader.
double mMaximumValue
 user defineable maximum value for the raster shader
QgsRasterShaderFunctionmRasterShaderFunction
 Pointer to the shader function.


Detailed Description

Interface for all raster shaders.

Definition at line 28 of file qgsrastershader.h.


Constructor & Destructor Documentation

QgsRasterShader::QgsRasterShader ( double  theMinimumValue = 0.0,
double  theMaximumValue = 255.0 
)

Definition at line 23 of file qgsrastershader.cpp.

References mMaximumValue, mMinimumValue, mRasterShaderFunction, and QgsDebugMsg.

QgsRasterShader::~QgsRasterShader (  ) 

Definition at line 32 of file qgsrastershader.cpp.

References mRasterShaderFunction.


Member Function Documentation

double QgsRasterShader::maximumValue (  )  [inline]

Return the maximum value for the raster shader.

Definition at line 41 of file qgsrastershader.h.

double QgsRasterShader::minimumValue (  )  [inline]

Return the minimum value for the raster shader.

Definition at line 44 of file qgsrastershader.h.

QgsRasterShaderFunction* QgsRasterShader::rasterShaderFunction (  )  [inline]

bool QgsRasterShader::shade ( double  theValue,
int *  theReturnRedValue,
int *  theReturnGreenValue,
int *  theReturnBlueValue 
)

generates and new RGB value based on one input value

Generates and new RGB value based on one input value.

Parameters:
theValue The original value to base a new RGB value on
theReturnRedValue The red component of the new RGB value
theReturnGreenValue The green component of the new RGB value
theReturnBlueValue The blue component of the new RGB value
Returns:
True if the return values are valid otherwise false

Definition at line 46 of file qgsrastershader.cpp.

References mRasterShaderFunction, and QgsRasterShaderFunction::shade().

Referenced by QgsRasterLayer::drawPalettedSingleBandColor(), QgsRasterLayer::drawPalettedSingleBandGray(), QgsRasterLayer::drawPalettedSingleBandPseudoColor(), and QgsRasterLayer::drawSingleBandPseudoColor().

bool QgsRasterShader::shade ( double  theRedValue,
double  theGreenValue,
double  theBlueValue,
int *  theReturnRedValue,
int *  theReturnGreenValue,
int *  theReturnBlueValue 
)

generates and new RGB value based on original RGB value

Generates and new RGB value based on an original RGB value.

Parameters:
theRedValue The red component of the original value to base a new RGB value on
theGreenValue The green component of the original value to base a new RGB value on
theBlueValue The blue component of the original value to base a new RGB value on
theReturnRedValue The red component of the new RGB value
theReturnGreenValue The green component of the new RGB value
theReturnBlueValue The blue component of the new RGB value
Returns:
True if the return values are valid otherwise false

Definition at line 67 of file qgsrastershader.cpp.

References mRasterShaderFunction, and QgsRasterShaderFunction::shade().

void QgsRasterShader::setRasterShaderFunction ( QgsRasterShaderFunction theFunction  ) 

A public method that allows the user to set their own shader function.

A public function that allows the user to set their own custom shader function.

Note:
Raster shader takes ownership of the shader function instance
Parameters:
theFunction A pointer to the new raster shader function

Definition at line 82 of file qgsrastershader.cpp.

References mRasterShaderFunction, and QgsDebugMsg.

Referenced by QgsRasterLayer::setColorShadingAlgorithm(), and QgsRasterLayer::setRasterShaderFunction().

void QgsRasterShader::setMaximumValue ( double  theValue  ) 

Set the maximum value.

Set the maximum value for the raster shader.

Parameters:
theValue The new maximum value

Definition at line 101 of file qgsrastershader.cpp.

References mMaximumValue, mRasterShaderFunction, QgsDebugMsg, and QgsRasterShaderFunction::setMaximumValue().

Referenced by QgsRasterLayer::drawPalettedSingleBandPseudoColor(), and QgsRasterLayer::drawSingleBandPseudoColor().

void QgsRasterShader::setMinimumValue ( double  theValue  ) 

Return the minimum value.

Set the maximum value for the raster shader.

Parameters:
theValue The new minimum value

Definition at line 117 of file qgsrastershader.cpp.

References mMinimumValue, mRasterShaderFunction, QgsDebugMsg, and QgsRasterShaderFunction::setMinimumValue().

Referenced by QgsRasterLayer::drawPalettedSingleBandPseudoColor(), and QgsRasterLayer::drawSingleBandPseudoColor().


Member Data Documentation

User defineable minimum value for the raster shader.

Definition at line 71 of file qgsrastershader.h.

Referenced by QgsRasterShader(), and setMinimumValue().

user defineable maximum value for the raster shader

Definition at line 74 of file qgsrastershader.h.

Referenced by QgsRasterShader(), and setMaximumValue().

Pointer to the shader function.

Definition at line 77 of file qgsrastershader.h.

Referenced by QgsRasterShader(), setMaximumValue(), setMinimumValue(), setRasterShaderFunction(), shade(), and ~QgsRasterShader().


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

Generated on Sat Feb 4 19:17:48 2012 for Quantum GIS API Documentation by  doxygen 1.5.6