QGIS API Documentation
2.4.0-Chugiak
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
};
53
55
QgsRasterMatrix
();
57
QgsRasterMatrix
(
int
nCols,
int
nRows,
float
* data,
double
nodataValue );
58
QgsRasterMatrix
(
const
QgsRasterMatrix
& m );
59
~
QgsRasterMatrix
();
60
62
bool
isNumber
()
const
{
return
( mColumns == 1 && mRows == 1 ); }
63
double
number
()
const
{
return
mData[0]; }
64
66
float
* data() {
return
mData; }
69
float
* takeData();
71
72
void
setData(
int
cols,
int
rows,
float
* data,
double
nodataValue );
73
74
int
nColumns
()
const
{
return
mColumns; }
75
int
nRows
()
const
{
return
mRows; }
76
77
double
nodataValue
()
const
{
return
mNodataValue; }
78
void
setNodataValue
(
double
d ) { mNodataValue = d; }
79
80
QgsRasterMatrix
& operator=(
const
QgsRasterMatrix
& m );
82
bool
add(
const
QgsRasterMatrix
& other );
84
bool
subtract(
const
QgsRasterMatrix
& other );
85
bool
multiply(
const
QgsRasterMatrix
& other );
86
bool
divide(
const
QgsRasterMatrix
& other );
87
bool
power
(
const
QgsRasterMatrix
& other );
88
bool
equal(
const
QgsRasterMatrix
& other );
89
bool
notEqual(
const
QgsRasterMatrix
& other );
90
bool
greaterThan(
const
QgsRasterMatrix
& other );
91
bool
lesserThan(
const
QgsRasterMatrix
& other );
92
bool
greaterEqual(
const
QgsRasterMatrix
& other );
93
bool
lesserEqual(
const
QgsRasterMatrix
& other );
94
bool
logicalAnd(
const
QgsRasterMatrix
& other );
95
bool
logicalOr(
const
QgsRasterMatrix
& other );
96
97
bool
squareRoot();
98
bool
sinus();
99
bool
asinus();
100
bool
cosinus();
101
bool
acosinus();
102
bool
tangens();
103
bool
atangens();
104
bool
changeSign();
105
106
private
:
107
int
mColumns
;
108
int
mRows
;
109
float
*
mData
;
110
double
mNodataValue
;
111
113
bool
twoArgumentOperation(
TwoArgOperator
op,
const
QgsRasterMatrix
& other );
114
/*sqrt, sin, cos, tan, asin, acos, atan*/
115
bool
oneArgumentOperation(
OneArgOperator
op );
116
bool
testPowerValidity(
double
base,
double
power
);
117
};
118
119
#endif // QGSRASTERMATRIX_H
QgsRasterMatrix::mData
float * mData
Definition:
qgsrastermatrix.h:109
QgsRasterMatrix::opPLUS
Definition:
qgsrastermatrix.h:27
QgsRasterMatrix::mNodataValue
double mNodataValue
Definition:
qgsrastermatrix.h:110
QgsRasterMatrix::setNodataValue
void setNodataValue(double d)
Definition:
qgsrastermatrix.h:78
QgsRasterMatrix::opLE
Definition:
qgsrastermatrix.h:37
QgsRasterMatrix::nColumns
int nColumns() const
Definition:
qgsrastermatrix.h:74
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:63
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:75
QgsRasterMatrix::TwoArgOperator
TwoArgOperator
Definition:
qgsrastermatrix.h:25
QgsRasterMatrix::mRows
int mRows
Definition:
qgsrastermatrix.h:108
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:62
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:77
QgsRasterMatrix::opLT
Definition:
qgsrastermatrix.h:35
QgsRasterMatrix::opACOS
Definition:
qgsrastermatrix.h:49
QgsRasterMatrix::opGT
Definition:
qgsrastermatrix.h:34
QgsRasterMatrix::opATAN
Definition:
qgsrastermatrix.h:50
QgsRasterMatrix::mColumns
int mColumns
Definition:
qgsrastermatrix.h:107
QgsRasterMatrix::opAND
Definition:
qgsrastermatrix.h:38
QgsRasterMatrix::opPOW
Definition:
qgsrastermatrix.h:31
QgsRasterMatrix::opCOS
Definition:
qgsrastermatrix.h:46
Generated on Wed Mar 18 2015 11:40:11 for QGIS API Documentation by
1.8.9.1