Visual Servoing Platform
version 3.6.1 under development (2024-11-15)
|
#include <visp3/gui/vpColorBlindFriendlyPalette.h>
Public Types | |
enum class | Palette { Black = 0 , Orange = 1 , SkyBlue = 2 , Green = 3 , Yellow = 4 , Blue = 5 , Vermillon = 6 , Purple = 7 , COUNT = 8 } |
typedef enum vpColorBlindFriendlyPalette::Palette | Palette |
Public Member Functions | |
vpColorBlindFriendlyPalette () | |
vpColorBlindFriendlyPalette (const Palette &colorID) | |
vpColorBlindFriendlyPalette (const std::string &nameColor) | |
Palette | get_colorID () const |
vpColor | to_vpColor () const |
std::vector< unsigned char > | to_RGB () const |
std::vector< double > | to_colorRatio () const |
bool | set_fromString (const std::string &nameColor) |
std::string | to_string () const |
Static Public Member Functions | |
static std::string | getAvailableColorsNames (const std::string &prefix="", const std::string &separator=" ", const std::string &suffix="") |
Static Public Attributes | |
static std::vector< std::string > | s_paletteNames |
Class that furnishes a set of colors that color blind people should be able to distinguish one from another.
Definition at line 51 of file vpColorBlindFriendlyPalette.h.
Enum that list the different available colors.
|
strong |
Enum that list the different available colors.
Definition at line 57 of file vpColorBlindFriendlyPalette.h.
vpColorBlindFriendlyPalette::vpColorBlindFriendlyPalette | ( | ) |
Construct a new vp Color Blind Friendly Palette. The default value vpColorBlindFriendlyPalette::Palette::COUNT is affected.
Definition at line 66 of file vpColorBlindFriendlyPalette.cpp.
vpColorBlindFriendlyPalette::vpColorBlindFriendlyPalette | ( | const Palette & | colorID | ) |
Construct a new vp Color Blind Friendly Palette object.
colorID | vpColorBlindFriendlyPalette::Palette that permits to determine the RGB values that we must affect to it. |
Definition at line 72 of file vpColorBlindFriendlyPalette.cpp.
vpColorBlindFriendlyPalette::vpColorBlindFriendlyPalette | ( | const std::string & | nameColor | ) |
Construct a new vp Color Blind Friendly Palette object from the name of the color. WARNING: if the color is not found, it will be set to vpColorBlindFriendlyPalette::Palette::COUNT.
nameColor |
Definition at line 78 of file vpColorBlindFriendlyPalette.cpp.
References set_fromString().
vpColorBlindFriendlyPalette::Palette vpColorBlindFriendlyPalette::get_colorID | ( | ) | const |
Get the vpColorBlindFriendlyPalette::Palette the object corresponds to.
Definition at line 84 of file vpColorBlindFriendlyPalette.cpp.
|
static |
Get the list of available colors names.
prefix | Optional prefix that will be written before starting the list. |
separator | Optional separator between each member of the list. |
suffix | Optional suffix that will be written after ending the list. |
Definition at line 135 of file vpColorBlindFriendlyPalette.cpp.
References COUNT, and s_paletteNames.
bool vpColorBlindFriendlyPalette::set_fromString | ( | const std::string & | nameColor | ) |
Set the fromString object.
nameColor |
Definition at line 114 of file vpColorBlindFriendlyPalette.cpp.
References COUNT, and to_string().
Referenced by vpColorBlindFriendlyPalette().
std::vector< double > vpColorBlindFriendlyPalette::to_colorRatio | ( | ) | const |
Cast the object in a vector of doubles that belong to the range [0; 1]. The initial R, G, B values are divided by 255. For instance a pixel whose RGB values would be {0; 127.5; 255.} would be transformed in a vector {0.; 0.5; 1.0}.
Definition at line 104 of file vpColorBlindFriendlyPalette.cpp.
std::vector< unsigned char > vpColorBlindFriendlyPalette::to_RGB | ( | ) | const |
Cast a vpColorBlindFriendlyPalette in a vector {R, G, B}. A vpColorBlindFriendlyPalette::Palette::COUNT object is set as white, i.e. {255, 255, 255}.
Definition at line 94 of file vpColorBlindFriendlyPalette.cpp.
References vpRGBa::B, vpRGBa::G, and vpRGBa::R.
Referenced by ClassUsingPclViewer::blockingMode(), and ClassUsingPclViewer::threadedMode().
std::string vpColorBlindFriendlyPalette::to_string | ( | ) | const |
Get the name of the vpColorBlindFriendlyPalette object.
Definition at line 129 of file vpColorBlindFriendlyPalette.cpp.
Referenced by set_fromString().
vpColor vpColorBlindFriendlyPalette::to_vpColor | ( | ) | const |
Cast a vpColorBlindFriendlyPalette in a vpColor object. A vpColorBlindFriendlyPalette::Palette::COUNT object is set as white (255, 255, 255).
Definition at line 89 of file vpColorBlindFriendlyPalette.cpp.
|
static |
Vector that lists the names of the different available colors.
Definition at line 70 of file vpColorBlindFriendlyPalette.h.
Referenced by getAvailableColorsNames().