QGIS API Documentation
2.14.0-Essen
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
21
class
ANALYSIS_EXPORT
QgsRasterMatrix
22
{
23
public
:
24
25
enum
TwoArgOperator
26
{
27
opPLUS
,
28
opMINUS
,
29
opMUL
,
30
opDIV
,
31
opPOW
,
32
opEQ
,
// =
33
opNE
,
// != resp. <>
34
opGT
,
// >
35
opLT
,
// <
36
opGE
,
// >=
37
opLE
,
// <=
38
opAND
,
39
opOR
40
};
41
42
enum
OneArgOperator
43
{
44
opSQRT
,
45
opSIN
,
46
opCOS
,
47
opTAN
,
48
opASIN
,
49
opACOS
,
50
opATAN
,
51
opSIGN
,
52
opLOG
,
53
opLOG10
,
54
};
55
57
QgsRasterMatrix
();
59
QgsRasterMatrix
(
int
nCols,
int
nRows,
double
* data,
double
nodataValue );
60
QgsRasterMatrix
(
const
QgsRasterMatrix
& m );
61
~
QgsRasterMatrix
();
62
64
bool
isNumber
()
const
{
return
( mColumns == 1 && mRows == 1 ); }
65
double
number
()
const
{
return
mData[0]; }
66
68
double
* data() {
return
mData; }
71
double
* takeData();
73
74
void
setData(
int
cols,
int
rows,
double
* data,
double
nodataValue );
75
76
int
nColumns
()
const
{
return
mColumns; }
77
int
nRows
()
const
{
return
mRows; }
78
79
double
nodataValue
()
const
{
return
mNodataValue; }
80
void
setNodataValue
(
double
d ) { mNodataValue = d; }
81
82
QgsRasterMatrix
& operator=(
const
QgsRasterMatrix
& m );
84
bool
add(
const
QgsRasterMatrix
& other );
86
bool
subtract(
const
QgsRasterMatrix
& other );
87
bool
multiply(
const
QgsRasterMatrix
& other );
88
bool
divide(
const
QgsRasterMatrix
& other );
89
bool
power
(
const
QgsRasterMatrix
& other );
90
bool
equal(
const
QgsRasterMatrix
& other );
91
bool
notEqual(
const
QgsRasterMatrix
& other );
92
bool
greaterThan(
const
QgsRasterMatrix
& other );
93
bool
lesserThan(
const
QgsRasterMatrix
& other );
94
bool
greaterEqual(
const
QgsRasterMatrix
& other );
95
bool
lesserEqual(
const
QgsRasterMatrix
& other );
96
bool
logicalAnd(
const
QgsRasterMatrix
& other );
97
bool
logicalOr(
const
QgsRasterMatrix
& other );
98
99
bool
squareRoot();
100
bool
sinus();
101
bool
asinus();
102
bool
cosinus();
103
bool
acosinus();
104
bool
tangens();
105
bool
atangens();
106
bool
changeSign();
107
bool
log();
108
bool
log10();
109
110
private
:
111
int
mColumns;
112
int
mRows;
113
double
* mData;
114
double
mNodataValue;
115
117
bool
twoArgumentOperation(
TwoArgOperator
op,
const
QgsRasterMatrix
& other );
118
double
calculateTwoArgumentOp(
TwoArgOperator
op,
double
arg1,
double
arg2 )
const
;
119
120
/*sqrt, sin, cos, tan, asin, acos, atan*/
121
bool
oneArgumentOperation(
OneArgOperator
op );
122
bool
testPowerValidity(
double
base,
double
power )
const
;
123
};
124
125
#endif // QGSRASTERMATRIX_H
QgsRasterMatrix::opPLUS
Definition:
qgsrastermatrix.h:27
QgsRasterMatrix::setNodataValue
void setNodataValue(double d)
Definition:
qgsrastermatrix.h:80
QgsRasterMatrix::opLE
Definition:
qgsrastermatrix.h:37
QgsRasterMatrix::nColumns
int nColumns() const
Definition:
qgsrastermatrix.h:76
QgsRasterMatrix::opGE
Definition:
qgsrastermatrix.h:36
QgsRasterMatrix::opDIV
Definition:
qgsrastermatrix.h:30
QgsRasterMatrix::opASIN
Definition:
qgsrastermatrix.h:48
QgsRasterMatrix::OneArgOperator
OneArgOperator
Definition:
qgsrastermatrix.h:42
QgsRasterMatrix::number
double number() const
Definition:
qgsrastermatrix.h:65
QgsRasterMatrix::opEQ
Definition:
qgsrastermatrix.h:32
QgsRasterMatrix::opSIN
Definition:
qgsrastermatrix.h:45
QgsRasterMatrix::opTAN
Definition:
qgsrastermatrix.h:47
QgsRasterMatrix::nRows
int nRows() const
Definition:
qgsrastermatrix.h:77
QgsRasterMatrix::TwoArgOperator
TwoArgOperator
Definition:
qgsrastermatrix.h:25
QgsRasterMatrix::opSIGN
Definition:
qgsrastermatrix.h:51
QgsRasterMatrix::opLOG10
Definition:
qgsrastermatrix.h:53
QgsRasterMatrix::opMUL
Definition:
qgsrastermatrix.h:29
QgsRasterMatrix::opNE
Definition:
qgsrastermatrix.h:33
QgsRasterMatrix::isNumber
bool isNumber() const
Returns true if matrix is 1x1 (=scalar number)
Definition:
qgsrastermatrix.h:64
QgsRasterMatrix
Definition:
qgsrastermatrix.h:21
QgsRasterMatrix::opSQRT
Definition:
qgsrastermatrix.h:44
MathUtils::power
double ANALYSIS_EXPORT power(double a, int b)
Power function for integer coefficients.
QgsRasterMatrix::opMINUS
Definition:
qgsrastermatrix.h:28
QgsRasterMatrix::nodataValue
double nodataValue() const
Definition:
qgsrastermatrix.h:79
QgsRasterMatrix::opLT
Definition:
qgsrastermatrix.h:35
QgsRasterMatrix::opACOS
Definition:
qgsrastermatrix.h:49
QgsRasterMatrix::opGT
Definition:
qgsrastermatrix.h:34
QgsRasterMatrix::opLOG
Definition:
qgsrastermatrix.h:52
QgsRasterMatrix::opATAN
Definition:
qgsrastermatrix.h:50
QgsRasterMatrix::opAND
Definition:
qgsrastermatrix.h:38
QgsRasterMatrix::opPOW
Definition:
qgsrastermatrix.h:31
QgsRasterMatrix::opCOS
Definition:
qgsrastermatrix.h:46
Generated on Sat Feb 27 2016 18:33:25 for QGIS API Documentation by
1.8.11