@@ -10,12 +10,125 @@ public:
10
10
virtual ~QgsRasterShaderFunction();
11
11
12
12
/** \brief generates and new RGB value based on one input value */
13
- virtual bool shade(double, int*, int*, int*);
13
+ virtual bool shade(double, int* /Out/ , int* /Out/ , int* /Out/ );
14
14
/** \brief generates and new RGB value based on original RGB value */
15
- virtual bool shade(double, double, double, int*, int*, int*);
15
+ virtual bool shade(double, double, double, int* /Out/ , int* /Out/ , int* /Out/ );
16
16
17
17
/** \brief Set the maximum value */
18
18
virtual void setMaximumValue(double);
19
19
/** \brief Return the minimum value */
20
20
virtual void setMinimumValue(double);
21
21
};
22
+
23
+ //////////////
24
+
25
+ class QgsColorRampShader : QgsRasterShaderFunction
26
+ {
27
+ %TypeHeaderCode
28
+ #include <qgscolorrampshader.h>
29
+ %End
30
+
31
+ public:
32
+ QgsColorRampShader( double theMinimumValue = 0.0, double theMaximumValue = 255.0 );
33
+
34
+ //An entry for classification based upon value.
35
+ //Such a classification is typically used for
36
+ //single band layers where a pixel value represents
37
+ //not a color but a quantity, e.g. temperature or elevation
38
+ struct ColorRampItem
39
+ {
40
+ QString label;
41
+ double value;
42
+ QColor color;
43
+
44
+ // compare operator for sorting
45
+ //bool operator<( const ColorRampItem& other ) const;
46
+ };
47
+
48
+ enum ColorRamp_TYPE
49
+ {
50
+ INTERPOLATED,
51
+ DISCRETE,
52
+ EXACT
53
+ };
54
+
55
+ /** \brief Get the custom colormap*/
56
+ QList<QgsColorRampShader::ColorRampItem> colorRampItemList() const;
57
+
58
+ /** \brief Get the color ramp type */
59
+ QgsColorRampShader::ColorRamp_TYPE colorRampType();
60
+
61
+ /** \brief Get the color ramp type as a string */
62
+ QString colorRampTypeAsQString();
63
+
64
+ /** \brief Get the maximum size the color cache can be*/
65
+ int maximumColorCacheSize();
66
+
67
+ /** \brief Set custom colormap */
68
+ void setColorRampItemList( const QList<QgsColorRampShader::ColorRampItem>& theList );
69
+
70
+ /** \brief Set the color ramp type*/
71
+ void setColorRampType( QgsColorRampShader::ColorRamp_TYPE theColorRampType );
72
+
73
+ /** \brief Set the color ramp type*/
74
+ void setColorRampType( QString );
75
+
76
+ /** \brief Set the maximum size the color cache can be */
77
+ void setMaximumColorCacheSize( int theSize );
78
+
79
+ /** \brief Generates and new RGB value based on one input value */
80
+ bool shade( double, int* /Out/, int* /Out/, int* /Out/);
81
+
82
+ /** \brief Generates and new RGB value based on original RGB value */
83
+ bool shade( double, double, double, int* /Out/, int* /Out/, int* /Out/);
84
+
85
+ };
86
+
87
+ //////////////
88
+
89
+ class QgsFreakOutShader : QgsRasterShaderFunction
90
+ {
91
+ %TypeHeaderCode
92
+ #include <qgsfreakoutshader.h>
93
+ %End
94
+
95
+ public:
96
+ QgsFreakOutShader( double theMinimumValue = 0.0, double theMaximumValue = 255.0 );
97
+
98
+ /** \brief generates and new RGB value based on one input value */
99
+ bool shade( double, int* /Out/, int* /Out/, int* /Out/);
100
+
101
+ /** \brief generates and new RGB value based on original RGB value */
102
+ bool shade( double, double, double, int* /Out/, int* /Out/, int* /Out/);
103
+
104
+ /** \brief Set the maximum value */
105
+ void setMaximumValue( double );
106
+
107
+ /** \brief Return the minimum value */
108
+ void setMinimumValue( double );
109
+ };
110
+
111
+ //////////////
112
+
113
+ class QgsPseudoColorShader : QgsRasterShaderFunction
114
+ {
115
+ %TypeHeaderCode
116
+ #include <qgspseudocolorshader.h>
117
+ %End
118
+
119
+ public:
120
+ QgsPseudoColorShader( double theMinimumValue = 0.0, double theMaximumValue = 255.0 );
121
+
122
+ /** \brief generates and new RGB value based on one input value */
123
+ bool shade( double, int* /Out/, int* /Out/, int* /Out/);
124
+
125
+ /** \brief generates and new RGB value based on original RGB value */
126
+ bool shade( double, double, double, int* /Out/, int* /Out/, int* /Out/);
127
+
128
+ /** \brief Set the maximum value */
129
+ void setMaximumValue( double );
130
+
131
+ /** \brief Return the minimum value */
132
+ void setMinimumValue( double );
133
+
134
+ };
0 commit comments