QGIS API Documentation  3.0.2-Girona (307d082)
Public Member Functions | List of all members
QgsRasterShader Class Reference

Interface for all raster shaders. More...

#include <qgsrastershader.h>

Public Member Functions

 QgsRasterShader (double minimumValue=0.0, double maximumValue=255.0)
 
 QgsRasterShader (const QgsRasterShader &rh)=delete
 QgsRasterShader cannot be copied. More...
 
double maximumValue ()
 Return the maximum value for the raster shader. More...
 
double minimumValue ()
 Return the minimum value for the raster shader. More...
 
QgsRasterShaderoperator= (const QgsRasterShader &rh)=delete
 QgsRasterShader cannot be copied. More...
 
QgsRasterShaderFunctionrasterShaderFunction ()
 
const QgsRasterShaderFunctionrasterShaderFunction () const
 
void readXml (const QDomElement &elem)
 Reads shader state from an XML element. More...
 
void setMaximumValue (double)
 Set the maximum value. More...
 
void setMinimumValue (double)
 Return the minimum value. More...
 
void setRasterShaderFunction (QgsRasterShaderFunction *function)
 A public method that allows the user to set their own shader function. More...
 
bool shade (double value, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlpha)
 generates and new RGBA value based on one input value More...
 
bool shade (double redValue, double greenValue, double blueValue, double alphaValue, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlpha)
 generates and new RGBA value based on original RGBA value More...
 
void writeXml (QDomDocument &doc, QDomElement &parent) const
 Writes shader state to an XML element. More...
 

Detailed Description

Interface for all raster shaders.

Definition at line 34 of file qgsrastershader.h.

Constructor & Destructor Documentation

◆ QgsRasterShader() [1/2]

QgsRasterShader::QgsRasterShader ( double  minimumValue = 0.0,
double  maximumValue = 255.0 
)

Definition at line 28 of file qgsrastershader.cpp.

◆ QgsRasterShader() [2/2]

QgsRasterShader::QgsRasterShader ( const QgsRasterShader rh)
delete

QgsRasterShader cannot be copied.

Member Function Documentation

◆ maximumValue()

double QgsRasterShader::maximumValue ( )
inline

Return the maximum value for the raster shader.

Definition at line 51 of file qgsrastershader.h.

◆ minimumValue()

double QgsRasterShader::minimumValue ( )
inline

Return the minimum value for the raster shader.

Definition at line 54 of file qgsrastershader.h.

◆ operator=()

QgsRasterShader& QgsRasterShader::operator= ( const QgsRasterShader rh)
delete

QgsRasterShader cannot be copied.

◆ rasterShaderFunction() [1/2]

QgsRasterShaderFunction* QgsRasterShader::rasterShaderFunction ( )
inline

Definition at line 56 of file qgsrastershader.h.

◆ rasterShaderFunction() [2/2]

const QgsRasterShaderFunction* QgsRasterShader::rasterShaderFunction ( ) const
inline

Definition at line 57 of file qgsrastershader.h.

◆ readXml()

void QgsRasterShader::readXml ( const QDomElement &  elem)

Reads shader state from an XML element.

Definition at line 170 of file qgsrastershader.cpp.

◆ setMaximumValue()

void QgsRasterShader::setMaximumValue ( double  value)

Set the maximum value.

Set the maximum value for the raster shader.

Parameters
valueThe new maximum value

Definition at line 103 of file qgsrastershader.cpp.

◆ setMinimumValue()

void QgsRasterShader::setMinimumValue ( double  value)

Return the minimum value.

Set the maximum value for the raster shader.

Parameters
valueThe new minimum value

Definition at line 119 of file qgsrastershader.cpp.

◆ setRasterShaderFunction()

void QgsRasterShader::setRasterShaderFunction ( QgsRasterShaderFunction function)

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

Definition at line 85 of file qgsrastershader.cpp.

◆ shade() [1/2]

bool QgsRasterShader::shade ( double  value,
int *  returnRedValue,
int *  returnGreenValue,
int *  returnBlueValue,
int *  returnAlpha 
)

generates and new RGBA value based on one input value

Generates and new RGBA value based on one input value.

Parameters
valueThe original value to base a new RGBA value on
returnRedValueThe red component of the new RGBA value
returnGreenValueThe green component of the new RGBA value
returnBlueValueThe blue component of the new RGBA value
returnAlphaThe alpha component of the new RGBA value
Returns
True if the return values are valid otherwise false

Definition at line 46 of file qgsrastershader.cpp.

◆ shade() [2/2]

bool QgsRasterShader::shade ( double  redValue,
double  greenValue,
double  blueValue,
double  alphaValue,
int *  returnRedValue,
int *  returnGreenValue,
int *  returnBlueValue,
int *  returnAlphaValue 
)

generates and new RGBA value based on original RGBA value

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

Parameters
redValueThe red component of the original value to base a new RGBA value on
greenValueThe green component of the original value to base a new RGBA value on
blueValueThe blue component of the original value to base a new RGBA value on
alphaValueThe alpha component of the original value to base a new RGBA value on
returnRedValueThe red component of the new RGBA value
returnGreenValueThe green component of the new RGBA value
returnBlueValueThe blue component of the new RGBA value
returnAlphaValueThe alpha component of the new RGBA value
Returns
True if the return values are valid otherwise false

Definition at line 70 of file qgsrastershader.cpp.

◆ writeXml()

void QgsRasterShader::writeXml ( QDomDocument &  doc,
QDomElement &  parent 
) const

Writes shader state to an XML element.

Definition at line 130 of file qgsrastershader.cpp.


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