2012-09-24 02:28:15 +02:00
|
|
|
class QgsRasterMatrix
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsrastermatrix.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum TwoArgOperator
|
|
|
|
{
|
|
|
|
opPLUS,
|
|
|
|
opMINUS,
|
|
|
|
opMUL,
|
|
|
|
opDIV,
|
|
|
|
opPOW,
|
|
|
|
opEQ, // =
|
|
|
|
opNE, // != resp. <>
|
|
|
|
opGT, // >
|
|
|
|
opLT, // <
|
|
|
|
opGE, // >=
|
|
|
|
opLE, // <=
|
|
|
|
opAND,
|
|
|
|
opOR
|
|
|
|
};
|
|
|
|
|
|
|
|
enum OneArgOperator
|
|
|
|
{
|
|
|
|
opSQRT,
|
|
|
|
opSIN,
|
|
|
|
opCOS,
|
|
|
|
opTAN,
|
|
|
|
opASIN,
|
|
|
|
opACOS,
|
|
|
|
opATAN,
|
|
|
|
opSIGN
|
|
|
|
};
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Takes ownership of data array*/
|
2012-09-24 02:28:15 +02:00
|
|
|
QgsRasterMatrix();
|
2014-01-27 09:22:24 +01:00
|
|
|
//! @note note available in python bindings
|
2012-09-24 02:28:15 +02:00
|
|
|
// QgsRasterMatrix( int nCols, int nRows, float* data, double nodataValue );
|
|
|
|
QgsRasterMatrix( const QgsRasterMatrix& m );
|
|
|
|
~QgsRasterMatrix();
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns true if matrix is 1x1 (=scalar number)*/
|
2012-09-24 02:28:15 +02:00
|
|
|
bool isNumber() const;
|
|
|
|
double number() const;
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns data array (but not ownership)*/
|
2014-01-27 09:22:24 +01:00
|
|
|
//! @note not available in python bindings
|
2015-06-04 07:50:46 +10:00
|
|
|
// double* data();
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns data and ownership. Sets data and nrows, ncols of this matrix to 0*/
|
2014-01-27 09:22:24 +01:00
|
|
|
//! @note not available in python bindings
|
2015-06-04 07:50:46 +10:00
|
|
|
// double* takeData();
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2015-06-04 07:50:46 +10:00
|
|
|
void setData( int cols, int rows, double* data, double nodataValue );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
int nColumns() const;
|
|
|
|
int nRows() const;
|
|
|
|
|
|
|
|
double nodataValue() const;
|
|
|
|
void setNodataValue( double d );
|
|
|
|
|
|
|
|
// QgsRasterMatrix& operator=( const QgsRasterMatrix& m );
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Adds another matrix to this one*/
|
2012-09-24 02:28:15 +02:00
|
|
|
bool add( const QgsRasterMatrix& other );
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Subtracts another matrix from this one*/
|
2012-09-24 02:28:15 +02:00
|
|
|
bool subtract( const QgsRasterMatrix& other );
|
|
|
|
bool multiply( const QgsRasterMatrix& other );
|
|
|
|
bool divide( const QgsRasterMatrix& other );
|
|
|
|
bool power( const QgsRasterMatrix& other );
|
|
|
|
bool equal( const QgsRasterMatrix& other );
|
|
|
|
bool notEqual( const QgsRasterMatrix& other );
|
|
|
|
bool greaterThan( const QgsRasterMatrix& other );
|
|
|
|
bool lesserThan( const QgsRasterMatrix& other );
|
|
|
|
bool greaterEqual( const QgsRasterMatrix& other );
|
|
|
|
bool lesserEqual( const QgsRasterMatrix& other );
|
|
|
|
bool logicalAnd( const QgsRasterMatrix& other );
|
|
|
|
bool logicalOr( const QgsRasterMatrix& other );
|
|
|
|
|
|
|
|
bool squareRoot();
|
|
|
|
bool sinus();
|
|
|
|
bool asinus();
|
|
|
|
bool cosinus();
|
|
|
|
bool acosinus();
|
|
|
|
bool tangens();
|
|
|
|
bool atangens();
|
|
|
|
bool changeSign();
|
2016-01-04 22:51:18 +11:00
|
|
|
bool log();
|
|
|
|
bool log10();
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|