18 #ifndef QGSRASTERBLOCK_H
19 #define QGSRASTERBLOCK_H
62 bool reset(
QGis::DataType theDataType,
int theWidth,
int theHeight );
71 bool reset(
QGis::DataType theDataType,
int theWidth,
int theHeight,
double theNoDataValue );
82 void setValid(
bool valid ) { mValid = valid; }
91 static int typeSize(
int dataType )
127 int dataTypeSize()
const
129 return typeSize( mDataType );
152 bool hasNoData()
const;
163 static QByteArray valueBytes(
QGis::DataType theDataType,
double theValue );
170 double value(
int row,
int column )
const;
182 QRgb color(
int row,
int column )
const;
193 bool isNoData(
int row,
int column );
205 bool setValue(
int row,
int column,
double value );
218 bool setColor(
int row,
int column, QRgb color );
230 bool setIsNoData(
int row,
int column );
243 bool setIsNoDataExcept(
const QRect & theExceptRect );
251 char * bits(
int row,
int column );
270 static QString printValue(
double value );
279 QImage image()
const;
284 bool setImage(
const QImage * image );
309 static QRect subRect(
const QgsRectangle &theExtent,
int theWidth,
int theHeight,
const QgsRectangle &theSubExtent );
319 static bool isNoDataValue(
double value,
double noDataValue );
324 bool isNoDataValue(
double value )
const;
328 bool createNoDataBitmap();
388 return std::numeric_limits<double>::quiet_NaN();
394 return (
double )(( quint8 * )data )[
index];
397 return (
double )(( quint16 * )data )[
index];
400 return (
double )(( qint16 * )data )[
index];
403 return (
double )(( quint32 * )data )[
index];
406 return (
double )(( qint32 * )data )[
index];
409 return (
double )((
float * )data )[
index];
412 return (
double )((
double * )data )[
index];
415 QgsDebugMsg( QString(
"Data type %1 is not supported" ).arg( type ) );
419 return std::numeric_limits<double>::quiet_NaN();
429 (( quint8 * )data )[
index] = ( quint8 ) value;
432 (( quint16 * )data )[
index] = ( quint16 ) value;
435 (( qint16 * )data )[
index] = ( qint16 ) value;
438 (( quint32 * )data )[
index] = ( quint32 ) value;
441 (( qint32 * )data )[
index] = ( qint32 ) value;
444 ((
float * )data )[
index] = ( float ) value;
450 QgsDebugMsg( QString(
"Data type %1 is not supported" ).arg( type ) );
460 return std::numeric_limits<double>::quiet_NaN();