QgsRaster class

Raster namespace.

Public types

enum ColorInterpretation { UndefinedColorInterpretation = 0, GrayIndex = 1, PaletteIndex = 2, RedBand = 3, GreenBand = 4, BlueBand = 5, AlphaBand = 6, HueBand = 7, SaturationBand = 8, LightnessBand = 9, CyanBand = 10, MagentaBand = 11, YellowBand = 12, BlackBand = 13, YCbCr_YBand = 14, YCbCr_CbBand = 15, YCbCr_CrBand = 16, ContinuousPalette = 17 }
enum DrawingStyle { UndefinedDrawingStyle, SingleBandGray, SingleBandPseudoColor, PalettedColor, PalettedSingleBandGray, PalettedSingleBandPseudoColor, PalettedMultiBandColor, MultiBandSingleBandGray, MultiBandSingleBandPseudoColor, MultiBandColor, SingleBandColorDataStyle }
This enumerator describes the different kinds of drawing we can do.

Public static functions

static auto isRepresentableValue(double value, Qgis::DataType dataType) -> bool
Check if the specified value is representable in the given data type.
static auto representableValue(double value, Qgis::DataType dataType) -> double
Gets value representable by given data type.

Enum documentation

enum QgsRaster::ColorInterpretation

Enumerators
UndefinedColorInterpretation
GrayIndex

Greyscale.

PaletteIndex

Paletted (see associated color table)

RedBand

Red band of RGBA image.

GreenBand

Green band of RGBA image.

BlueBand

Blue band of RGBA image.

AlphaBand

Alpha (0=transparent, 255=opaque)

HueBand

Hue band of HLS image.

SaturationBand

Saturation band of HLS image.

LightnessBand

Lightness band of HLS image.

CyanBand

Cyan band of CMYK image.

MagentaBand

Magenta band of CMYK image.

YellowBand

Yellow band of CMYK image.

BlackBand

Black band of CMLY image.

YCbCr_YBand

Y Luminance.

YCbCr_CbBand

Cb Chroma.

YCbCr_CrBand

Cr Chroma.

ContinuousPalette

Continuous palette, QGIS addition, GRASS.

Function documentation

static bool QgsRaster::isRepresentableValue(double value, Qgis::DataType dataType)

Check if the specified value is representable in the given data type.

Parameters
value
dataType

Supported are numerical types Byte, UInt16, Int16, UInt32, Int32, Float32, Float64.

static double QgsRaster::representableValue(double value, Qgis::DataType dataType)

Gets value representable by given data type.

Parameters
value
dataType

Supported are numerical types Byte, UInt16, Int16, UInt32, Int32, Float32, Float64. This is done through C casting, so you have to be sure that the provided value is representable in the output data type. This can be checked with isRepresentableValue().