QGIS API Documentation
2.8.2-Wien
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
src
core
raster
qgsraster.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsraster.cpp - Raster namespace
3
--------------------------------------
4
Date : Apr, 2013
5
Copyright : (C) 2013 by Radim Blazek
6
email : radim dot blazek at gmail dot com
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
#include "
qgsraster.h
"
19
20
QString
QgsRaster::contrastEnhancementLimitsAsString
(
ContrastEnhancementLimits
theLimits )
21
{
22
switch
( theLimits )
23
{
24
case
QgsRaster::ContrastEnhancementMinMax
:
25
return
"MinMax"
;
26
break
;
27
case
QgsRaster::ContrastEnhancementStdDev
:
28
return
"StdDev"
;
29
break
;
30
case
QgsRaster::ContrastEnhancementCumulativeCut
:
31
return
"CumulativeCut"
;
32
break
;
33
default
:
34
break
;
35
}
36
return
"None"
;
37
}
38
39
QgsRaster::ContrastEnhancementLimits
QgsRaster::contrastEnhancementLimitsFromString
( QString theLimits )
40
{
41
if
( theLimits ==
"MinMax"
)
42
{
43
return
ContrastEnhancementMinMax
;
44
}
45
else
if
( theLimits ==
"StdDev"
)
46
{
47
return
ContrastEnhancementStdDev
;
48
}
49
else
if
( theLimits ==
"CumulativeCut"
)
50
{
51
return
ContrastEnhancementCumulativeCut
;
52
}
53
return
ContrastEnhancementNone
;
54
}
55
56
double
QgsRaster::representableValue
(
double
value,
QGis::DataType
dataType )
57
{
58
switch
( dataType )
59
{
60
case
QGis::Byte
:
61
return
static_cast<
quint8
>
( value );
62
case
QGis::UInt16
:
63
return
static_cast<
quint16
>
( value );
64
case
QGis::Int16
:
65
return
static_cast<
qint16
>
( value );
66
case
QGis::UInt32
:
67
return
static_cast<
quint32
>
( value );
68
case
QGis::Int32
:
69
return
static_cast<
qint32
>
( value );
70
case
QGis::Float32
:
71
return
static_cast<
float
>
( value );
72
default
:
73
break
;
74
}
75
return
value;
76
}
Generated on Sun May 10 2015 16:33:25 for QGIS API Documentation by
1.8.1.2