Go to the documentation of this file.
   26 #ifndef __TERRALIB_COLOR_INTERNAL_RGBACOLOR_H 
   27 #define __TERRALIB_COLOR_INTERNAL_RGBACOLOR_H 
   30 #include "../core/utils/HexUtils.h" 
  190         void getRgba(
int* r, 
int* g, 
int* b, 
int* a=0) 
const;
 
  210         void setColor(
const std::string& hexColor);
 
  232         void setColor(
int r, 
int g, 
int b, 
int a=255);
 
  266       : m_rgba((a << 24) + (r << 16) + (g << 8) + b)
 
  268       assert(r >= 0 && r <= 255);
 
  269       assert(g >= 0 && g <= 255);
 
  270       assert(b >= 0 && b <= 255);
 
  271       assert(a >= 0 && a <= 255);
 
  309       return (((
m_rgba) & 0xFF0000) >> 16);
 
  314       return (((
m_rgba) & 0x00FF00) >> 8);
 
  319       return ((
m_rgba) & 0x0000FF);
 
  324       return (((
m_rgba) & 0xFF000000) >> 24);
 
  330         *a = (
m_rgba & 0xFF000000) >> 24;
 
  331       *r = (
m_rgba & 0xFF0000) >> 16;
 
  332       *g = (
m_rgba & 0xFF00) >> 8;
 
  343       assert((hexColor.size() >= 7) && (hexColor.size() <= 9));
 
  344       assert(hexColor[0] == 
'#');
 
  349       if (hexColor.size() == 9)
 
  353         a = int((highA << 4) + lowA);
 
  358       int r = int((highR << 4) + lowR);
 
  362       int g = int((highG << 4) + lowG);
 
  366       int b = int((highB << 4) + lowB);
 
  377         std::string result(buffer);
 
  384         std::string result(buffer);
 
  391       m_rgba = (a << 24) + (r << 16) + (g << 8) + b;
 
  402 #endif  // __TERRALIB_COLOR_INTERNAL_RGBACOLOR_H 
  
 
bool operator!=(const RGBAColor &color) const
It compares the colors are different.
 
int getGreen() const
It returns the green component color value (a value from 0 to 255).
 
unsigned char GetDecimalFromHexNotCS(unsigned char hexValue)
It returns the decimal value in a char from a given hex value (for example: 'A' => 10,...
 
@ HexRgb
enum value, format #RRGGBB
 
std::string getColor(const NameFormat format=HexRgb) const
It gets the color encoded using two hexadecimal digits per primary-color component,...
 
int getRgba() const
It returns the color value (0xAARRGGBB).
 
bool operator==(const RGBAColor &color) const
It compares the colors are iqual.
 
int m_rgba
It returns the internal representation as a 32-bits RGBA color.
 
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
 
@ HexArgb
enum value, format #AARRGGBB
 
RGBAColor()
Default constructor of a new color.
 
int getRed() const
It returns the red component color value (a value from 0 to 255).
 
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
 
int getAlpha() const
It returns the alpha component color value (a value from 0 to 255).
 
void setColor(const std::string &hexColor)
It sets the color using a two hexadecimal RGB-encoded color.
 
NameFormat
NameFormat enum.
 
Proxy configuration file for TerraView (see terraview_config.h).
 
int getBlue() const
It returns the blue component color value (a value from 0 to 255).
 
te::color::RGBAColor & operator=(const RGBAColor &color)
Assigns a copy of a color to this color, and returns a reference to it.