DGtal
1.1.0
|
Structure representing an RGB triple with alpha component. More...
#include <DGtal/io/Color.h>
Public Member Functions | |
~Color () | |
Color (const unsigned int aRgb, unsigned char aAlpha=255) | |
Color (const Color &aColor) | |
Color (const unsigned char aRedValue, const unsigned char aGreenValue, const unsigned char aBlueValue, const unsigned char aAlphaValue=255) | |
Color (unsigned char aGrayValue, unsigned char aAlphaValue=255) | |
Color () | |
Color & | setRGBi (const unsigned char aRedValue, const unsigned char aGreenValue, const unsigned char aBlueValue, const unsigned char aAlphaValue) |
Color & | setRGBA (DGtal::uint32_t aRGBA) |
void | red (const unsigned char aRedValue) |
void | green (const unsigned char aGreenValue) |
void | blue (const unsigned char aBlueValue) |
void | alpha (const unsigned char aAlphaValue) |
unsigned char | red () const |
unsigned char | green () const |
unsigned char | blue () const |
unsigned char | alpha () const |
double | r () const |
double | g () const |
double | b () const |
double | a () const |
DGtal::uint32_t | getRGB () const |
DGtal::uint32_t | getRGBA () const |
bool | valid () const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Color & | setRGBf (float red, float green, float blue, float alpha=1.0) |
bool | operator== (const Color &aColor) const |
bool | operator!= (const Color &aColor) const |
bool | operator< (const Color &aColor) const |
Color & | operator+= (const Color &v) |
Color | operator+ (const Color &v) const |
Color & | operator-= (const Color &v) |
Color | operator- (const Color &v) const |
Color & | operator*= (const double coeff) |
Color | operator* (const double coeff) const |
Color & | operator= (const Color &pv) |
void | flushPostscript (std::ostream &) const |
std::string | svg () const |
std::string | svgAlpha (const char *aPrefix) const |
std::string | postscript () const |
std::string | tikz () const |
Static Public Attributes | |
static const Color | None |
static const Color | Black |
static const Color | Gray |
static const Color | White |
static const Color | Red |
static const Color | Green |
static const Color | Lime |
static const Color | Blue |
static const Color | Cyan |
static const Color | Magenta |
static const Color | Yellow |
static const Color | Silver |
static const Color | Purple |
static const Color | Navy |
static const Color | Aqua |
Private Member Functions | |
unsigned char | clamp (const double value) const |
Private Attributes | |
unsigned char | myRed |
unsigned char | myGreen |
unsigned char | myBlue |
unsigned char | myAlpha |
Structure representing an RGB triple with alpha component.
Description of class 'Color'
DGtal::Color::Color | ( | const unsigned int | aRgb, |
unsigned char | aAlpha = 255 |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
double DGtal::Color::a | ( | ) | const |
unsigned char DGtal::Color::alpha | ( | ) | const |
void DGtal::Color::alpha | ( | const unsigned char | aAlphaValue | ) |
double DGtal::Color::b | ( | ) | const |
unsigned char DGtal::Color::blue | ( | ) | const |
void DGtal::Color::blue | ( | const unsigned char | aBlueValue | ) |
Referenced by LibBoard::Board::fillGouraudTriangle(), LibBoard::Dot::flushCairo(), LibBoard::Line::flushCairo(), LibBoard::Arrow::flushCairo(), LibBoard::Polyline::flushCairo(), LibBoard::Rectangle::flushCairo(), LibBoard::QuadraticBezierCurve::flushCairo(), LibBoard::Ellipse::flushCairo(), LibBoard::Circle::flushCairo(), LibBoard::Arc::flushCairo(), LibBoard::GouraudTriangle::flushFIG(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::GouraudTriangle::flushSVG(), DGtal::Viewer3D< TSpace, TKSpace >::GLTextureImage::GLTextureImage(), LibBoard::GouraudTriangle::GouraudTriangle(), main(), DGtal::functors::BlueChannel::operator()(), DGtal::functors::MeanChannels::operator()(), DGtal::functors::MagickCast< TValue >::operator()(), and testGrayscaleColorMap().
|
inlineprivate |
Clamp an int to [0,255]
[in] | value | the value to clamp |
Definition at line 433 of file Color.h.
References max().
Referenced by operator*(), operator*=(), operator+(), operator+=(), operator-(), and operator-=().
void DGtal::Color::flushPostscript | ( | std::ostream & | stream | ) | const |
Definition at line 124 of file Color.cpp.
Referenced by LibBoard::Polyline::flushPostscript(), LibBoard::QuadraticBezierCurve::flushPostscript(), and LibBoard::Arc::flushPostscript().
double DGtal::Color::g | ( | ) | const |
DGtal::uint32_t DGtal::Color::getRGB | ( | ) | const |
Referenced by DGtal::functors::ColorRGBEncoder< TValue >::operator()().
DGtal::uint32_t DGtal::Color::getRGBA | ( | ) | const |
unsigned char DGtal::Color::green | ( | ) | const |
void DGtal::Color::green | ( | const unsigned char | aGreenValue | ) |
Referenced by LibBoard::Board::fillGouraudTriangle(), LibBoard::Dot::flushCairo(), LibBoard::Line::flushCairo(), LibBoard::Arrow::flushCairo(), LibBoard::Polyline::flushCairo(), LibBoard::Rectangle::flushCairo(), LibBoard::QuadraticBezierCurve::flushCairo(), LibBoard::Ellipse::flushCairo(), LibBoard::Circle::flushCairo(), LibBoard::Arc::flushCairo(), LibBoard::GouraudTriangle::flushFIG(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::GouraudTriangle::flushSVG(), DGtal::Viewer3D< TSpace, TKSpace >::GLTextureImage::GLTextureImage(), LibBoard::GouraudTriangle::GouraudTriangle(), main(), DGtal::functors::GreenChannel::operator()(), DGtal::functors::MeanChannels::operator()(), DGtal::functors::MagickCast< TValue >::operator()(), and testGrayscaleColorMap().
bool DGtal::Color::isValid | ( | ) | const |
bool DGtal::Color::operator!= | ( | const Color & | aColor | ) | const |
|
inline |
|
inline |
bool DGtal::Color::operator< | ( | const Color & | aColor | ) | const |
bool DGtal::Color::operator== | ( | const Color & | aColor | ) | const |
string DGtal::Color::postscript | ( | ) | const |
Definition at line 132 of file Color.cpp.
Referenced by LibBoard::Dot::flushPostscript(), LibBoard::Line::flushPostscript(), LibBoard::Arrow::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::Arc::flushPostscript(), and LibBoard::Text::flushPostscript().
double DGtal::Color::r | ( | ) | const |
unsigned char DGtal::Color::red | ( | ) | const |
void DGtal::Color::red | ( | const unsigned char | aRedValue | ) |
Referenced by LibBoard::Board::fillGouraudTriangle(), LibBoard::Dot::flushCairo(), LibBoard::Line::flushCairo(), LibBoard::Arrow::flushCairo(), LibBoard::Polyline::flushCairo(), LibBoard::Rectangle::flushCairo(), LibBoard::QuadraticBezierCurve::flushCairo(), LibBoard::Ellipse::flushCairo(), LibBoard::Circle::flushCairo(), LibBoard::Arc::flushCairo(), LibBoard::GouraudTriangle::flushFIG(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::GouraudTriangle::flushSVG(), DGtal::Viewer3D< TSpace, TKSpace >::GLTextureImage::GLTextureImage(), LibBoard::GouraudTriangle::GouraudTriangle(), main(), DGtal::functors::RedChannel::operator()(), DGtal::functors::MeanChannels::operator()(), DGtal::functors::MagickCast< TValue >::operator()(), and testGrayscaleColorMap().
void DGtal::Color::selfDisplay | ( | std::ostream & | out | ) | const |
DGtal::Color & DGtal::Color::setRGBA | ( | DGtal::uint32_t | aRGBA | ) |
Set the color parameter from an unsigned integer coding each canal.
aRGBA | an unsigned integer on 32 bits(DGtal::unit32_t) representing the color coded with 4 bits on each components R, G, B and Alpha value. |
DGtal::Color & DGtal::Color::setRGBf | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha = 1.0 |
||
) |
Definition at line 65 of file Color.cpp.
Referenced by LibBoard::Board::setFillColorRGBf(), and LibBoard::Board::setPenColorRGBf().
Color& DGtal::Color::setRGBi | ( | const unsigned char | aRedValue, |
const unsigned char | aGreenValue, | ||
const unsigned char | aBlueValue, | ||
const unsigned char | aAlphaValue | ||
) |
Referenced by LibBoard::Board::setFillColorRGBi(), LibBoard::Board::setPenColorRGBi(), and testColor().
string DGtal::Color::svg | ( | ) | const |
Definition at line 140 of file Color.cpp.
References None.
Referenced by LibBoard::Arrow::flushSVG(), LibBoard::Text::flushSVG(), and LibBoard::Shape::svgProperties().
string DGtal::Color::svgAlpha | ( | const char * | aPrefix | ) | const |
Return a an SVG parameter string for the opacity value.
aPrefix | A prefix string to be appended to the returned string if not empty. |
Definition at line 149 of file Color.cpp.
References None.
Referenced by LibBoard::Arrow::flushSVG(), LibBoard::Text::flushSVG(), and LibBoard::Shape::svgProperties().
string DGtal::Color::tikz | ( | ) | const |
Return a string representation of the color usable in TikZ commands. Use the corresponding named color (or a mixture of a named color and black) for predefined colors. Use a mixture of red, green and blue for general colors.
Definition at line 158 of file Color.cpp.
References Black, Blue, Gray, Green, Lime, Navy, None, Purple, Red, Silver, and White.
Referenced by LibBoard::Shape::tikzProperties().
bool DGtal::Color::valid | ( | ) | const |
|
static |
|
static |
Definition at line 397 of file Color.h.
Referenced by drawCCP(), DGtal::Shortcuts< TKSpace >::getZeroTickedColorMap(), main(), LibBoard::Board::State::State(), and tikz().
|
static |
Definition at line 403 of file Color.h.
Referenced by convexHull(), drawCCP(), main(), testAlphaThickSegmentConvexHullAndBox(), testAlphaThickSegmentFreeman(), testAlphaThickSpecialInit(), testConvexHullCompThickness(), testMeshGeneration(), testThicknessDefinitions(), testVisualTubularMesh(), and tikz().
|
static |
|
static |
Definition at line 398 of file Color.h.
Referenced by main(), testAlphaThickSegmentComputerFloatingPointContour(), testAlphaThickSegmentConvexHullAndBox(), testThicknessDefinitions(), and tikz().
|
static |
Definition at line 401 of file Color.h.
Referenced by drawCCP(), main(), testAlphaThickSegmentConvexHullAndBox(), testAlphaThickSegmentFreeman(), testAlphaThickSpecialInit(), testMeshGeneration(), testThicknessDefinitions(), and tikz().
|
static |
|
static |
Definition at line 405 of file Color.h.
Referenced by testAlphaThickSegmentConvexHullAndBox().
|
private |
The opacity.
Definition at line 419 of file Color.h.
Referenced by operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator<(), operator=(), and operator==().
|
private |
The blue component.
Definition at line 418 of file Color.h.
Referenced by Color(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator<(), operator=(), and operator==().
|
private |
The green component.
Definition at line 417 of file Color.h.
Referenced by Color(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator<(), operator=(), and operator==().
|
private |
The red component.
Definition at line 416 of file Color.h.
Referenced by Color(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator<(), operator=(), and operator==().
|
static |
|
static |
Definition at line 396 of file Color.h.
Referenced by LibBoard::Board::drawArc(), LibBoard::Board::drawArrow(), LibBoard::Board::fillCircle(), LibBoard::Shape::filled(), LibBoard::Board::fillEllipse(), LibBoard::Board::fillPolyline(), LibBoard::Board::fillRectangle(), LibBoard::Board::fillTriangle(), LibBoard::Arrow::flushCairo(), LibBoard::Polyline::flushCairo(), LibBoard::Rectangle::flushCairo(), LibBoard::QuadraticBezierCurve::flushCairo(), LibBoard::Ellipse::flushCairo(), LibBoard::Circle::flushCairo(), LibBoard::Arc::flushCairo(), LibBoard::GouraudTriangle::flushFIG(), LibBoard::Polyline::flushPostscript(), LibBoard::QuadraticBezierCurve::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::Arc::flushPostscript(), main(), LibBoard::Board::saveCairo(), LibBoard::Board::saveEPS(), LibBoard::Board::saveFIG(), DGtal::Shortcuts< TKSpace >::saveOFF(), LibBoard::Board::saveSVG(), LibBoard::Board::saveTikZ(), LibBoard::Board::State::State(), svg(), svgAlpha(), LibBoard::Shape::svgProperties(), testAlphaThickSegmentConvexHullAndBox(), testMultiWidth(), testThicknessDefinitions(), and tikz().
|
static |
Definition at line 408 of file Color.h.
Referenced by testAlphaThickSegmentConvexHullAndBox(), testThicknessDefinitions(), and tikz().
|
static |
Definition at line 400 of file Color.h.
Referenced by convexHull(), drawCCP(), laplacian(), main(), testAlphaThickSegmentConvexHullAndBox(), testConvexHullCompThickness(), testMesh(), testThicknessDefinitions(), and tikz().
|
static |
|
static |
Definition at line 399 of file Color.h.
Referenced by testMesh(), and tikz().
|
static |
Definition at line 406 of file Color.h.
Referenced by drawCCP(), testAlphaThickSegmentConvexHullAndBox(), and testMeshGeneration().