QGIS/python/core/raster/qgsrasterblock.sip

65 lines
1.9 KiB
Plaintext
Raw Normal View History

2012-10-11 16:11:45 +02:00
class QgsRasterBlock
{
%TypeHeaderCode
#include <qgis.h>
2012-10-11 16:11:45 +02:00
#include <qgsrasterblock.h>
%End
public:
QgsRasterBlock();
QgsRasterBlock( QGis::DataType theDataType, int theWidth, int theHeight, double theNoDataValue );
2012-10-11 16:11:45 +02:00
virtual ~QgsRasterBlock();
bool reset( QGis::DataType theDataType, int theWidth, int theHeight, double theNoDataValue );
2012-10-11 16:11:45 +02:00
bool isEmpty() const;
int typeSize( int dataType ) const;
int dataTypeSize( int bandNo ) const;
/** Returns true if data type is numeric */
bool typeIsNumeric( QGis::DataType type ) const;
2012-10-11 16:11:45 +02:00
/** Returns true if data type is color */
bool typeIsColor( QGis::DataType type ) const;
2012-10-11 16:11:45 +02:00
/** Returns data type for the band specified by number */
virtual QGis::DataType dataType() const;
2012-10-11 16:11:45 +02:00
/** For given data type returns wider type and sets no data value */
static QGis::DataType typeWithNoDataValue( QGis::DataType dataType, double *noDataValue );
2012-10-11 16:11:45 +02:00
2013-04-12 18:32:46 +02:00
bool hasNoDataValue() const;
2012-10-11 16:11:45 +02:00
double noDataValue( ) const;
2013-04-12 18:32:46 +02:00
//void setNoDataValue( double noDataValue );
2012-10-11 16:11:45 +02:00
2013-04-12 18:32:46 +02:00
//static bool isNoDataValue( double value, double noDataValue );
2012-10-11 16:11:45 +02:00
2013-04-12 18:32:46 +02:00
//bool isNoDataValue( double value ) const;
2012-10-11 16:11:45 +02:00
double value( int row, int column ) const;
double value( size_t index) const;
QRgb color( int row, int column ) const;
QRgb color( size_t index) const;
bool isNoData( int row, int column );
bool isNoData( size_t index );
bool setValue( int row, int column, double value );
bool setValue( size_t index, double value );
bool setColor( int row, int column, QRgb color );
bool setColor( size_t index, QRgb color );
// Not desired to give direct access to data in Python, could cause crash
//char * bits( int row, int column );
//char * bits( size_t index );
static QString printValue( double value );
bool convert( QGis::DataType destDataType );
2012-10-11 16:11:45 +02:00
QImage image() const;
bool setImage( const QImage * image );
};