QGIS API Documentation  master-59fd5e0
QgsRasterShader Class Reference

Interface for all raster shaders. More...

#include <qgsrastershader.h>

+ Collaboration diagram for QgsRasterShader:

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 ()
const QgsRasterShaderFunctionrasterShaderFunction () const
void readXML (const QDomElement &elem)
void setMaximumValue (double)
 Set the maximum value.
void setMinimumValue (double)
 Return the minimum value.
void setRasterShaderFunction (QgsRasterShaderFunction *)
 A public method that allows the user to set their own shader function.
bool shade (double, int *, int *, int *, int *)
 generates and new RGBA value based on one input value
bool shade (double, double, double, double, int *, int *, int *, int *)
 generates and new RGBA value based on original RGBA value
void writeXML (QDomDocument &doc, QDomElement &parent) const

Private Attributes

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

Detailed Description

Interface for all raster shaders.

Definition at line 31 of file qgsrastershader.h.


Constructor & Destructor Documentation

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

Definition at line 25 of file qgsrastershader.cpp.

References mMaximumValue, mMinimumValue, mRasterShaderFunction, and QgsDebugMsg.


Member Function Documentation

double QgsRasterShader::maximumValue ( ) [inline]

Return the maximum value for the raster shader.

Definition at line 44 of file qgsrastershader.h.

Referenced by QgsSingleBandPseudoColorRenderer::clone().

double QgsRasterShader::minimumValue ( ) [inline]

Return the minimum value for the raster shader.

Definition at line 47 of file qgsrastershader.h.

Referenced by QgsSingleBandPseudoColorRenderer::clone().

Definition at line 50 of file qgsrastershader.h.

void QgsRasterShader::setMaximumValue ( double  theValue)

Set the maximum value.

Set the maximum value for the raster shader.

Parameters:
theValueThe new maximum value

Definition at line 106 of file qgsrastershader.cpp.

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

void QgsRasterShader::setMinimumValue ( double  theValue)

Return the minimum value.

Set the maximum value for the raster shader.

Parameters:
theValueThe new minimum value

Definition at line 122 of file qgsrastershader.cpp.

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

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:
theFunctionA pointer to the new raster shader function

Definition at line 87 of file qgsrastershader.cpp.

References mRasterShaderFunction, and QgsDebugMsg.

Referenced by QgsSingleBandPseudoColorRenderer::clone(), readXML(), QgsSingleBandPseudoColorRendererWidget::renderer(), and QgsRasterLayer::setDataProvider().

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

generates and new RGBA value based on one input value

Generates and new RGBA value based on one input value.

Parameters:
theValueThe original value to base a new RGBA value on
theReturnRedValueThe red component of the new RGBA value
theReturnGreenValueThe green component of the new RGBA value
theReturnBlueValueThe blue component of the new RGBA value
theReturnAlphaThe alpha component of the new RGBA value
Returns:
True if the return values are valid otherwise false

Definition at line 49 of file qgsrastershader.cpp.

References mRasterShaderFunction, and QgsRasterShaderFunction::shade().

Referenced by QgsSingleBandPseudoColorRenderer::block().

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

generates and new RGBA value based on original RGBA value

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

Parameters:
theRedValueThe red component of the original value to base a new RGBA value on
theGreenValueThe green component of the original value to base a new RGBA value on
theBlueValueThe blue component of the original value to base a new RGBA value on
theAlphaValueThe alpha component of the original value to base a new RGBA value on
theReturnRedValueThe red component of the new RGBA value
theReturnGreenValueThe green component of the new RGBA value
theReturnBlueValueThe blue component of the new RGBA value
theReturnAlphaValueThe alpha component of the new RGBA value
Returns:
True if the return values are valid otherwise false

Definition at line 72 of file qgsrastershader.cpp.

References mRasterShaderFunction, and QgsRasterShaderFunction::shade().


Member Data Documentation

user defineable maximum value for the raster shader

Definition at line 82 of file qgsrastershader.h.

Referenced by QgsRasterShader(), and setMaximumValue().

User defineable minimum value for the raster shader.

Definition at line 79 of file qgsrastershader.h.

Referenced by QgsRasterShader(), and setMinimumValue().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines