QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
QgsRasterMatrix Class Reference

#include <qgsrastermatrix.h>

Public Types

enum  TwoArgOperator {
  opPLUS, opMINUS, opMUL, opDIV,
  opPOW, opEQ, opNE, opGT,
  opLT, opGE, opLE, opAND,
  opOR
}
enum  OneArgOperator {
  opSQRT, opSIN, opCOS, opTAN,
  opASIN, opACOS, opATAN, opSIGN
}

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)
QgsRasterMatrixoperator= (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 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 ()

Private Member Functions

bool twoArgumentOperation (TwoArgOperator op, const QgsRasterMatrix &other)
 +,-,*,/,^,<,>,<=,>=,=,!=, and, or
bool oneArgumentOperation (OneArgOperator op)
bool testPowerValidity (double base, double power)

Private Attributes

int mColumns
int mRows
float * mData
double mNodataValue

Detailed Description

Definition at line 21 of file qgsrastermatrix.h.

Member Enumeration Documentation

Enumerator:
opSQRT 
opSIN 
opCOS 
opTAN 
opASIN 
opACOS 
opATAN 
opSIGN 

Definition at line 42 of file qgsrastermatrix.h.

Enumerator:
opPLUS 
opMINUS 
opMUL 
opDIV 
opPOW 
opEQ 
opNE 
opGT 
opLT 
opGE 
opLE 
opAND 
opOR 

Definition at line 25 of file qgsrastermatrix.h.

Constructor & Destructor Documentation

QgsRasterMatrix::QgsRasterMatrix ( )

Takes ownership of data array.

Definition at line 23 of file qgsrastermatrix.cpp.

QgsRasterMatrix::QgsRasterMatrix ( int  nCols,
int  nRows,
float *  data,
double  nodataValue 
)
Note
note available in python bindings

Definition at line 27 of file qgsrastermatrix.cpp.

QgsRasterMatrix::QgsRasterMatrix ( const QgsRasterMatrix m)

Definition at line 32 of file qgsrastermatrix.cpp.

References operator=().

QgsRasterMatrix::~QgsRasterMatrix ( )

Definition at line 37 of file qgsrastermatrix.cpp.

References mData.

Member Function Documentation

bool QgsRasterMatrix::acosinus ( )

Definition at line 155 of file qgsrastermatrix.cpp.

References oneArgumentOperation(), and opACOS.

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::add ( const QgsRasterMatrix other)

Adds another matrix to this one.

Definition at line 70 of file qgsrastermatrix.cpp.

References opPLUS, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::asinus ( )

Definition at line 145 of file qgsrastermatrix.cpp.

References oneArgumentOperation(), and opASIN.

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::atangens ( )

Definition at line 165 of file qgsrastermatrix.cpp.

References oneArgumentOperation(), and opATAN.

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::changeSign ( )

Definition at line 170 of file qgsrastermatrix.cpp.

References oneArgumentOperation(), and opSIGN.

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::cosinus ( )

Definition at line 150 of file qgsrastermatrix.cpp.

References oneArgumentOperation(), and opCOS.

Referenced by QgsRasterCalcNode::calculate().

float* QgsRasterMatrix::data ( )
inline

Returns data array (but not ownership)

Note
not available in python bindings

Definition at line 67 of file qgsrastermatrix.h.

Referenced by QgsRasterCalculator::processCalculation(), setData(), and takeData().

bool QgsRasterMatrix::divide ( const QgsRasterMatrix other)

Definition at line 85 of file qgsrastermatrix.cpp.

References opDIV, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::equal ( const QgsRasterMatrix other)

Definition at line 95 of file qgsrastermatrix.cpp.

References opEQ, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::greaterEqual ( const QgsRasterMatrix other)

Definition at line 115 of file qgsrastermatrix.cpp.

References opGE, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::greaterThan ( const QgsRasterMatrix other)

Definition at line 105 of file qgsrastermatrix.cpp.

References opGT, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::isNumber ( ) const
inline

Returns true if matrix is 1x1 (=scalar number)

Definition at line 62 of file qgsrastermatrix.h.

Referenced by QgsRasterCalculator::processCalculation(), and twoArgumentOperation().

bool QgsRasterMatrix::lesserEqual ( const QgsRasterMatrix other)

Definition at line 120 of file qgsrastermatrix.cpp.

References opLE, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::lesserThan ( const QgsRasterMatrix other)

Definition at line 110 of file qgsrastermatrix.cpp.

References opLT, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::logicalAnd ( const QgsRasterMatrix other)

Definition at line 125 of file qgsrastermatrix.cpp.

References opAND, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::logicalOr ( const QgsRasterMatrix other)

Definition at line 130 of file qgsrastermatrix.cpp.

References opOR, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::multiply ( const QgsRasterMatrix other)

Definition at line 80 of file qgsrastermatrix.cpp.

References opMUL, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

int QgsRasterMatrix::nColumns ( ) const
inline

Definition at line 74 of file qgsrastermatrix.h.

Referenced by QgsRasterCalcNode::calculate(), operator=(), and twoArgumentOperation().

double QgsRasterMatrix::nodataValue ( ) const
inline
bool QgsRasterMatrix::notEqual ( const QgsRasterMatrix other)

Definition at line 100 of file qgsrastermatrix.cpp.

References opNE, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

int QgsRasterMatrix::nRows ( ) const
inline

Definition at line 75 of file qgsrastermatrix.h.

Referenced by QgsRasterCalcNode::calculate(), operator=(), and twoArgumentOperation().

double QgsRasterMatrix::number ( ) const
inline
bool QgsRasterMatrix::oneArgumentOperation ( OneArgOperator  op)
private
QgsRasterMatrix & QgsRasterMatrix::operator= ( const QgsRasterMatrix m)

Definition at line 42 of file qgsrastermatrix.cpp.

References mColumns, mData, mNodataValue, mRows, nColumns(), nodataValue(), and nRows().

Referenced by QgsRasterMatrix().

bool QgsRasterMatrix::power ( const QgsRasterMatrix other)

Definition at line 90 of file qgsrastermatrix.cpp.

References opPOW, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

void QgsRasterMatrix::setData ( int  cols,
int  rows,
float *  data,
double  nodataValue 
)

Definition at line 54 of file qgsrastermatrix.cpp.

References data(), mColumns, mData, mNodataValue, mRows, and nodataValue().

Referenced by QgsRasterCalcNode::calculate().

void QgsRasterMatrix::setNodataValue ( double  d)
inline

Definition at line 78 of file qgsrastermatrix.h.

bool QgsRasterMatrix::sinus ( )

Definition at line 140 of file qgsrastermatrix.cpp.

References oneArgumentOperation(), and opSIN.

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::squareRoot ( )

Definition at line 135 of file qgsrastermatrix.cpp.

References oneArgumentOperation(), and opSQRT.

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::subtract ( const QgsRasterMatrix other)

Subtracts another matrix from this one.

Definition at line 75 of file qgsrastermatrix.cpp.

References opMINUS, and twoArgumentOperation().

Referenced by QgsRasterCalcNode::calculate().

float * QgsRasterMatrix::takeData ( )

Returns data and ownership.

Sets data and nrows, ncols of this matrix to 0

Note
not available in python bindings

Definition at line 63 of file qgsrastermatrix.cpp.

References data(), mColumns, mData, and mRows.

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::tangens ( )

Definition at line 160 of file qgsrastermatrix.cpp.

References oneArgumentOperation(), and opTAN.

Referenced by QgsRasterCalcNode::calculate().

bool QgsRasterMatrix::testPowerValidity ( double  base,
double  power 
)
private

Definition at line 541 of file qgsrastermatrix.cpp.

Referenced by twoArgumentOperation().

bool QgsRasterMatrix::twoArgumentOperation ( TwoArgOperator  op,
const QgsRasterMatrix other 
)
private

Member Data Documentation

int QgsRasterMatrix::mColumns
private
float* QgsRasterMatrix::mData
private
double QgsRasterMatrix::mNodataValue
private

Definition at line 110 of file qgsrastermatrix.h.

Referenced by oneArgumentOperation(), operator=(), setData(), and twoArgumentOperation().

int QgsRasterMatrix::mRows
private

The documentation for this class was generated from the following files: