![]() |
Visual Servoing Platform version 3.7.0
|
#include <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 (const vpColor &)=default | |
| virtual | ~vpColor ()=default |
| 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) | |
| vpColor & | operator= (const vpColor &)=default |
| void | setColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=vpRGBa::alpha_default) |
| template<typename T, bool useFullScale, typename U = float> | |
| std::enable_if< std::is_same< U, float >::value &&std::is_same< T, unsignedchar >::value, vpRGBa & >::type | buildFrom (const vpHSV< T, useFullScale > &other) |
| template<typename T, bool useFullScale> | |
| std::enable_if< std::is_floating_point< T >::value, vpRGBa & >::type | buildFrom (const vpHSV< T, useFullScale > &hsv) |
| bool | operator== (const vpRGBa &v) const |
| bool | operator!= (const vpRGBa &v) const |
| 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 [] |
| static constexpr unsigned char | nbChannels = 4 |
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 functionalities.
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 pColor::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 with unknown colors. By unknown, we mean that it is not a predefined colour. This identifier can also be used to find out the number of predefined colours |
|
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.
Definition at line 222 of file vpColor.h.
References id, id_unknown, and vpRGBa::vpRGBa().
Referenced by getColor(), operator!=, operator=(), operator==, vpColor(), vpColor(), and ~vpColor().
|
virtualdefault |
References vpColor().
|
inline |
Construct a color from its RGB values.
| r | : Red component. |
| g | : Green component. |
| b | : Blue component. |
| cid | : The color identifier to indicate if this color is or not a predefined one. |
Definition at line 241 of file vpColor.h.
References id, id_unknown, and vpRGBa::vpRGBa().
|
inline |
Construct a color from its RGB values and alpha channel.
| r | : Red component. |
| g | : Green component. |
| b | : Blue component. |
| alpha | : Alpha channel for transparency. |
| cid | : The color identifier to indicate if this color is or not a predefined one. |
Definition at line 256 of file vpColor.h.
References id, id_unknown, and vpRGBa::vpRGBa().
|
inline |
|
inlineinherited |
Build a vpRGBa object from a vpHSV<double> or vpHSV<float> object.
| T | The type of the channels of the vpHSV pixels. |
| useFullScale | True if vpHSV uses unsigned char and the full range [0; 255], false if vpHSV uses unsigned char and the limited range [0; 180]. |
| std::enable_if<std::is_floating_point<T>::value,int>::type | Enable the method only if T is a floating point number. The "int" is here because we cannot use a floating point type, otherwise we get "{float/double} is not a valid type for a template non-type parameter". |
| [in] | hsv | The vpHSV from which we want to build our object. |
Definition at line 197 of file vpRGBa.h.
References A, alpha_default, B, vpMath::equal(), G, vpHSV< T, useFullScale >::H, R, vpMath::round(), vpHSV< T, useFullScale >::S, and vpHSV< T, useFullScale >::V.
|
inlineinherited |
Build a vpRGBa object from a vpHSV<unsigned char> object.
| T | The type of the channels of the vpHSV pixels. |
| useFullScale | True if vpHSV uses unsigned char and the full range [0; 255], false if vpHSV uses unsigned char and the limited range [0; 180]. |
| type | Enable the method only if T is unsigned char. |
| [in] | other | The vpHSV from which we want to build our object. |
Definition at line 176 of file vpRGBa.h.
References buildFrom().
Referenced by buildFrom(), and vpRGBa().
|
inlinestatic |
Get a predefined color
| i | : color indice |
Definition at line 300 of file vpColor.h.
References allColors, nbColors, and vpColor().
Referenced by vpIoTools::readConfigVar().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
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.
Definition at line 285 of file vpColor.h.
References vpRGBa::A, vpRGBa::alpha_default, vpRGBa::B, vpRGBa::G, id_unknown, and vpRGBa::R.
Compare two colors.
Return true if the R,G,B components are different.
| c1 | : First color to compare. |
| c2 | : Second color to compare. |
Definition at line 142 of file vpColor.cpp.
References vpRGBa::B, vpRGBa::G, operator!=, vpRGBa::R, and vpColor().
Referenced by operator!=.
Compare two colors.
Return true if the R,G,B components are the same.
| c1 | : First color to compare. |
| c2 | : Second color to compare. |
Definition at line 128 of file vpColor.cpp.
References vpRGBa::B, vpRGBa::G, operator==, vpRGBa::R, and vpColor().
Referenced by operator==.
|
inherited |
Additional component.
Definition at line 328 of file vpRGBa.h.
Referenced by VISP_NAMESPACE_NAME::adjust(), buildFrom(), vpImageConvert::convert(), vpColorHistogramMask::display(), vpColorGetter< ID >::get(), vpColorGetter< ID >::get(), vpColorHistogram::indexToColor(), operator!=(), operator*(), operator*, operator*(), operator+(), operator+(), operator-(), operator-(), operator<<, operator=(), operator=(), operator=(), operator=(), operator=(), operator==(), vpColor::setColor(), VISP_NAMESPACE_NAME::stretchContrast(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), and vpRGBa().
|
static |
Definition at line 100 of file vpColor.h.
Referenced by getColor().
|
inherited |
Blue component.
Definition at line 327 of file vpRGBa.h.
Referenced by VISP_NAMESPACE_NAME::adjust(), buildFrom(), vpRBSilhouetteCCDTracker::computeLocalStatistics(), vpHSV< T, useFullScale >::computeNormalizedHSV(), vpImageConvert::convert(), vpColorHistogramMask::display(), vpRBSilhouetteCCDTracker::display(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), vpColorGetter< ID >::get(), vpColorGetter< ID >::get(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpColorHistogram::indexToColor(), vpColor::operator!=, operator!=(), operator*(), operator*, operator*(), operator+(), operator+(), operator-(), operator-(), operator<(), operator<<, operator=(), operator=(), operator=(), operator=(), operator=(), vpColor::operator==, operator==(), operator>(), vpRBProbabilistic3DDriftDetector::score(), vpColor::setColor(), VISP_NAMESPACE_NAME::stretchContrast(), vpRBProbabilistic3DDriftDetector::update(), vpColor::vpColor(), vpProbaComputer::vpProbaComputer(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), and vpImageTools::warpLinear().
|
static |
< 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.
Predefined dark blue color with B= 128 and R=G=0 and identifier vpColor::id_darkBlue.
Definition at line 204 of file vpColor.h.
Referenced by vpMbDepthNormalTracker::display(), vpMbDepthNormalTracker::display(), vpMeSite::display(), vpMeSite::display(), vpProjectionDisplay::displayCamera(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::displayFeature(), vpMbEdgeTracker::displayFeaturesOnImage(), vpMbEdgeTracker::displayFeaturesOnImage(), vpImageDraw::drawFrame(), vpTemplateTrackerZone::initClick(), vpMeLine::plugHoles(), vpMeLine::sample(), vpDot2::searchDotsInArea(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremities(), and vpDot2::trackAndDisplay().
Predefined orange color with R=255, G=165 and B=0 and identifier vpColor::id_orange.
Definition at line 207 of file vpColor.h.
Referenced by vpFeatureSegment::display(), vpMeSite::display(), vpMeSite::display(), vpMbEdgeTracker::displayFeaturesOnImage(), and vpMbEdgeTracker::displayFeaturesOnImage().
|
static |
Predefined yellow color with R=G=255 and B=0 and identifier vpColor::id_yellow.
|
static |
Predefined light red color with R= 255 and G=B=140 and identifier vpColor::id_lightRed.
|
static |
Predefined light blue color with B= 255 and R=G=140 and identifier vpColor::id_lightBlue.
|
static |
Predefined light green color with G= 255 and R=B=140 and identifier vpColor::id_lightGreen.
|
inherited |
Green component.
Definition at line 326 of file vpRGBa.h.
Referenced by VISP_NAMESPACE_NAME::adjust(), buildFrom(), vpRBSilhouetteCCDTracker::computeLocalStatistics(), vpHSV< T, useFullScale >::computeNormalizedHSV(), vpImageConvert::convert(), vpColorHistogramMask::display(), vpRBSilhouetteCCDTracker::display(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), vpColorGetter< ID >::get(), vpColorGetter< ID >::get(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpColorHistogram::indexToColor(), vpColor::operator!=, operator!=(), operator*(), operator*, operator*(), operator+(), operator+(), operator-(), operator-(), operator<(), operator<<, operator=(), operator=(), operator=(), operator=(), operator=(), vpColor::operator==, operator==(), operator>(), vpRBProbabilistic3DDriftDetector::score(), vpColor::setColor(), VISP_NAMESPACE_NAME::stretchContrast(), vpRBProbabilistic3DDriftDetector::update(), vpColor::vpColor(), vpProbaComputer::vpProbaComputer(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), and vpImageTools::warpLinear().
Predefined dark gray color with R=G=B=192 and identifier vpColor::id_darkGray.
Predefined dark green color with G= 128 and R=B=0 and identifier vpColor::id_darkGreen.
Definition at line 201 of file vpColor.h.
Referenced by vpBasicFeature::display(), vpBasicFeature::display(), vpBasicKeyPoint::display(), vpFeatureLuminanceMapping::display(), vpFeatureLuminanceMapping::display(), vpForwardProjection::display(), vpForwardProjection::display(), vpKeyPoint::display(), vpKeyPoint::display(), vpMeSite::display(), vpMeSite::display(), vpProjectionDisplay::display(), vpRBSilhouetteCCDTracker::display(), vpProjectionDisplay::displayCamera(), vpMbEdgeTracker::displayFeaturesOnImage(), vpMbEdgeTracker::displayFeaturesOnImage(), vpMeLine::displayLine(), vpMeLine::displayLine(), vpMeLine::displayLine(), vpMeLine::displayLine(), vpKeyPoint::displayMatching(), vpKeyPoint::displayMatching(), vpRBTracker::displaySilhouette(), vpImageDraw::drawFrame(), vpMbTracker::initClick(), vpMbTracker::initClick(), vpMeNurbs::initTracking(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpMeSite::track(), vpDot2::trackAndDisplay(), vpMeSite::trackMultipleHypotheses(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().
| vpColorIdentifier vpColor::id |
|
static |
Predefined blue color with R=G=0 and B=255 and identifier vpColor::id_blue.
|
static |
Predefined gray color with R=G=B=128 and identifier vpColor::id_gray.
|
static |
Predefined green color with G=255 and R=B=0 and identifier vpColor::id_green.
|
static |
Predefined red color with R=255 and G=B=0 and identifier vpColor::id_red.
|
staticconstexprinherited |
|
static |
|
static |
Definition at line 210 of file vpColor.h.
Referenced by vpServoDisplay::display(), vpServoDisplay::display(), vpKeyPoint::displayMatching(), vpKeyPoint::displayMatching(), vpKeyPoint::displayMatching(), vpImageDraw::drawFrame(), vpPose::operator=(), vpDetectorAprilTag::setDisplayTag(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().
Predefined purple color with R=128, G=0 and B=128 and identifier vpColor::id_purple.
Definition at line 208 of file vpColor.h.
Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), and vpMeNurbs::seekExtremitiesCanny().
Predefined none color with R=G=B=0 and identifier vpColor::id_unknown.
Definition at line 209 of file vpColor.h.
Referenced by vpMeSite::display(), vpMeSite::display(), vpMbEdgeTracker::displayFeaturesOnImage(), and vpMbEdgeTracker::displayFeaturesOnImage().
|
inherited |
Red component.
Definition at line 325 of file vpRGBa.h.
Referenced by VISP_NAMESPACE_NAME::adjust(), buildFrom(), vpRBSilhouetteCCDTracker::computeLocalStatistics(), vpHSV< T, useFullScale >::computeNormalizedHSV(), vpImageConvert::convert(), vpColorHistogramMask::display(), vpRBSilhouetteCCDTracker::display(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), vpColorGetter< ID >::get(), vpColorGetter< ID >::get(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpColorHistogram::indexToColor(), vpColor::operator!=, operator!=(), operator*(), operator*, operator*(), operator+(), operator+(), operator-(), operator-(), operator<(), operator<<, operator=(), operator=(), operator=(), operator=(), operator=(), vpColor::operator==, operator==(), operator>(), vpRBProbabilistic3DDriftDetector::score(), vpColor::setColor(), VISP_NAMESPACE_NAME::stretchContrast(), vpRBProbabilistic3DDriftDetector::update(), vpColor::vpColor(), vpProbaComputer::vpProbaComputer(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), vpRGBa(), and vpImageTools::warpLinear().
Predefined dark red color with R= 128 and G=B=0 and identifier vpColor::id_darkRed.
Definition at line 198 of file vpColor.h.
Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), vpColorHistogramMask::display(), vpKeyPoint::display(), vpKeyPoint::display(), vpMbDepthNormalTracker::display(), vpMbDepthNormalTracker::display(), vpMbEdgeKltTracker::display(), vpMbEdgeKltTracker::display(), vpMbKltTracker::display(), vpMbKltTracker::display(), vpMeSite::display(), vpMeSite::display(), vpRBSilhouetteCCDTracker::display(), vpProjectionDisplay::displayCamera(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::displayFeature(), vpMbEdgeTracker::displayFeaturesOnImage(), vpMbEdgeTracker::displayFeaturesOnImage(), vpKeyPoint::displayMatching(), vpKeyPoint::displayMatching(), vpMbtDistanceKltCylinder::displayPrimitive(), vpMbtDistanceKltCylinder::displayPrimitive(), vpMbtDistanceKltPoints::displayPrimitive(), vpMbtDistanceKltPoints::displayPrimitive(), vpImageDraw::drawFrame(), vpWireFrameSimulator::getInternalImage(), vpWireFrameSimulator::getInternalImage(), vpRobotWireFrameSimulator::getInternalView(), vpRobotWireFrameSimulator::getInternalView(), vpMbTracker::initClick(), vpMbTracker::initClick(), vpTemplateTrackerZone::initClick(), vpMeEllipse::initTracking(), vpMeEllipse::initTracking(), vpMeLine::initTracking(), vpMeEllipse::sample(), vpMbDepthDenseTracker::segmentPointCloud(), vpMbDepthDenseTracker::segmentPointCloud(), vpMbDepthDenseTracker::segmentPointCloud(), vpMbDepthNormalTracker::segmentPointCloud(), vpMbDepthNormalTracker::segmentPointCloud(), vpMbDepthNormalTracker::segmentPointCloud(), vpDot2::track(), vpDot::track(), vpMeLine::track(), vpMeSite::track(), vpDot2::trackAndDisplay(), and vpMeSite::trackMultipleHypotheses().
Predefined light gray color with R=G=B=64 and identifier vpColor::id_lightGray.
Definition at line 193 of file vpColor.h.
Referenced by vpImageSimulator::setCleanPreviousImage().
Predefined cyan color with R=0 and G=B=255 and identifier vpColor::id_cyan.
Definition at line 206 of file vpColor.h.
Referenced by vpFeatureSegment::display(), vpFeatureSegment::display(), vpMeSite::display(), vpMeSite::display(), vpMbEdgeTracker::displayFeaturesOnImage(), vpMbEdgeTracker::displayFeaturesOnImage(), and vpMeSite::getQueryList().