QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
src
analysis
raster
qgsrastermatrix.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrastermatrix.h
3
-----------------
4
begin : 2010-10-23
5
copyright : (C) 20010 by Marco Hugentobler
6
email : marco dot hugentobler at sourcepole dot ch
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSRASTERMATRIX_H
19
#define QGSRASTERMATRIX_H
20
24
class
ANALYSIS_EXPORT
QgsRasterMatrix
25
{
26
public
:
27
28
enum
TwoArgOperator
29
{
30
opPLUS
,
31
opMINUS
,
32
opMUL
,
33
opDIV
,
34
opPOW
,
35
opEQ
,
// =
36
opNE
,
// != resp. <>
37
opGT
,
// >
38
opLT
,
// <
39
opGE
,
// >=
40
opLE
,
// <=
41
opAND
,
42
opOR
43
};
44
45
enum
OneArgOperator
46
{
47
opSQRT
,
48
opSIN
,
49
opCOS
,
50
opTAN
,
51
opASIN
,
52
opACOS
,
53
opATAN
,
54
opSIGN
,
55
opLOG
,
56
opLOG10
,
57
};
58
60
QgsRasterMatrix
();
62
QgsRasterMatrix
(
int
nCols,
int
nRows,
double
* data,
double
nodataValue );
63
QgsRasterMatrix
(
const
QgsRasterMatrix
& m );
64
~
QgsRasterMatrix
();
65
67
bool
isNumber
()
const
{
return
( mColumns == 1 && mRows == 1 ); }
68
double
number
()
const
{
return
mData[0]; }
69
71
double
* data() {
return
mData; }
74
double
* takeData();
76
77
void
setData(
int
cols,
int
rows,
double
* data,
double
nodataValue );
78
79
int
nColumns
()
const
{
return
mColumns; }
80
int
nRows
()
const
{
return
mRows; }
81
82
double
nodataValue
()
const
{
return
mNodataValue; }
83
void
setNodataValue
(
double
d ) { mNodataValue = d; }
84
85
QgsRasterMatrix
& operator=(
const
QgsRasterMatrix
& m );
87
bool
add(
const
QgsRasterMatrix
& other );
89
bool
subtract(
const
QgsRasterMatrix
& other );
90
bool
multiply(
const
QgsRasterMatrix
& other );
91
bool
divide(
const
QgsRasterMatrix
& other );
92
bool
power
(
const
QgsRasterMatrix
& other );
93
bool
equal(
const
QgsRasterMatrix
& other );
94
bool
notEqual(
const
QgsRasterMatrix
& other );
95
bool
greaterThan(
const
QgsRasterMatrix
& other );
96
bool
lesserThan(
const
QgsRasterMatrix
& other );
97
bool
greaterEqual(
const
QgsRasterMatrix
& other );
98
bool
lesserEqual(
const
QgsRasterMatrix
& other );
99
bool
logicalAnd(
const
QgsRasterMatrix
& other );
100
bool
logicalOr(
const
QgsRasterMatrix
& other );
101
102
bool
squareRoot();
103
bool
sinus();
104
bool
asinus();
105
bool
cosinus();
106
bool
acosinus();
107
bool
tangens();
108
bool
atangens();
109
bool
changeSign();
110
bool
log();
111
bool
log10();
112
113
private
:
114
int
mColumns;
115
int
mRows;
116
double
* mData;
117
double
mNodataValue;
118
120
bool
twoArgumentOperation(
TwoArgOperator
op,
const
QgsRasterMatrix
& other );
121
double
calculateTwoArgumentOp(
TwoArgOperator
op,
double
arg1,
double
arg2 )
const
;
122
123
/*sqrt, sin, cos, tan, asin, acos, atan*/
124
bool
oneArgumentOperation(
OneArgOperator
op );
125
bool
testPowerValidity(
double
base,
double
power )
const
;
126
};
127
128
#endif // QGSRASTERMATRIX_H
QgsRasterMatrix::isNumber
bool isNumber() const
Returns true if matrix is 1x1 (=scalar number)
Definition:
qgsrastermatrix.h:67
QgsRasterMatrix::opPLUS
Definition:
qgsrastermatrix.h:30
QgsRasterMatrix::setNodataValue
void setNodataValue(double d)
Definition:
qgsrastermatrix.h:83
QgsRasterMatrix::nodataValue
double nodataValue() const
Definition:
qgsrastermatrix.h:82
QgsRasterMatrix::opLE
Definition:
qgsrastermatrix.h:40
QgsRasterMatrix::opGE
Definition:
qgsrastermatrix.h:39
QgsRasterMatrix::opDIV
Definition:
qgsrastermatrix.h:33
QgsRasterMatrix::opASIN
Definition:
qgsrastermatrix.h:51
QgsRasterMatrix::nRows
int nRows() const
Definition:
qgsrastermatrix.h:80
QgsRasterMatrix::OneArgOperator
OneArgOperator
Definition:
qgsrastermatrix.h:45
QgsRasterMatrix::opEQ
Definition:
qgsrastermatrix.h:35
QgsRasterMatrix::opSIN
Definition:
qgsrastermatrix.h:48
QgsRasterMatrix::opTAN
Definition:
qgsrastermatrix.h:50
QgsRasterMatrix::TwoArgOperator
TwoArgOperator
Definition:
qgsrastermatrix.h:28
QgsRasterMatrix::opSIGN
Definition:
qgsrastermatrix.h:54
QgsRasterMatrix::opLOG10
Definition:
qgsrastermatrix.h:56
QgsRasterMatrix::nColumns
int nColumns() const
Definition:
qgsrastermatrix.h:79
QgsRasterMatrix::opMUL
Definition:
qgsrastermatrix.h:32
QgsRasterMatrix::opNE
Definition:
qgsrastermatrix.h:36
QgsRasterMatrix
Definition:
qgsrastermatrix.h:24
QgsRasterMatrix::opSQRT
Definition:
qgsrastermatrix.h:47
MathUtils::power
double ANALYSIS_EXPORT power(double a, int b)
Power function for integer coefficients.
QgsRasterMatrix::opMINUS
Definition:
qgsrastermatrix.h:31
QgsRasterMatrix::opLT
Definition:
qgsrastermatrix.h:38
QgsRasterMatrix::number
double number() const
Definition:
qgsrastermatrix.h:68
QgsRasterMatrix::opACOS
Definition:
qgsrastermatrix.h:52
QgsRasterMatrix::opGT
Definition:
qgsrastermatrix.h:37
QgsRasterMatrix::opLOG
Definition:
qgsrastermatrix.h:55
QgsRasterMatrix::opATAN
Definition:
qgsrastermatrix.h:53
QgsRasterMatrix::opAND
Definition:
qgsrastermatrix.h:41
QgsRasterMatrix::opPOW
Definition:
qgsrastermatrix.h:34
QgsRasterMatrix::opCOS
Definition:
qgsrastermatrix.h:49
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13