Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | Static Protected Attributes | List of all members
OColor Class Reference

#include <color.h>

Collaboration diagram for OColor:
Collaboration graph
[legend]

Public Member Functions

 OColor ()
 
 OColor (const OColor &c)
 
 OColor (float *c)
 
 OColor (float red, float green, float blue, float alpha=1.0f)
 
void operator= (const OColor &c)
 
 operator float * ()
 
 operator const float * () const
 
unsigned int getAsRGBA () const
 
void setAsRGBA (const unsigned int val)
 
void getAsHSB (float &hue, float &saturation, float &brightness) const
 
void setAsHSB (const float hue, const float saturation, const float brightness)
 
void clamp ()
 
OColor clampCopy () const
 
bool operator== (const OColor &other) const
 

Public Attributes

float r
 
float g
 
float b
 
float a
 

Static Public Attributes

static const OColor BLACK = OColor(0.0f, 0.0f, 0.0f)
 
static const OColor BLUE = OColor(0.0f, 0.0f, 1.0f)
 
static const OColor GREEN = OColor(0.0f, 1.0f, 0.0f)
 
static const OColor CYAN = OColor(0.0f, 1.0f, 1.0f)
 
static const OColor RED = OColor(1.0f, 0.0f, 0.0f)
 
static const OColor MAGENTA = OColor(1.0f, 0.0f, 1.0f)
 
static const OColor YELLOW = OColor(1.0f, 1.0f, 0.0f)
 
static const OColor WHITE = OColor(1.0f, 1.0f, 1.0f)
 

Static Protected Member Functions

static bool float_eq (float a, float b, float epsilon=equality_threshold)
 

Static Protected Attributes

static const float equality_threshold = 1e3f * std::numeric_limits<float>::epsilon()
 

Detailed Description

Classe definition un objet couleur.

Definition at line 30 of file color.h.

Constructor & Destructor Documentation

◆ OColor() [1/4]

OColor::OColor ( )
inline

Constructeurs

Definition at line 107 of file color.h.

◆ OColor() [2/4]

OColor::OColor ( const OColor c)
inline

Definition at line 109 of file color.h.

◆ OColor() [3/4]

OColor::OColor ( float *  c)
inline

Definition at line 115 of file color.h.

◆ OColor() [4/4]

OColor::OColor ( float  red,
float  green,
float  blue,
float  alpha = 1.0f 
)
inline

Definition at line 111 of file color.h.

Member Function Documentation

◆ clamp()

void OColor::clamp ( )

Clamp les couleurs entre [0, 1]

Definition at line 233 of file color.cpp.

Here is the caller graph for this function:

◆ clampCopy()

OColor OColor::clampCopy ( ) const

Definition at line 276 of file color.cpp.

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

◆ float_eq()

static bool OColor::float_eq ( float  a,
float  b,
float  epsilon = equality_threshold 
)
inlinestaticprotected

Definition at line 98 of file color.h.

Here is the caller graph for this function:

◆ getAsHSB()

void OColor::getAsHSB ( float &  hue,
float &  saturation,
float &  brightness 
) const

Get de la couleur en HSB (Hue, Saturation and Brightness)

Definition at line 91 of file color.cpp.

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

◆ getAsRGBA()

unsigned int OColor::getAsRGBA ( ) const

Get de la couleur en RGBA

Definition at line 44 of file color.cpp.

Here is the caller graph for this function:

◆ operator const float *()

OColor::operator const float * ( ) const
inline

Definition at line 136 of file color.h.

◆ operator float *()

OColor::operator float * ( )
inline

Operateurs de cast

Definition at line 131 of file color.h.

◆ operator=()

void OColor::operator= ( const OColor c)
inline

Operateur d'asignation

Definition at line 123 of file color.h.

◆ operator==()

bool OColor::operator== ( const OColor other) const

Definition at line 39 of file color.cpp.

Here is the call graph for this function:

◆ setAsHSB()

void OColor::setAsHSB ( const float  hue,
const float  saturation,
const float  brightness 
)

Set de la couleur en HSB (Hue, Saturation and Brightness)

Definition at line 141 of file color.cpp.

Here is the caller graph for this function:

◆ setAsRGBA()

void OColor::setAsRGBA ( const unsigned int  val)

Set de la couleur en RGBA

Definition at line 71 of file color.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ a

float OColor::a

Definition at line 33 of file color.h.

◆ b

float OColor::b

Definition at line 33 of file color.h.

◆ BLACK

const OColor OColor::BLACK = OColor(0.0f, 0.0f, 0.0f)
static

Constantes

Definition at line 86 of file color.h.

◆ BLUE

const OColor OColor::BLUE = OColor(0.0f, 0.0f, 1.0f)
static

Definition at line 87 of file color.h.

◆ CYAN

const OColor OColor::CYAN = OColor(0.0f, 1.0f, 1.0f)
static

Definition at line 89 of file color.h.

◆ equality_threshold

const float OColor::equality_threshold = 1e3f * std::numeric_limits<float>::epsilon()
staticprotected

Definition at line 96 of file color.h.

◆ g

float OColor::g

Definition at line 33 of file color.h.

◆ GREEN

const OColor OColor::GREEN = OColor(0.0f, 1.0f, 0.0f)
static

Definition at line 88 of file color.h.

◆ MAGENTA

const OColor OColor::MAGENTA = OColor(1.0f, 0.0f, 1.0f)
static

Definition at line 91 of file color.h.

◆ r

float OColor::r

Definition at line 33 of file color.h.

◆ RED

const OColor OColor::RED = OColor(1.0f, 0.0f, 0.0f)
static

Definition at line 90 of file color.h.

◆ WHITE

const OColor OColor::WHITE = OColor(1.0f, 1.0f, 1.0f)
static

Definition at line 93 of file color.h.

◆ YELLOW

const OColor OColor::YELLOW = OColor(1.0f, 1.0f, 0.0f)
static

Definition at line 92 of file color.h.


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