/
qgscolorrampshader.sip
67 lines (51 loc) · 2.14 KB
/
qgscolorrampshader.sip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
class QgsColorRampShader : QgsRasterShaderFunction
{
%TypeHeaderCode
#include <qgscolorrampshader.h>
%End
public:
QgsColorRampShader( double theMinimumValue = 0.0, double theMaximumValue = 255.0 );
//An entry for classification based upon value.
//Such a classification is typically used for
//single band layers where a pixel value represents
//not a color but a quantity, e.g. temperature or elevation
struct ColorRampItem
{
//! default constructor
ColorRampItem();
//! convenience constructor - added in v1.6
ColorRampItem( double val, QColor col, QString lbl = QString() );
QString label;
double value;
QColor color;
// compare operator for sorting
bool operator<( const QgsColorRampShader::ColorRampItem& other ) const;
};
enum ColorRamp_TYPE
{
INTERPOLATED,
DISCRETE,
EXACT
};
/** \brief Get the custom colormap*/
QList<QgsColorRampShader::ColorRampItem> colorRampItemList() const;
/** \brief Get the color ramp type */
QgsColorRampShader::ColorRamp_TYPE colorRampType() const;
/** \brief Get the color ramp type as a string */
QString colorRampTypeAsQString();
/** \brief Get the maximum size the color cache can be*/
int maximumColorCacheSize();
/** \brief Set custom colormap */
void setColorRampItemList( const QList<QgsColorRampShader::ColorRampItem>& theList ); //TODO: sort on set
/** \brief Set the color ramp type*/
void setColorRampType( QgsColorRampShader::ColorRamp_TYPE theColorRampType );
/** \brief Set the color ramp type*/
void setColorRampType( QString );
/** \brief Set the maximum size the color cache can be */
void setMaximumColorCacheSize( int theSize );
/** \brief Generates and new RGB value based on one input value */
bool shade( double, int* /Out/, int* /Out/, int* /Out/, int* /Out/ );
/** \brief Generates and new RGB value based on original RGB value */
bool shade( double, double, double, double, int* /Out/, int* /Out/, int* /Out/, int* /Out/);
void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;
};