Quantum GIS API Documentation
1.7.5-Wroclaw
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
core
raster
qgscontrastenhancement.h
Go to the documentation of this file.
1
/* **************************************************************************
2
qgscontrastenhancement.h - description
3
-------------------
4
begin : Mon Oct 22 2007
5
copyright : (C) 2007 by Peter J. Ersts
6
email : ersts@amnh.org
7
8
This class contains code that was originally part of the larger QgsRasterLayer
9
class originally created circa 2004 by T.Sutton, Gary E.Sherman, Steve Halasz
10
****************************************************************************/
11
12
/* **************************************************************************
13
* *
14
* This program is free software; you can redistribute it and/or modify *
15
* it under the terms of the GNU General Public License as published by *
16
* the Free Software Foundation; either version 2 of the License, or *
17
* (at your option) any later version. *
18
* *
19
***************************************************************************/
20
21
#ifndef QGSCONTRASTENHANCEMENT_H
22
#define QGSCONTRASTENHANCEMENT_H
23
24
#include <limits>
25
26
class
QgsContrastEnhancementFunction
;
27
33
class
CORE_EXPORT
QgsContrastEnhancement
34
{
35
36
public
:
37
39
enum
ContrastEnhancementAlgorithm
40
{
41
NoEnhancement
,
//this should be the default color scaling algorithm
42
StretchToMinimumMaximum
,
//linear histogram enhanceContrast
43
StretchAndClipToMinimumMaximum
,
44
ClipToMinimumMaximum
,
45
UserDefinedEnhancement
46
};
47
55
enum
QgsRasterDataType
56
{
57
QGS_Unknown = 0, QGS_Byte = 1, QGS_UInt16 = 2, QGS_Int16 = 3, QGS_UInt32 = 4, QGS_Int32 = 5, QGS_Float32 = 6, QGS_Float64 = 7, QGS_CInt16 = 8, QGS_CInt32 = 9, QGS_CFloat32 = 10, QGS_CFloat64 = 11,
69
QGS_TypeCount = 12
/* maximum type # + 1 */
70
};
71
72
QgsContrastEnhancement
(
QgsContrastEnhancement::QgsRasterDataType
theDatatype = QGS_Byte );
73
~
QgsContrastEnhancement
();
74
75
/*
76
*
77
* Static methods
78
*
79
*/
81
static
double
maximumValuePossible( QgsRasterDataType );
82
84
static
double
minimumValuePossible( QgsRasterDataType );
85
86
/*
87
*
88
* Non-Static Inline methods
89
*
90
*/
92
double
maximumValue
()
const
{
return
mMaximumValue; }
93
95
double
minimumValue
()
const
{
return
mMinimumValue; }
96
97
ContrastEnhancementAlgorithm
contrastEnhancementAlgorithm
() {
return
mContrastEnhancementAlgorithm; }
98
99
/*
100
*
101
* Non-Static methods
102
*
103
*/
105
int
enhanceContrast(
double
);
106
108
bool
isValueInDisplayableRange(
double
);
109
111
void
setContrastEnhancementAlgorithm( ContrastEnhancementAlgorithm,
bool
generateTable =
true
);
112
114
void
setContrastEnhancementFunction(
QgsContrastEnhancementFunction
* );
115
117
void
setMaximumValue(
double
,
bool
generateTable =
true
);
118
120
void
setMinimumValue(
double
,
bool
generateTable =
true
);
121
122
private
:
124
ContrastEnhancementAlgorithm
mContrastEnhancementAlgorithm
;
125
127
QgsContrastEnhancementFunction
*
mContrastEnhancementFunction
;
128
130
bool
mEnhancementDirty
;
131
133
double
mLookupTableOffset
;
134
136
int
*
mLookupTable
;
137
139
double
mMinimumValue
;
140
142
double
mMaximumValue
;
143
145
QgsRasterDataType
mRasterDataType
;
146
148
double
mRasterDataTypeRange
;
149
150
151
153
bool
generateLookupTable();
154
156
int
calculateContrastEnhancementValue(
double
);
157
};
158
159
#endif
Generated on Thu Sep 19 2013 17:30:55 for Quantum GIS API Documentation by
1.8.4