Visual Servoing Platform
version 3.5.0 under development (2022-02-15)
|
#include <visp3/core/vpColor.h>
Public Types | |
enum | vpColorIdentifier { id_black = 0, id_white, id_lightGray, id_gray, id_darkGray, id_lightRed, id_red, id_darkRed, id_lightGreen, id_green, id_darkGreen, id_lightBlue, id_blue, id_darkBlue, id_yellow, id_cyan, id_orange, id_purple, id_unknown } |
enum | AlphaDefault { alpha_default = 255 } |
Public Member Functions | |
vpColor () | |
vpColor (unsigned char r, unsigned char g, unsigned char b, vpColor::vpColorIdentifier cid=vpColor::id_unknown) | |
vpColor (unsigned char r, unsigned char g, unsigned char b, unsigned char alpha, vpColor::vpColorIdentifier cid=vpColor::id_unknown) | |
vpColor (const vpColor &color, unsigned char alpha) | |
virtual | ~vpColor () |
void | setColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=vpRGBa::alpha_default) |
bool | operator== (const vpRGBa &v) |
bool | operator!= (const vpRGBa &v) |
vpColVector | operator- (const vpRGBa &v) const |
vpColVector | operator- (const vpColVector &v) const |
vpRGBa | operator+ (const vpRGBa &v) const |
vpColVector | operator+ (const vpColVector &v) const |
vpColVector | operator* (const float &v) const |
vpColVector | operator* (const double &v) const |
bool | operator< (const vpRGBa &v) const |
bool | operator> (const vpRGBa &v) const |
Static Public Member Functions | |
static vpColor | getColor (const unsigned int &i) |
Public Attributes | |
vpColorIdentifier | id |
unsigned char | R |
unsigned char | G |
unsigned char | B |
unsigned char | A |
Static Public Attributes | |
static const vpColor | black = vpColor(0, 0, 0, id_black) |
static const vpColor | white = vpColor(255, 255, 255, id_white) |
static const vpColor | lightGray = vpColor(192, 192, 192, id_lightGray) |
static const vpColor | gray = vpColor(128, 128, 128, id_gray) |
static const vpColor | darkGray = vpColor(64, 64, 64, id_darkGray) |
static const vpColor | lightRed = vpColor(255, 140, 140, id_lightRed) |
static const vpColor | red = vpColor(255, 0, 0, id_red) |
static const vpColor | darkRed = vpColor(128, 0, 0, id_darkRed) |
static const vpColor | lightGreen = vpColor(140, 255, 140, id_lightGreen) |
static const vpColor | green = vpColor(0, 255, 0, id_green) |
static const vpColor | darkGreen = vpColor(0, 128, 0, id_darkGreen) |
static const vpColor | lightBlue = vpColor(140, 140, 255, id_lightBlue) |
static const vpColor | blue = vpColor(0, 0, 255, id_blue) |
static const vpColor | darkBlue = vpColor(0, 0, 128, id_darkBlue) |
static const vpColor | yellow = vpColor(255, 255, 0, id_yellow) |
static const vpColor | cyan = vpColor(0, 255, 255, id_cyan) |
static const vpColor | orange = vpColor(255, 165, 0, id_orange) |
static const vpColor | purple = vpColor(128, 0, 128, id_purple) |
static const vpColor | none = vpColor(0, 0, 0, id_unknown) |
static const unsigned int | nbColors = 18 |
static const vpColor | allColors [] |
Friends | |
VISP_EXPORT bool | operator== (const vpColor &c1, const vpColor &c2) |
VISP_EXPORT bool | operator!= (const vpColor &c1, const vpColor &c2) |
Class to define RGB colors available for display functionnalities.
An identifier vpColor::vpColorIdentifier is associated to each color. This identifier is useful to determine if a color is predefined or specified by it R,G,B values. In that last case, the identifier is always set to vpColor::id_unknown.
The example below shows how to display geometric features in a display overlay using predefined colors (here the blue color to draw a circle) and a specific brown color (used to draw a rectangle).
|
inherited |
Predefined colors identifier.
Enumerator | |
---|---|
id_black | Identifier associated to the predefined vpColor::black color. |
id_white | Identifier associated to the predefined vpColor::white color. |
id_lightGray | Identifier associated to the predefined vpColor::lightGray color. |
id_gray | Identifier associated to the predefined vpColor::gray color. |
id_darkGray | Identifier associated to the predefined vpColor::darkGray color. |
id_lightRed | Identifier associated to the predefined vpColor::lightRed color. |
id_red | Identifier associated to the predefined vpColor::red color. |
id_darkRed | Identifier associated to the predefined vpColor::darkRed color. |
id_lightGreen | Identifier associated to the predefined vpColor::lightGreen color. |
id_green | Identifier associated to the predefined vpColor::green color. |
id_darkGreen | Identifier associated to the predefined vpColor::darkGreen color. |
id_lightBlue | Identifier associated to the predefined vpColor::lightBlue color. |
id_blue | Identifier associated to the predefined vpColor::blue color. |
id_darkBlue | Identifier associated to the predefined vpColor::darkBlue color. |
id_yellow | Identifier associated to the predefined vpColor::yellow color. |
id_cyan | Identifier associated to the predefined vpColor::cyan color. |
id_orange | Identifier associated to the predefined vpColor::orange color. |
id_purple | Identifier associated to the predefined vpColor::purple color. |
id_unknown | Identifier associated to unknowned colors. By unknowned, we mean not a predefined color. This identifier can also be used to know the number of predefined colors. |
|
inline |
Default constructor. All the colors components are set to zero.
The color identifier is set to vpColor::id_unknown to indicate that this color is not a predefined one.
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Default destructor.
Definition at line 279 of file vpColor.h.
References vpRGBa::operator!=(), and vpRGBa::operator==().
|
inlinestatic |
Get a predefined color
i | : color indice |
Definition at line 310 of file vpColor.h.
References allColors, black, blue, cyan, darkBlue, darkGray, darkGreen, darkRed, gray, green, lightBlue, lightGray, lightGreen, lightRed, nbColors, none, orange, purple, red, white, and yellow.
Referenced by vpIoTools::readConfigVar().
|
inherited |
Compare two color pixels.
Definition at line 136 of file vpRGBa.cpp.
References vpRGBa::A, vpRGBa::B, vpRGBa::G, and vpRGBa::R.
Referenced by ~vpColor().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Definition at line 229 of file vpRGBa.cpp.
|
inherited |
Compare two RGBa values.
Definition at line 118 of file vpRGBa.cpp.
References vpRGBa::A, vpRGBa::B, vpRGBa::G, and vpRGBa::R.
Referenced by ~vpColor().
|
inherited |
Definition at line 237 of file vpRGBa.cpp.
|
inline |
Set a color from its RGB values.
r | : Red component. |
g | : Green component. |
b | : Blue component. |
a | : Alpha component for transparency. |
The color identifier is set to vpColor::id_unknown to indicate that this color is not a predefined one.
Compare two colors.
Return true if the R,G,B components are different.
c1,c2 | : Color to compare. |
Definition at line 147 of file vpColor.cpp.
Compare two colors.
Return true if the R,G,B components are the same.
c1,c2 | : Color to compare. |
Definition at line 134 of file vpColor.cpp.
|
inherited |
Additionnal component.
Definition at line 151 of file vpRGBa.h.
Referenced by vp::adjust(), vpImageConvert::convert(), vpDisplayOpenCV::displayCircle(), vpDisplayOpenCV::displayRectangle(), vp::gammaCorrection(), vpImageTools::imageDifferenceAbsolute(), vpImageConvert::merge(), vpRGBa::operator!=(), vpRGBa::operator*(), vpRGBa::operator+(), vpRGBa::operator-(), vpRGBa::operator=(), vpRGBa::operator==(), and vp::stretchContrast().
|
static |
|
inherited |
Blue component.
Definition at line 150 of file vpRGBa.h.
Referenced by vp::adjust(), vpImageConvert::convert(), vpDisplayOpenCV::displayCharString(), vpDisplayOpenCV::displayCircle(), vpDisplayOpenCV::displayImage(), vpDisplayOpenCV::displayImageROI(), vpDisplayOpenCV::displayLine(), vpDisplayOpenCV::displayPoint(), vpDisplayOpenCV::displayRectangle(), vpImageDraw::drawCircle(), vp::drawContours(), vpImageDraw::drawLine(), vpImageDraw::drawPolygon(), vpImageDraw::drawRectangle(), vp::gammaCorrection(), vpImageSimulator::getImage(), vpImageTools::imageDifferenceAbsolute(), vpDisplayOpenCV::init(), vpImageConvert::merge(), vpRGBa::operator!=(), vpRGBa::operator*(), vpRGBa::operator+(), vpRGBa::operator-(), vpRGBa::operator<(), vpRGBa::operator=(), vpRGBa::operator==(), vpRGBa::operator>(), vp::stretchContrast(), vp::unsharpMask(), and vpImageTools::warpLinear().
< Predefined black color with R=G=B=0 and identifier vpColor::id_black. Predefined white color with R=G=B=255 and identifier vpColor::id_white.
Definition at line 211 of file vpColor.h.
Referenced by getColor(), vpDisplayOpenCV::init(), and vpMeTracker::track().
Predefined dark blue color with B= 128 and R=G=0 and identifier vpColor::id_darkBlue.
Definition at line 223 of file vpColor.h.
Referenced by vpMbDepthNormalTracker::display(), vpMeSite::display(), vpProjectionDisplay::displayCamera(), vpMbtFaceDepthNormal::displayFeature(), vpMbEdgeTracker::displayFeaturesOnImage(), vpImageDraw::drawFrame(), getColor(), vpDisplayOpenCV::init(), vpTemplateTrackerZone::initClick(), vpMeEllipse::leastSquareRobust(), vpMeEllipse::plugHoles(), vpMeLine::sample(), vpDot2::searchDotsInArea(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), vpMbGenericTracker::track(), and vpDot2::trackAndDisplay().
Predefined orange color with R=255, G=165 and B=0 and identifier vpColor::id_orange.
Definition at line 226 of file vpColor.h.
Referenced by vpFeatureSegment::display(), vpMeSite::display(), vpMbEdgeTracker::displayFeaturesOnImage(), getColor(), vpDisplayOpenCV::init(), vpMeEllipse::leastSquareRobust(), and vpMbGenericTracker::track().
|
static |
Predefined yellow color with R=G=255 and B=0 and identifier vpColor::id_yellow.
Definition at line 224 of file vpColor.h.
Referenced by getColor(), and vpDisplayOpenCV::init().
|
static |
Predefined light red color with R= 255 and G=B=140 and identifier vpColor::id_lightRed.
Definition at line 215 of file vpColor.h.
Referenced by getColor(), and vpDisplayOpenCV::init().
|
static |
Predefined light blue color with B= 255 and R=G=140 and identifier vpColor::id_lightBlue.
Definition at line 221 of file vpColor.h.
Referenced by getColor(), and vpDisplayOpenCV::init().
|
static |
Predefined light green color with G= 255 and R=B=140 and identifier vpColor::id_lightGreen.
Definition at line 218 of file vpColor.h.
Referenced by getColor(), and vpDisplayOpenCV::init().
|
inherited |
Green component.
Definition at line 149 of file vpRGBa.h.
Referenced by vp::adjust(), vpImageConvert::convert(), vpDisplayOpenCV::displayCharString(), vpDisplayOpenCV::displayCircle(), vpDisplayOpenCV::displayImage(), vpDisplayOpenCV::displayImageROI(), vpDisplayOpenCV::displayLine(), vpDisplayOpenCV::displayPoint(), vpDisplayOpenCV::displayRectangle(), vpImageDraw::drawCircle(), vp::drawContours(), vpImageDraw::drawLine(), vpImageDraw::drawPolygon(), vpImageDraw::drawRectangle(), vp::gammaCorrection(), vpImageSimulator::getImage(), vpImageTools::imageDifferenceAbsolute(), vpDisplayOpenCV::init(), vpImageConvert::merge(), vpRGBa::operator!=(), vpRGBa::operator*(), vpRGBa::operator+(), vpRGBa::operator-(), vpRGBa::operator<(), vpRGBa::operator=(), vpRGBa::operator==(), vpRGBa::operator>(), vp::stretchContrast(), vp::unsharpMask(), and vpImageTools::warpLinear().
Predefined dark gray color with R=G=B=192 and identifier vpColor::id_darkGray.
Definition at line 214 of file vpColor.h.
Referenced by getColor(), and vpDisplayOpenCV::init().
Predefined dark green color with G= 128 and R=B=0 and identifier vpColor::id_darkGreen.
Definition at line 220 of file vpColor.h.
Referenced by vpVirtualGrabber::acquire(), vpMeLine::computeRhoSignFromIntensity(), vpMeLine::computeRhoTheta(), vpBasicFeature::dimension_s(), vpProjectionDisplay::display(), vpMeSite::display(), vpMeLine::display(), vpKeyPoint::display(), vpProjectionDisplay::displayCamera(), vpMbEdgeTracker::displayFeaturesOnImage(), vpKeyPoint::displayMatching(), vpImageDraw::drawFrame(), getColor(), vpDot2::getFreemanChain(), vpMeNurbs::getNurbs(), vpDisplayOpenCV::init(), vpMbTracker::initClick(), vpMeTracker::initTracking(), vpMeNurbs::initTracking(), vpDisplay::isInitialised(), vpMeEllipse::leastSquareRobust(), vpDot2::searchDotsInArea(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpDisplayWin32::setDownScalingFactor(), vpMeSite::track(), vpMbGenericTracker::track(), vpDot2::trackAndDisplay(), vpSimulatorAfma6::updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), vpFeatureMoment::vpFeatureMoment(), vpTemplateTracker::vpTemplateTracker(), vpBasicKeyPoint::~vpBasicKeyPoint(), vpFeatureDepth::~vpFeatureDepth(), vpFeatureEllipse::~vpFeatureEllipse(), vpFeatureLine::~vpFeatureLine(), vpFeaturePoint::~vpFeaturePoint(), vpFeaturePoint3D::~vpFeaturePoint3D(), vpFeaturePointPolar::~vpFeaturePointPolar(), vpFeatureSegment::~vpFeatureSegment(), vpFeatureThetaU::~vpFeatureThetaU(), vpFeatureTranslation::~vpFeatureTranslation(), vpFeatureVanishingPoint::~vpFeatureVanishingPoint(), vpForwardProjection::~vpForwardProjection(), vpLine::~vpLine(), and vpPoint::~vpPoint().
vpColorIdentifier vpColor::id |
Color identifier to indicate if a color is predefined or set by the user using its RGB values.
Definition at line 206 of file vpColor.h.
Referenced by vpDisplayOpenCV::displayCharString(), vpDisplayOpenCV::displayCircle(), vpDisplayOpenCV::displayLine(), vpDisplayOpenCV::displayPoint(), and vpDisplayOpenCV::displayRectangle().
|
static |
Predefined blue color with R=G=0 and B=255 and identifier vpColor::id_blue.
Definition at line 222 of file vpColor.h.
Referenced by getColor(), and vpDisplayOpenCV::init().
|
static |
Predefined gray color with R=G=B=128 and identifier vpColor::id_gray.
Definition at line 213 of file vpColor.h.
Referenced by getColor(), and vpDisplayOpenCV::init().
|
static |
Predefined green color with G=255 and R=B=0 and identifier vpColor::id_green.
Definition at line 219 of file vpColor.h.
Referenced by getColor(), and vpDisplayOpenCV::init().
|
static |
Predefined red color with R=255 and G=B=0 and identifier vpColor::id_red.
Definition at line 216 of file vpColor.h.
Referenced by getColor(), and vpDisplayOpenCV::init().
|
static |
|
static |
Definition at line 229 of file vpColor.h.
Referenced by vpServoDisplay::display(), vpKeyPoint::displayMatching(), vpImageDraw::drawFrame(), getColor(), vpPose::getPoints(), vpDisplay::isInitialised(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().
Predefined purple color with R=128, G=0 and B=128 and identifier vpColor::id_purple.
Definition at line 227 of file vpColor.h.
Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), getColor(), vpDisplayOpenCV::init(), vpMeEllipse::leastSquareRobust(), and vpMeNurbs::seekExtremitiesCanny().
Predefined none color with R=G=B=0 and identifier vpColor::id_unknown.
Definition at line 228 of file vpColor.h.
Referenced by vpMeSite::display(), vpMbEdgeTracker::displayFeaturesOnImage(), getColor(), vpDisplayOpenCV::init(), vpDot2::searchDotsInArea(), and vpMbGenericTracker::track().
|
inherited |
Red component.
Definition at line 148 of file vpRGBa.h.
Referenced by vp::adjust(), vpImageConvert::convert(), vpDisplayOpenCV::displayCharString(), vpDisplayOpenCV::displayCircle(), vpDisplayOpenCV::displayImage(), vpDisplayOpenCV::displayImageROI(), vpDisplayOpenCV::displayLine(), vpDisplayOpenCV::displayPoint(), vpDisplayOpenCV::displayRectangle(), vpImageDraw::drawCircle(), vp::drawContours(), vpImageDraw::drawLine(), vpImageDraw::drawPolygon(), vpImageDraw::drawRectangle(), vp::gammaCorrection(), vpImageSimulator::getImage(), vpImageTools::imageDifferenceAbsolute(), vpDisplayOpenCV::init(), vpImageConvert::merge(), vpRGBa::operator!=(), vpRGBa::operator*(), vpRGBa::operator+(), vpRGBa::operator-(), vpRGBa::operator<(), vpRGBa::operator=(), vpRGBa::operator==(), vpRGBa::operator>(), vp::stretchContrast(), vp::unsharpMask(), and vpImageTools::warpLinear().
Predefined dark red color with R= 128 and G=B=0 and identifier vpColor::id_darkRed.
Definition at line 217 of file vpColor.h.
Referenced by vpVirtualGrabber::acquire(), vpMbtDistanceCylinder::computeInteractionMatrixError(), vpMeLine::computeRhoTheta(), vpMbDepthNormalTracker::display(), vpMbEdgeKltTracker::display(), vpMeSite::display(), vpMbKltTracker::display(), vpKeyPoint::display(), vpProjectionDisplay::displayCamera(), vpMbtFaceDepthNormal::displayFeature(), vpMbEdgeTracker::displayFeaturesOnImage(), vpKeyPoint::displayMatching(), vpMbtDistanceKltCylinder::displayPrimitive(), vpMbtDistanceKltPoints::displayPrimitive(), vpImageDraw::drawFrame(), getColor(), vpDot2::getFreemanChain(), vpWireFrameSimulator::getInternalImage(), vpRobotWireFrameSimulator::getInternalView(), vpDisplayOpenCV::init(), vpTemplateTrackerZone::initClick(), vpMbTracker::initClick(), vpMeLine::initTracking(), vpMeEllipse::initTracking(), vpMeEllipse::leastSquareRobust(), vpDot::operator==(), vpImageQueue< Type >::record(), vpMeEllipse::sample(), vpMbDepthDenseTracker::segmentPointCloud(), vpMbDepthNormalTracker::segmentPointCloud(), vpDot::setGraphicsThickness(), vpMeSite::track(), vpMeLine::track(), vpMeEllipse::track(), vpDot2::track(), vpDot::track(), vpMbGenericTracker::track(), and vpDot2::trackAndDisplay().
Predefined light gray color with R=G=B=64 and identifier vpColor::id_lightGray.
Definition at line 212 of file vpColor.h.
Referenced by getColor(), vpDisplayOpenCV::init(), vpDisplay::isInitialised(), vpHistogram::set(), and vpDisplayWin32::setDownScalingFactor().
Predefined cyan color with R=0 and G=B=255 and identifier vpColor::id_cyan.
Definition at line 225 of file vpColor.h.
Referenced by vpFeatureSegment::display(), vpMeSite::display(), vpMbEdgeTracker::displayFeaturesOnImage(), getColor(), vpMeSite::getQueryList(), vpDisplayOpenCV::init(), and vpMbGenericTracker::track().