bpp-core3  3.0.0
bpp::XFigColorManager Class Reference

Color manager for the XFig format. More...

#include <Bpp/Graphics/ColorManager.h>

+ Inheritance diagram for bpp::XFigColorManager:
+ Collaboration diagram for bpp::XFigColorManager:

Public Member Functions

 XFigColorManager ()
 
virtual ~XFigColorManager ()
 
unsigned int getCode (const RGBColor &color)
 
const RGBColorgetColor (unsigned int &code) const
 
const std::vector< unsigned int > & getCodes () const
 
const std::vector< RGBColor > & getColors () const
 
size_t getNumberOfColors () const
 

Protected Attributes

unsigned int currentCode_
 
std::vector< RGBColorcolors_
 
std::vector< unsigned int > codes_
 

Detailed Description

Color manager for the XFig format.

Default colors are coded from 0 to 31. New colors may be added from code 32.

Definition at line 103 of file ColorManager.h.

Constructor & Destructor Documentation

◆ XFigColorManager()

◆ ~XFigColorManager()

virtual bpp::XFigColorManager::~XFigColorManager ( )
inlinevirtual

Definition at line 151 of file ColorManager.h.

Member Function Documentation

◆ getCode()

unsigned int bpp::XFigColorManager::getCode ( const RGBColor color)
inlinevirtual
Parameters
colorThe color to look for.
Returns
The code associated to a given color.

Implements bpp::ColorManager< unsigned int >.

Definition at line 154 of file ColorManager.h.

References codes_, colors_, and currentCode_.

◆ getCodes()

const std::vector<unsigned int>& bpp::XFigColorManager::getCodes ( ) const
inlinevirtual
Returns
All valid codes.

Implements bpp::ColorManager< unsigned int >.

Definition at line 179 of file ColorManager.h.

References codes_.

◆ getColor()

const RGBColor& bpp::XFigColorManager::getColor ( unsigned int &  code) const
inlinevirtual
Parameters
codeThe code to look for.
Returns
The color associated to a given code.
Exceptions
exceptionif the code is not valid.

Implements bpp::ColorManager< unsigned int >.

Definition at line 168 of file ColorManager.h.

References codes_, colors_, and bpp::TextTools::toString().

◆ getColors()

const std::vector<RGBColor>& bpp::XFigColorManager::getColors ( ) const
inlinevirtual
Returns
All available colors.

Implements bpp::ColorManager< unsigned int >.

Definition at line 180 of file ColorManager.h.

References colors_.

◆ getNumberOfColors()

size_t bpp::XFigColorManager::getNumberOfColors ( ) const
inlinevirtual
Returns
The total number of colors available.

Implements bpp::ColorManager< unsigned int >.

Definition at line 181 of file ColorManager.h.

References colors_.

Member Data Documentation

◆ codes_

std::vector<unsigned int> bpp::XFigColorManager::codes_
protected

Definition at line 109 of file ColorManager.h.

Referenced by getCode(), getCodes(), getColor(), and XFigColorManager().

◆ colors_

std::vector<RGBColor> bpp::XFigColorManager::colors_
protected

Definition at line 108 of file ColorManager.h.

Referenced by getCode(), getColor(), getColors(), getNumberOfColors(), and XFigColorManager().

◆ currentCode_

unsigned int bpp::XFigColorManager::currentCode_
protected

Definition at line 107 of file ColorManager.h.

Referenced by getCode().


The documentation for this class was generated from the following file: