QgsRasterShader class

Interface for all raster shaders.

Constructors, destructors, conversion operators

QgsRasterShader(const QgsRasterShader& rh) deleted
QgsRasterShader cannot be copied.

Public functions

auto maximumValue() const -> double
Returns the maximum value for the raster shader.
auto minimumValue() const -> double
Returns the minimum value for the raster shader.
auto operator=(const QgsRasterShader& rh) -> QgsRasterShader& deleted
QgsRasterShader cannot be copied.
void readXml(const QDomElement& elem)
Reads shader state from an XML element.
void setMaximumValue(double value)
Sets the maximum value for the raster shader.
void setMinimumValue(double value)
Sets the minimum value for the raster shader.
void setRasterShaderFunction(QgsRasterShaderFunction* function)
A public method that allows the user to set their own shader function.
auto shade(double value, int* returnRedValue, int* returnGreenValue, int* returnBlueValue, int* returnAlpha) -> bool
Generates a new RGBA value based on one input value.
auto shade(double redValue, double greenValue, double blueValue, double alphaValue, int* returnRedValue, int* returnGreenValue, int* returnBlueValue, int* returnAlpha) -> bool
Generates a new RGBA value based on an original RGBA value.
void writeXml(QDomDocument& doc, QDomElement& parent) const
Writes shader state to an XML element.

Function documentation

double QgsRasterShader::maximumValue() const

Returns the maximum value for the raster shader.

double QgsRasterShader::minimumValue() const

Returns the minimum value for the raster shader.

void QgsRasterShader::setMaximumValue(double value)

Sets the maximum value for the raster shader.

void QgsRasterShader::setMinimumValue(double value)

Sets the minimum value for the raster shader.

void QgsRasterShader::setRasterShaderFunction(QgsRasterShaderFunction* function)

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

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

Generates a new RGBA value based on one input value.

Parameters
value The original value to base a new RGBA value on
returnRedValue The red component of the new RGBA value
returnGreenValue The green component of the new RGBA value
returnBlueValue The blue component of the new RGBA value
returnAlpha The alpha component of the new RGBA value
Returns True if the return values are valid otherwise false

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

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

Parameters
redValue The red component of the original value to base a new RGBA value on
greenValue The green component of the original value to base a new RGBA value on
blueValue The blue component of the original value to base a new RGBA value on
alphaValue The alpha component of the original value to base a new RGBA value on
returnRedValue The red component of the new RGBA value
returnGreenValue The green component of the new RGBA value
returnBlueValue The blue component of the new RGBA value
returnAlpha The alpha component of the new RGBA value
Returns True if the return values are valid otherwise false