32 #if defined(Color_RECURSES)
33 #error Recursive header files inclusion detected in Color.h
36 #define Color_RECURSES
45 #include "DGtal/base/Common.h"
46 #include <boost/lexical_cast.hpp>
87 Color(
const unsigned int aRgb,
88 unsigned char aAlpha = 255 );
106 Color(
const unsigned char aRedValue,
107 const unsigned char aGreenValue,
108 const unsigned char aBlueValue,
109 const unsigned char aAlphaValue = 255 )
121 unsigned char aAlphaValue = 255 )
136 void red(
const unsigned char aRedValue );
138 void green(
const unsigned char aGreenValue );
140 void blue(
const unsigned char aBlueValue );
142 void alpha(
const unsigned char aAlphaValue );
144 unsigned char red()
const ;
163 const unsigned char aGreenValue,
164 const unsigned char aBlueValue,
165 const unsigned char aAlphaValue = 255);
188 return this->
setRGBf((
float)r,(
float)g,(
float)b);
264 #ifdef COLOR_WITH_ALPHA_ARITH
285 #ifdef COLOR_WITH_ALPHA_ARITH
307 #ifdef COLOR_WITH_ALPHA_ARITH
327 #ifdef COLOR_WITH_ALPHA_ARITH
350 #ifdef COLOR_WITH_ALPHA_ARITH
370 #ifdef COLOR_WITH_ALPHA_ARITH
388 std::string
svg()
const;
398 std::string
svgAlpha(
const char * aPrefix )
const;
410 std::string
tikz()
const;
450 unsigned char clamp(
const double value)
const
452 return static_cast<unsigned char>(
std::max( std::min(value, 255.0), 0.0));
469 static void HSVtoRGB(
double &r,
double &g,
double &b,
470 double h,
const double s,
const double v);
482 static void RGBtoHSV(
double & h,
double & s,
double & v,
483 const unsigned char r,
484 const unsigned char g,
485 const unsigned char b );
506 const Color &aColor );
525 #include "DGtal/io/Color.ih"
533 #undef Color_RECURSES
Structure representing an RGB triple with alpha component.
static const Color Purple
Color(const Color &aColor)=default
Color & operator*=(const double coeff)
std::array< double, 3 > getHSV() const
unsigned char blue() const
std::string postscript() const
unsigned char red() const
Color operator+(const Color &v) const
static const Color Yellow
bool operator>(const Color &aColor) const
void flushPostscript(std::ostream &) const
Color & setRGBi(const unsigned char aRedValue, const unsigned char aGreenValue, const unsigned char aBlueValue, const unsigned char aAlphaValue=255)
Color & setRGBA(DGtal::uint32_t aRGBA)
DGtal::uint32_t getRGB() const
bool operator<(const Color &aColor) const
Color & operator-=(const Color &v)
Color operator-(const Color &v) const
void green(const unsigned char aGreenValue)
bool operator==(const Color &aColor) const
static void RGBtoHSV(double &h, double &s, double &v, const unsigned char r, const unsigned char g, const unsigned char b)
Color & operator=(const Color &pv)=default
void selfDisplay(std::ostream &out) const
bool operator!=(const Color &aColor) const
bool operator<=(const Color &aColor) const
static void HSVtoRGB(double &r, double &g, double &b, double h, const double s, const double v)
Color operator*(const double coeff) const
Color & operator+=(const Color &v)
Color(unsigned char aGrayValue, unsigned char aAlphaValue=255)
static const Color Silver
void red(const unsigned char aRedValue)
void alpha(const unsigned char aAlphaValue)
unsigned char clamp(const double value) const
unsigned char green() const
Color & setRGBf(float red, float green, float blue, float alpha=1.0)
bool operator>=(const Color &aColor) const
std::string svgAlpha(const char *aPrefix) const
unsigned char alpha() const
Color(const unsigned char aRedValue, const unsigned char aGreenValue, const unsigned char aBlueValue, const unsigned char aAlphaValue=255)
void blue(const unsigned char aBlueValue)
static const Color Magenta
Color & setFromHSV(const double h, const double s, const double v)
DGtal::uint32_t getRGBA() const
DGtal is the top-level namespace which contains all DGtal functions and types.
boost::uint32_t uint32_t
unsigned 32-bit integer.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
KForm< Calculus, order, duality > operator*(const typename Calculus::Scalar &scalar, const KForm< Calculus, order, duality > &form)