#include <qgsrastermatrix.h>
Public Types | |
enum | TwoArgOperator { opPLUS, opMINUS, opMUL, opDIV, opPOW, opEQ, opNE, opGT, opLT, opGE, opLE } |
enum | OneArgOperator { opSQRT, opSIN, opCOS, opTAN, opASIN, opACOS, opATAN } |
Public Member Functions | |
QgsRasterMatrix () | |
Takes ownership of data array. | |
QgsRasterMatrix (int nCols, int nRows, float *data, double nodataValue) | |
QgsRasterMatrix (const QgsRasterMatrix &m) | |
~QgsRasterMatrix () | |
bool | isNumber () const |
Returns true if matrix is 1x1 (=scalar number). | |
double | number () const |
float * | data () |
Returns data array (but not ownership). | |
float * | takeData () |
Returns data and ownership. | |
void | setData (int cols, int rows, float *data, double nodataValue) |
int | nColumns () const |
int | nRows () const |
double | nodataValue () const |
void | setNodataValue (double d) |
QgsRasterMatrix & | operator= (const QgsRasterMatrix &m) |
bool | add (const QgsRasterMatrix &other) |
Adds another matrix to this one. | |
bool | subtract (const QgsRasterMatrix &other) |
Subtracts another matrix from this one. | |
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 | squareRoot () |
bool | sinus () |
bool | asinus () |
bool | cosinus () |
bool | acosinus () |
bool | tangens () |
bool | atangens () |
Private Member Functions | |
bool | twoArgumentOperation (TwoArgOperator op, const QgsRasterMatrix &other) |
+,-,*,/,^,<,>,<=,>=,=,!= | |
bool | oneArgumentOperation (OneArgOperator op) |
bool | testPowerValidity (double base, double power) |
Private Attributes | |
int | mColumns |
int | mRows |
float * | mData |
double | mNodataValue |
Definition at line 21 of file qgsrastermatrix.h.
Definition at line 25 of file qgsrastermatrix.h.
Definition at line 40 of file qgsrastermatrix.h.
QgsRasterMatrix::QgsRasterMatrix | ( | ) |
QgsRasterMatrix::QgsRasterMatrix | ( | int | nCols, | |
int | nRows, | |||
float * | data, | |||
double | nodataValue | |||
) |
Definition at line 31 of file qgsrastermatrix.cpp.
QgsRasterMatrix::QgsRasterMatrix | ( | const QgsRasterMatrix & | m | ) |
QgsRasterMatrix::~QgsRasterMatrix | ( | ) |
bool QgsRasterMatrix::isNumber | ( | ) | const [inline] |
Returns true if matrix is 1x1 (=scalar number).
Definition at line 58 of file qgsrastermatrix.h.
Referenced by QgsRasterCalculator::processCalculation(), and twoArgumentOperation().
double QgsRasterMatrix::number | ( | ) | const [inline] |
Definition at line 59 of file qgsrastermatrix.h.
Referenced by QgsRasterCalculator::processCalculation(), and twoArgumentOperation().
float* QgsRasterMatrix::data | ( | ) | [inline] |
Returns data array (but not ownership).
Definition at line 62 of file qgsrastermatrix.h.
Referenced by QgsRasterCalculator::processCalculation(), and takeData().
float * QgsRasterMatrix::takeData | ( | ) |
Returns data and ownership.
Sets data and nrows, ncols of this matrix to 0
Definition at line 67 of file qgsrastermatrix.cpp.
References data(), mColumns, mData, and mRows.
Referenced by QgsRasterCalcNode::calculate().
void QgsRasterMatrix::setData | ( | int | cols, | |
int | rows, | |||
float * | data, | |||
double | nodataValue | |||
) |
Definition at line 58 of file qgsrastermatrix.cpp.
References mColumns, mData, mNodataValue, and mRows.
Referenced by QgsRasterCalcNode::calculate().
int QgsRasterMatrix::nColumns | ( | ) | const [inline] |
Definition at line 68 of file qgsrastermatrix.h.
Referenced by QgsRasterCalcNode::calculate(), operator=(), and twoArgumentOperation().
int QgsRasterMatrix::nRows | ( | ) | const [inline] |
Definition at line 69 of file qgsrastermatrix.h.
Referenced by QgsRasterCalcNode::calculate(), operator=(), and twoArgumentOperation().
double QgsRasterMatrix::nodataValue | ( | ) | const [inline] |
Definition at line 71 of file qgsrastermatrix.h.
Referenced by QgsRasterCalcNode::calculate(), operator=(), QgsRasterCalculator::processCalculation(), and twoArgumentOperation().
void QgsRasterMatrix::setNodataValue | ( | double | d | ) | [inline] |
Definition at line 72 of file qgsrastermatrix.h.
QgsRasterMatrix & QgsRasterMatrix::operator= | ( | const QgsRasterMatrix & | m | ) |
Definition at line 46 of file qgsrastermatrix.cpp.
References mColumns, mData, mNodataValue, mRows, nColumns(), nodataValue(), and nRows().
Referenced by QgsRasterMatrix().
bool QgsRasterMatrix::add | ( | const QgsRasterMatrix & | other | ) |
Adds another matrix to this one.
Definition at line 74 of file qgsrastermatrix.cpp.
References opPLUS, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::subtract | ( | const QgsRasterMatrix & | other | ) |
Subtracts another matrix from this one.
Definition at line 79 of file qgsrastermatrix.cpp.
References opMINUS, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::multiply | ( | const QgsRasterMatrix & | other | ) |
Definition at line 84 of file qgsrastermatrix.cpp.
References opMUL, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::divide | ( | const QgsRasterMatrix & | other | ) |
Definition at line 89 of file qgsrastermatrix.cpp.
References opDIV, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::power | ( | const QgsRasterMatrix & | other | ) |
Definition at line 94 of file qgsrastermatrix.cpp.
References opPOW, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::equal | ( | const QgsRasterMatrix & | other | ) |
Definition at line 99 of file qgsrastermatrix.cpp.
References opEQ, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::notEqual | ( | const QgsRasterMatrix & | other | ) |
Definition at line 104 of file qgsrastermatrix.cpp.
References opNE, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::greaterThan | ( | const QgsRasterMatrix & | other | ) |
Definition at line 109 of file qgsrastermatrix.cpp.
References opGT, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::lesserThan | ( | const QgsRasterMatrix & | other | ) |
Definition at line 114 of file qgsrastermatrix.cpp.
References opLT, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::greaterEqual | ( | const QgsRasterMatrix & | other | ) |
Definition at line 119 of file qgsrastermatrix.cpp.
References opGE, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::lesserEqual | ( | const QgsRasterMatrix & | other | ) |
Definition at line 124 of file qgsrastermatrix.cpp.
References opLE, and twoArgumentOperation().
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::squareRoot | ( | ) |
Definition at line 129 of file qgsrastermatrix.cpp.
References oneArgumentOperation(), and opSQRT.
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::sinus | ( | ) |
Definition at line 134 of file qgsrastermatrix.cpp.
References oneArgumentOperation(), and opSIN.
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::asinus | ( | ) |
Definition at line 139 of file qgsrastermatrix.cpp.
References oneArgumentOperation(), and opASIN.
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::cosinus | ( | ) |
Definition at line 144 of file qgsrastermatrix.cpp.
References oneArgumentOperation(), and opCOS.
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::acosinus | ( | ) |
Definition at line 149 of file qgsrastermatrix.cpp.
References oneArgumentOperation(), and opACOS.
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::tangens | ( | ) |
Definition at line 154 of file qgsrastermatrix.cpp.
References oneArgumentOperation(), and opTAN.
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::atangens | ( | ) |
Definition at line 159 of file qgsrastermatrix.cpp.
References oneArgumentOperation(), and opATAN.
Referenced by QgsRasterCalcNode::calculate().
bool QgsRasterMatrix::twoArgumentOperation | ( | TwoArgOperator | op, | |
const QgsRasterMatrix & | other | |||
) | [private] |
+,-,*,/,^,<,>,<=,>=,=,!=
Definition at line 214 of file qgsrastermatrix.cpp.
References isNumber(), mColumns, mData, mNodataValue, mRows, nColumns(), nodataValue(), nRows(), number(), opDIV, opEQ, opGE, opGT, opLE, opLT, opMINUS, opMUL, opNE, opPLUS, opPOW, and testPowerValidity().
Referenced by add(), divide(), equal(), greaterEqual(), greaterThan(), lesserEqual(), lesserThan(), multiply(), notEqual(), power(), and subtract().
bool QgsRasterMatrix::oneArgumentOperation | ( | OneArgOperator | op | ) | [private] |
Definition at line 164 of file qgsrastermatrix.cpp.
References mColumns, mData, mNodataValue, mRows, opACOS, opASIN, opATAN, opCOS, opSIN, opSQRT, and opTAN.
Referenced by acosinus(), asinus(), atangens(), cosinus(), sinus(), squareRoot(), and tangens().
bool QgsRasterMatrix::testPowerValidity | ( | double | base, | |
double | power | |||
) | [private] |
int QgsRasterMatrix::mColumns [private] |
Definition at line 98 of file qgsrastermatrix.h.
Referenced by oneArgumentOperation(), operator=(), setData(), takeData(), and twoArgumentOperation().
int QgsRasterMatrix::mRows [private] |
Definition at line 99 of file qgsrastermatrix.h.
Referenced by oneArgumentOperation(), operator=(), setData(), takeData(), and twoArgumentOperation().
float* QgsRasterMatrix::mData [private] |
Definition at line 100 of file qgsrastermatrix.h.
Referenced by oneArgumentOperation(), operator=(), setData(), takeData(), twoArgumentOperation(), and ~QgsRasterMatrix().
double QgsRasterMatrix::mNodataValue [private] |
Definition at line 101 of file qgsrastermatrix.h.
Referenced by oneArgumentOperation(), operator=(), setData(), and twoArgumentOperation().