27 return value >= std::numeric_limits<quint8>::min() && value <= std::numeric_limits<quint8>::max();
29 return value >= std::numeric_limits<qint8>::min() && value <= std::numeric_limits<qint8>::max();
31 return value >= std::numeric_limits<quint16>::min() && value <= std::numeric_limits<quint16>::max();
33 return value >= std::numeric_limits<qint16>::min() && value <= std::numeric_limits<qint16>::max();
35 return value >= std::numeric_limits<quint32>::min() && value <= std::numeric_limits<quint32>::max();
37 return value >= std::numeric_limits<qint32>::min() && value <= std::numeric_limits<qint32>::max();
39 return std::isnan( value ) || std::isinf( value ) ||
40 ( value >= -std::numeric_limits<float>::max() && value <= std::numeric_limits<float>::max() );
60 return static_cast<quint8
>( value );
62 return static_cast<qint8
>( value );
64 return static_cast<quint16
>( value );
66 return static_cast<qint16
>( value );
68 return static_cast<quint32
>( value );
70 return static_cast<qint32
>( value );
72 return static_cast<float>( value );
DataType
Raster data types.
@ Float32
Thirty two bit floating point (float)
@ CFloat64
Complex Float64.
@ Int16
Sixteen bit signed integer (qint16)
@ ARGB32_Premultiplied
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32_Premultiplied.
@ Int8
Eight bit signed integer (qint8) (added in QGIS 3.30)
@ UInt16
Sixteen bit unsigned integer (quint16)
@ Byte
Eight bit unsigned integer (quint8)
@ UnknownDataType
Unknown or unspecified type.
@ ARGB32
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32.
@ Int32
Thirty two bit signed integer (qint32)
@ Float64
Sixty four bit floating point (double)
@ CFloat32
Complex Float32.
@ UInt32
Thirty two bit unsigned integer (quint32)
static bool isRepresentableValue(double value, Qgis::DataType dataType)
Check if the specified value is representable in the given data type.
static double representableValue(double value, Qgis::DataType dataType)
Gets value representable by given data type.