MRPT  2.0.0
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
mrpt::img::TColorManager Struct Reference

Detailed Description

Manage R, G, B color triads and ask class instance of the next unique RGB combination.

Definition at line 23 of file TColorManager.h.

#include <mrpt/img/TColorManager.h>

Public Member Functions

 TColorManager (bool use_standard_colors_first=true)
 Constructor. More...
 
 ~TColorManager ()
 Destructor. More...
 
mrpt::img::TColorf getNextTColorf ()
 Get the next RGB triad in TColorf form. More...
 
mrpt::img::TColor getNextTColor ()
 Get the next RGB triad in TColor form. More...
 
bool checkStdColorsUsed ()
 Check if the standard colors have already been used. More...
 

Public Attributes

mrpt::img::TColor curr_color
 
std::set< mrpt::img::TColorused_colors
 
bool use_standard_colors_first
 Indicates if the standard colors are to be returned first. More...
 
bool have_used_standard_colors = false
 Indicates if the standard colors have already been used. More...
 
uint8_t color_step
 
const uint8_t color_thresh {255}
 
bool have_exceeded_colors
 

Private Member Functions

void reset ()
 Reset all class properties to their default values. More...
 
void advanceRGBCounters ()
 
void markColorAsUsed (mrpt::img::TColor color)
 Mark the given color as used. More...
 

Private Attributes

mrpt::img::TColor color_step_triad
 

Constructor & Destructor Documentation

◆ TColorManager()

TColorManager::TColorManager ( bool  use_standard_colors_first = true)

Constructor.

Definition at line 17 of file TColorManager.cpp.

References reset().

Here is the call graph for this function:

◆ ~TColorManager()

TColorManager::~TColorManager ( )
default

Destructor.

Member Function Documentation

◆ advanceRGBCounters()

void TColorManager::advanceRGBCounters ( )
private

Definition at line 73 of file TColorManager.cpp.

References ASSERT_, mrpt::img::TColor::B, mrpt::img::TColor::blue(), color_step, color_step_triad, curr_color, mrpt::img::TColor::green(), have_used_standard_colors, mrpt::img::TColor::red(), THROW_EXCEPTION, and use_standard_colors_first.

Referenced by getNextTColor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkStdColorsUsed()

bool TColorManager::checkStdColorsUsed ( )

Check if the standard colors have already been used.

True if they have indeed been used.

Definition at line 128 of file TColorManager.cpp.

References mrpt::img::TColor::blue(), mrpt::img::TColor::green(), mrpt::img::TColor::red(), and used_colors.

Here is the call graph for this function:

◆ getNextTColor()

TColor TColorManager::getNextTColor ( )

Get the next RGB triad in TColor form.

Method automatically advances the current counters for RGB.

Definition at line 24 of file TColorManager.cpp.

References advanceRGBCounters(), mrpt::img::TColor::blue(), color_thresh, curr_color, mrpt::img::TColor::green(), have_exceeded_colors, have_used_standard_colors, markColorAsUsed(), mrpt::img::TColor::red(), use_standard_colors_first, and used_colors.

Referenced by getNextTColorf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNextTColorf()

TColorf TColorManager::getNextTColorf ( )

Get the next RGB triad in TColorf form.

Method automatically advances the current counters for RGB.

Definition at line 68 of file TColorManager.cpp.

References getNextTColor().

Referenced by mrpt::graphs::detail::CMRVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawEdges(), and mrpt::graphs::detail::CMRVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawNodePoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ markColorAsUsed()

void TColorManager::markColorAsUsed ( mrpt::img::TColor  color)
private

Mark the given color as used.

Definition at line 107 of file TColorManager.cpp.

References ASSERT_, and used_colors.

Referenced by getNextTColor().

Here is the caller graph for this function:

◆ reset()

void TColorManager::reset ( )
private

Reset all class properties to their default values.

Method called in the constructor of the class

Definition at line 116 of file TColorManager.cpp.

References color_step_triad, curr_color, have_exceeded_colors, have_used_standard_colors, use_standard_colors_first, and used_colors.

Referenced by TColorManager().

Here is the caller graph for this function:

Member Data Documentation

◆ color_step

uint8_t mrpt::img::TColorManager::color_step

Definition at line 61 of file TColorManager.h.

Referenced by advanceRGBCounters().

◆ color_step_triad

mrpt::img::TColor mrpt::img::TColorManager::color_step_triad
private

Definition at line 68 of file TColorManager.h.

Referenced by advanceRGBCounters(), and reset().

◆ color_thresh

const uint8_t mrpt::img::TColorManager::color_thresh {255}

Definition at line 62 of file TColorManager.h.

Referenced by getNextTColor().

◆ curr_color

mrpt::img::TColor mrpt::img::TColorManager::curr_color

Definition at line 40 of file TColorManager.h.

Referenced by advanceRGBCounters(), getNextTColor(), and reset().

◆ have_exceeded_colors

bool mrpt::img::TColorManager::have_exceeded_colors

Definition at line 64 of file TColorManager.h.

Referenced by getNextTColor(), and reset().

◆ have_used_standard_colors

bool mrpt::img::TColorManager::have_used_standard_colors = false

Indicates if the standard colors have already been used.

This is a cached version of the value returned from the checkStdColorsUsed method.

Note
Standard colors are: red, green, blue
See also
checkStdColorsUsed

Definition at line 54 of file TColorManager.h.

Referenced by advanceRGBCounters(), getNextTColor(), and reset().

◆ use_standard_colors_first

bool mrpt::img::TColorManager::use_standard_colors_first

Indicates if the standard colors are to be returned first.

Definition at line 44 of file TColorManager.h.

Referenced by advanceRGBCounters(), getNextTColor(), and reset().

◆ used_colors

std::set<mrpt::img::TColor> mrpt::img::TColorManager::used_colors

Definition at line 41 of file TColorManager.h.

Referenced by checkStdColorsUsed(), getNextTColor(), markColorAsUsed(), and reset().




Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020