Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
vpColorBlindFriendlyPalette.h
1/****************************************************************************
2 *
3 * ViSP, open source Visual Servoing Platform software.
4 * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
5 *
6 * This software is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * See the file LICENSE.txt at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using ViSP with software that can not be combined with the GNU
14 * GPL, please contact Inria about acquiring a ViSP Professional
15 * Edition License.
16 *
17 * See https://visp.inria.fr for more information.
18 *
19 * This software was developed at:
20 * Inria Rennes - Bretagne Atlantique
21 * Campus Universitaire de Beaulieu
22 * 35042 Rennes Cedex
23 * France
24 *
25 * If you have questions regarding the use of this file, please contact
26 * Inria at visp@inria.fr
27 *
28 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 *
31 * Description:
32 * Palette of colors that is said to be color-blind people friendly.
33 * This palette has been found on https://jfly.uni-koeln.de/color/#see
34 *
35*****************************************************************************/
36
37#ifndef _vpColorBlindFliendlyPalette_h_
38#define _vpColorBlindFliendlyPalette_h_
39
40#include<visp3/core/vpConfig.h>
41#include<visp3/core/vpColor.h>
42
43#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
49{
50public:
54 typedef enum class Palette
55 {
56 Black = 0,
57 Orange = 1,
58 SkyBlue = 2,
59 Green = 3,
60 Yellow = 4,
61 Blue = 5,
62 Vermillon = 6,
63 Purple = 7,
64 COUNT = 8
65 }Palette;
66
67 static std::vector<std::string> s_paletteNames;
75
82 vpColorBlindFriendlyPalette(const Palette &colorID);
83
90 vpColorBlindFriendlyPalette(const std::string &nameColor);
91
97 Palette get_colorID() const;
98
105 vpColor to_vpColor() const;
106
114 std::vector<unsigned char> to_RGB() const;
115
125 std::vector<double> to_colorRatio() const;
126
134 bool set_fromString(const std::string &nameColor);
135
141 std::string to_string() const;
142
148 unsigned int to_uint() const;
149
158 static std::string getAvailableColorsNames(const std::string &prefix = "", const std::string &separator = " ", const std::string &suffix = "");
159private:
160 static std::vector<vpColor> s_palette;
169 static unsigned int to_uint(const Palette &colorID);
170
178 static std::string to_string(const Palette &colorID);
179
180 Palette m_colorID;
181};
182
190std::ostream &operator<<(std::ostream &os, const vpColorBlindFriendlyPalette &color);
191
200std::istream &operator>>(std::istream &is, vpColorBlindFriendlyPalette &color);
201
202#endif
203#endif // _vpColorBlindFliendlyPalette_h_
Class that furnishes a set of colors that color blind people should be able to distinguish one from a...
Palette
Enum that list the different available colors.
unsigned int to_uint() const
Cast the object into an unsigned int that matches the value of its _colorID member.
Class to define RGB colors available for display functionalities.
Definition vpColor.h:152