MRPT  1.9.9
TColorManager.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/img/TColor.h>
12 #include <utility>
13 #include <set>
14 #include <cstdlib>
15 #include <iostream>
16 
17 namespace mrpt::img
18 {
19 // TODO - finish this.
20 /**\brief Manage R, G, B color triads and ask class instance of the next
21  * unique RGB combination.
22  */
24 {
25  public:
26  /**\brief Constructor */
28  /**\brief Destructor */
30  /**\brief Get the next RGB triad in TColorf form.
31  *
32  * Method automatically advances the current counters for RGB.
33  */
35  /**\brief Get the next RGB triad in TColor form.
36  *
37  * Method automatically advances the current counters for RGB.
38  */
41  std::set<mrpt::img::TColor> used_colors;
42  /** Indicates if the standard colors are to be returned first.
43  */
45  /** Indicates if the standard colors have already been used.
46  *
47  * This is a cached version of the value returned from the
48  * checkStdColorsUsed method.
49  *
50  * \note Standard colors are: red, green, blue
51  *
52  * \sa checkStdColorsUsed
53  */
55  /**\brief Check if the standard colors have already been used.
56  *
57  * \ret True if they have indeed been used.
58  */
59  bool checkStdColorsUsed();
60 
63 
65 
66  private:
67  // color triad with which to advance the current TColor instance
69 
70  /**\brief Reset all class properties to their default values
71  *
72  * Method called in the constructor of the class
73  */
74  void reset();
75  void advanceRGBCounters();
76  /**\brief Mark the given color as used. */
78 };
79 }
80 
void markColorAsUsed(mrpt::img::TColor color)
Mark the given color as used.
bool checkStdColorsUsed()
Check if the standard colors have already been used.
mrpt::img::TColor getNextTColor()
Get the next RGB triad in TColor form.
mrpt::img::TColor color_step_triad
Definition: TColorManager.h:68
bool use_standard_colors_first
Indicates if the standard colors are to be returned first.
Definition: TColorManager.h:44
mrpt::img::TColorf getNextTColorf()
Get the next RGB triad in TColorf form.
unsigned char uint8_t
Definition: rptypes.h:41
GLuint color
Definition: glext.h:8300
~TColorManager()
Destructor.
const uint8_t color_thresh
Definition: TColorManager.h:62
void reset()
Reset all class properties to their default values.
A RGB color - floats in the range [0,1].
Definition: TColor.h:77
mrpt::img::TColor curr_color
Definition: TColorManager.h:40
bool have_used_standard_colors
Indicates if the standard colors have already been used.
Definition: TColorManager.h:54
A RGB color - 8bit.
Definition: TColor.h:20
TColorManager(bool use_standard_colors_first=true)
Constructor.
Manage R, G, B color triads and ask class instance of the next unique RGB combination.
Definition: TColorManager.h:23
std::set< mrpt::img::TColor > used_colors
Definition: TColorManager.h:41



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020