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>
86 Color(
const unsigned int aRgb,
87 unsigned char aAlpha = 255 );
105 Color(
const unsigned char aRedValue,
106 const unsigned char aGreenValue,
107 const unsigned char aBlueValue,
108 const unsigned char aAlphaValue = 255 )
120 unsigned char aAlphaValue = 255 )
135 const unsigned char aGreenValue,
136 const unsigned char aBlueValue,
137 const unsigned char aAlphaValue = 255);
151 void red(
const unsigned char aRedValue );
153 void green(
const unsigned char aGreenValue );
155 void blue(
const unsigned char aBlueValue );
157 void alpha(
const unsigned char aAlphaValue );
159 unsigned char red()
const ;
240 #ifdef COLOR_WITH_ALPHA_ARITH
261 #ifdef COLOR_WITH_ALPHA_ARITH
283 #ifdef COLOR_WITH_ALPHA_ARITH
303 #ifdef COLOR_WITH_ALPHA_ARITH
326 #ifdef COLOR_WITH_ALPHA_ARITH
346 #ifdef COLOR_WITH_ALPHA_ARITH
364 std::string
svg()
const;
374 std::string
svgAlpha(
const char * aPrefix )
const;
386 std::string
tikz()
const;
425 unsigned char clamp(
const double value)
const
427 return static_cast<unsigned char>(
std::max( std::min(value, 255.0), 0.0));
450 const Color &aColor );
469 #include "DGtal/io/Color.ih"
477 #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)
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
Color & operator=(const Color &pv)=default
void selfDisplay(std::ostream &out) const
bool operator!=(const Color &aColor) const
bool operator<=(const Color &aColor) const
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
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 ClosedIntegerHalfPlane< TSpace > &object)
KForm< Calculus, order, duality > operator*(const typename Calculus::Scalar &scalar, const KForm< Calculus, order, duality > &form)