42 OColor(
float red,
float green,
float blue,
float alpha = 1.0f);
53 operator const float*()
const;
68 void getAsHSB(
float& hue,
float& saturation,
float& brightness)
const;
73 void setAsHSB(
const float hue,
const float saturation,
const float brightness);
100 return (std::fabs(
a -
b) <= epsilon * std::max(std::fabs(
a), std::fabs(
b)));
111 inline OColor::OColor(
float red,
float green,
float blue,
float alpha) : r(red), g(green), b(blue), a(alpha)
131 inline OColor::operator
float*()
136 inline OColor::operator
const float*()
const
150 const float* saturationRange,
const float* valueRange,
155 const float* saturationRange,
const float* valueRange,
159 static void getSqrtColorTable(
const unsigned int& nbColors,
const float* hueRange,
160 const float* saturationRange,
const float* valueRange,
164 static void getGaussColorTable(
const unsigned int& nbColors,
const float& alpha1,
const float& alpha2,
static const OColor GREEN
unsigned int getAsRGBA() const
void operator=(const OColor &c)
static const OColor BLACK
static const OColor WHITE
void getAsHSB(float &hue, float &saturation, float &brightness) const
static const float equality_threshold
static const OColor YELLOW
void setAsHSB(const float hue, const float saturation, const float brightness)
static bool float_eq(float a, float b, float epsilon=equality_threshold)
void setAsRGBA(const unsigned int val)
static const OColor MAGENTA
bool operator==(const OColor &other) const
static void getLinearColorTable(const unsigned int &nbColors, const float *hueRange, const float *saturationRange, const float *valueRange, OLookupTable &outColors)
Generation de la table de couleurs basee sur une rampe lineaire ( y = x+0.5/255 )
static void getGaussColorTable(const unsigned int &nbColors, const float &alpha1, const float &alpha2, OLookupTable &outColors)
Generation de la table de couleurs a partir d'une repartition gaussienne en R, G, B.
static void getSqrtColorTable(const unsigned int &nbColors, const float *hueRange, const float *saturationRange, const float *valueRange, OLookupTable &outColors)
Generation de la table de couleurs basee sur une rampe sqrt ( y = sqrt(x)+0.5/255 )
static void getSCurveColorTable(const unsigned int &nbColors, const float *hueRange, const float *saturationRange, const float *valueRange, OLookupTable &outColors)
Generation de la table de couleurs basee sur une rampe S-Curve ( y = (1-cos(pi*x))/2 )
std::vector< OColor > OLookupTable
Collection de OColor.