Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Python bindings:
- recreate on changed .sip file - wrapped QgsColorTable git-svn-id: http://svn.osgeo.org/qgis/trunk@6776 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
wonder
committed
Mar 8, 2007
1 parent
41e63a9
commit 90c30ed
Showing
4 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
class QgsColorTable | ||
{ | ||
%TypeHeaderCode | ||
#include <qgscolortable.h> | ||
%End | ||
|
||
public: | ||
/** | ||
* \brief Constructor. | ||
* \param interp color table interpretation | ||
*/ | ||
QgsColorTable ( int interp = Rgb ); | ||
|
||
/** \brief The destuctor. */ | ||
~QgsColorTable(); | ||
|
||
/** \brief Color table interpretation. */ | ||
// This is taken from GDAL, GPI_RGB is mapped to Rgba | ||
enum Interp { | ||
Gray = 0, // Use c1 as grayscale value. | ||
Rgb, // Use c1 as red, c2 as green, c3 as blue | ||
Rgba, // Use c1 as red, c2 as green, c3 as blue and c4 as alpha. | ||
Cmyk, // Use c1 as cyan, c2 as magenta, c3 as yellow and c4 as black. | ||
Hls // c1 hue, c2 lightness, c3 saturation; should be His ? | ||
}; | ||
|
||
/** | ||
* \brief Color table is defined | ||
* \return true if at least one rule is defined | ||
* \false no rule defined | ||
*/ | ||
bool defined ( ); | ||
|
||
/** \brief Get color table interpretation */ | ||
int interpretation ( ); | ||
|
||
/** \brief Add a discrete color */ | ||
void add ( unsigned int index, unsigned char c1, unsigned char c2, unsigned char c3, unsigned char c4 = 0 ); | ||
|
||
/** \brief Add a ramp rule */ | ||
void add ( double min, double max, | ||
unsigned char min_c1, unsigned char min_c2, unsigned char min_c3, unsigned char min_c4, | ||
unsigned char max_c1, unsigned char max_c2, unsigned char max_c3, unsigned char max_c4); | ||
|
||
/** \brief Get color | ||
* \return true color was found | ||
* \return false color was no found | ||
*/ | ||
bool color ( double value, int *c1, int *c2, int *c3 ); | ||
|
||
/** \brief Sort ramp rules */ | ||
void sort ( ); | ||
|
||
/** \brief Print to stderr - for debuging */ | ||
void print ( ); | ||
|
||
/** \brief Minimum value */ | ||
double rmin(); | ||
|
||
/** \brief Maximum value */ | ||
double rmax(); | ||
|
||
/** \brief Clear the color table */ | ||
void clear(); | ||
void gack(); | ||
|
||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters