QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Member Functions | Protected Attributes | List of all members
QgsRasterShaderFunction Class Reference

The raster shade function applies a shader to a pixel at render time - typically used to render grayscale images as false color. More...

#include <qgsrastershaderfunction.h>

Inheritance diagram for QgsRasterShaderFunction:
Inheritance graph
[legend]

Public Member Functions

 QgsRasterShaderFunction (double minimumValue=0.0, double maximumValue=255.0)
 
virtual ~QgsRasterShaderFunction ()=default
 
int labelPrecision () const
 Returns label precision. More...
 
virtual void legendSymbologyItems (QList< QPair< QString, QColor > > &symbolItems) const
 Returns legend symbology items if provided by renderer. More...
 
double maximumValue () const
 Returns the minimum value for the raster shader. More...
 
double minimumMaximumRange () const
 
double minimumValue () const
 Returns the maximum value for the raster shader. More...
 
void setLabelPrecision (int labelPrecision)
 Sets label precision to labelPrecision. More...
 
virtual void setMaximumValue (double value)
 Sets the maximum value for the raster shader. More...
 
virtual void setMinimumValue (double value)
 Sets the minimum value for the raster shader. More...
 
virtual bool shade (double redValue, double greenValue, double blueValue, double alphaValue, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlpha) const
 Generates an new RGBA value based on an original RGBA value. More...
 
virtual bool shade (double value, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlpha) const
 Generates an new RGBA value based on one input value. More...
 

Protected Attributes

int mLabelPrecision = 6
 Label precision. More...
 
double mMaximumValue
 User defineable maximum value for the shading function. More...
 
double mMinimumMaximumRange
 Minimum maximum range for the shading function. More...
 
double mMinimumValue
 User defineable minimum value for the shading function. More...
 

Detailed Description

The raster shade function applies a shader to a pixel at render time - typically used to render grayscale images as false color.

Definition at line 34 of file qgsrastershaderfunction.h.

Constructor & Destructor Documentation

◆ QgsRasterShaderFunction()

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

Definition at line 22 of file qgsrastershaderfunction.cpp.

◆ ~QgsRasterShaderFunction()

virtual QgsRasterShaderFunction::~QgsRasterShaderFunction ( )
virtualdefault

Member Function Documentation

◆ labelPrecision()

int QgsRasterShaderFunction::labelPrecision ( ) const

Returns label precision.

Since
QGIS 3.16

Definition at line 74 of file qgsrastershaderfunction.cpp.

◆ legendSymbologyItems()

virtual void QgsRasterShaderFunction::legendSymbologyItems ( QList< QPair< QString, QColor > > &  symbolItems) const
inlinevirtual

Returns legend symbology items if provided by renderer.

Reimplemented in QgsColorRampShader.

Definition at line 124 of file qgsrastershaderfunction.h.

◆ maximumValue()

double QgsRasterShaderFunction::maximumValue ( ) const
inline

Returns the minimum value for the raster shader.

See also
setMinimumValue()
maximumValue()

Definition at line 119 of file qgsrastershaderfunction.h.

◆ minimumMaximumRange()

double QgsRasterShaderFunction::minimumMaximumRange ( ) const
inline

Definition at line 105 of file qgsrastershaderfunction.h.

◆ minimumValue()

double QgsRasterShaderFunction::minimumValue ( ) const
inline

Returns the maximum value for the raster shader.

See also
setMaximumValue()
minimumValue()

Definition at line 112 of file qgsrastershaderfunction.h.

◆ setLabelPrecision()

void QgsRasterShaderFunction::setLabelPrecision ( int  labelPrecision)

Sets label precision to labelPrecision.

Since
QGIS 3.16

Definition at line 79 of file qgsrastershaderfunction.cpp.

◆ setMaximumValue()

void QgsRasterShaderFunction::setMaximumValue ( double  value)
virtual

Sets the maximum value for the raster shader.

See also
setMinimumValue()
maximumValue()

Definition at line 30 of file qgsrastershaderfunction.cpp.

◆ setMinimumValue()

void QgsRasterShaderFunction::setMinimumValue ( double  value)
virtual

Sets the minimum value for the raster shader.

See also
setMaximumValue()
minimumValue()

Definition at line 38 of file qgsrastershaderfunction.cpp.

◆ shade() [1/2]

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

Generates an 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
returnAlphaThe alpha component of the new RGBA value
Returns
true if the return values are valid otherwise false

Reimplemented in QgsColorRampShader.

Definition at line 58 of file qgsrastershaderfunction.cpp.

◆ shade() [2/2]

bool QgsRasterShaderFunction::shade ( double  value,
int *  returnRedValue,
int *  returnGreenValue,
int *  returnBlueValue,
int *  returnAlpha 
) const
virtual

Generates an 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

Reimplemented in QgsColorRampShader.

Definition at line 46 of file qgsrastershaderfunction.cpp.

Member Data Documentation

◆ mLabelPrecision

int QgsRasterShaderFunction::mLabelPrecision = 6
protected

Label precision.

Definition at line 149 of file qgsrastershaderfunction.h.

◆ mMaximumValue

double QgsRasterShaderFunction::mMaximumValue
protected

User defineable maximum value for the shading function.

Definition at line 140 of file qgsrastershaderfunction.h.

◆ mMinimumMaximumRange

double QgsRasterShaderFunction::mMinimumMaximumRange
protected

Minimum maximum range for the shading function.

Definition at line 146 of file qgsrastershaderfunction.h.

◆ mMinimumValue

double QgsRasterShaderFunction::mMinimumValue
protected

User defineable minimum value for the shading function.

Definition at line 143 of file qgsrastershaderfunction.h.


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