ALBA
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
albaColor Class Reference

#include <albaColor.h>

Public Member Functions

 albaColor ()
 
 albaColor (int r, int g, int b, int a=0)
 
 albaColor (double *vtkRGBA)
 
 albaColor (wxColour col)
 
void Set (wxColour col)
 
wxColour Get ()
 
void SetRGB (int r, int g, int b, int a=-1)
 
void GetRGB (int *r, int *g, int *b, int *a=NULL)
 
void SetHSV (int h, int s, int v)
 
void GetHSV (int *h, int *s, int *v)
 
void SetFloatRGB (double r, double g, double b, double o=-1)
 
void GetFloatRGB (double *r, double *g, double *b, double *o)
 
void HSVToRGB ()
 
void RGBToHSV ()
 

Static Public Member Functions

static void RGBToHSV (int r, int g, int b, int *h, int *s, int *v)
 
static void HSVToRGB (int h, int s, int v, int *r, int *g, int *b)
 
static void RGBToHSL (int r, int g, int b, int *h, int *s, int *l)
 
static void HSLToRGB (int h, int s, int v, int *r, int *g, int *b)
 
static albaColor InterpolateHSV (albaColor c1, albaColor c2, double t)
 
static albaColor InterpolateRGB (albaColor c1, albaColor c2, double t)
 
static albaColor CheckeredColor (albaColor c, int x, int y)
 

Public Attributes

int m_Red
 
int m_Green
 
int m_Blue
 
int m_Hue
 
int m_Saturation
 
int m_Value
 
int m_Alpha
 

Detailed Description

albaColor is a class representing an RGBA color:

Definition at line 42 of file albaColor.h.

Constructor & Destructor Documentation

◆ albaColor() [1/4]

albaColor::albaColor ( )

default ctor

◆ albaColor() [2/4]

albaColor::albaColor ( int  r,
int  g,
int  b,
int  a = 0 
)

ctor accepting an integer RGBA

◆ albaColor() [3/4]

albaColor::albaColor ( double *  vtkRGBA)

ctor accepting an vtk color

◆ albaColor() [4/4]

albaColor::albaColor ( wxColour  col)

ctor accepting an wxColour

Member Function Documentation

◆ Set()

void albaColor::Set ( wxColour  col)

Set using wxColour.

◆ Get()

wxColour albaColor::Get ( )

Get returning wxColour.

◆ SetRGB()

void albaColor::SetRGB ( int  r,
int  g,
int  b,
int  a = -1 
)

Set using integer RGBA - components in [0..255].

◆ GetRGB()

void albaColor::GetRGB ( int *  r,
int *  g,
int *  b,
int *  a = NULL 
)

Get returning integer RGBA - components in [0..255].

◆ SetHSV()

void albaColor::SetHSV ( int  h,
int  s,
int  v 
)

Set using integer HSV - H in [0..360] ,S,V in [0..255].

◆ GetHSV()

void albaColor::GetHSV ( int *  h,
int *  s,
int *  v 
)

Set returning integer HSV - H in [0..360] ,S,V in [0..255].

◆ SetFloatRGB()

void albaColor::SetFloatRGB ( double  r,
double  g,
double  b,
double  o = -1 
)

Set using double RGBA - components normalized on [0,1].

  • o is the opacity == 1-alpha

◆ GetFloatRGB()

void albaColor::GetFloatRGB ( double *  r,
double *  g,
double *  b,
double *  o 
)

Get returning double RGBA - components normalized on [0,1].

  • o is the opacity == 1-alpha

◆ HSVToRGB() [1/2]

void albaColor::HSVToRGB ( )

Force updating the RGB representation.

  • useful if the HSV member variable are set directly

◆ RGBToHSV() [1/2]

void albaColor::RGBToHSV ( )

Force updating the HSV representation.

  • useful if the RGB member variable are set directly

◆ RGBToHSV() [2/2]

static void albaColor::RGBToHSV ( int  r,
int  g,
int  b,
int *  h,
int *  s,
int *  v 
)
static

static function - conversion from RGB to HSV, all represented on Integer

◆ HSVToRGB() [2/2]

static void albaColor::HSVToRGB ( int  h,
int  s,
int  v,
int *  r,
int *  g,
int *  b 
)
static

static function - conversion from HSV to RGB, all represented on Integer

◆ RGBToHSL()

static void albaColor::RGBToHSL ( int  r,
int  g,
int  b,
int *  h,
int *  s,
int *  l 
)
static

static function - conversion from RGB to HSL, all represented on Integer

◆ HSLToRGB()

static void albaColor::HSLToRGB ( int  h,
int  s,
int  v,
int *  r,
int *  g,
int *  b 
)
static

static function - conversion from RGB to HSL, all represented on Integer

◆ InterpolateHSV()

static albaColor albaColor::InterpolateHSV ( albaColor  c1,
albaColor  c2,
double  t 
)
static

static function - Interpolate two color using a weight t in HSV space.

t=0 return c1, t=1 return c2

◆ InterpolateRGB()

static albaColor albaColor::InterpolateRGB ( albaColor  c1,
albaColor  c2,
double  t 
)
static

static function - Interpolate two color using a weight t in RGB space.

t=0 return c1, t=1 return c2

Referenced by CheckeredColor().

◆ CheckeredColor()

static albaColor albaColor::CheckeredColor ( albaColor  c,
int  x,
int  y 
)
inlinestatic

static function - used to visually render a transparent color.

The resulting color depend on the position, and form a checkered pattern

Definition at line 102 of file albaColor.h.

References InterpolateRGB(), and m_Alpha.

Here is the call graph for this function:

Member Data Documentation

◆ m_Red

int albaColor::m_Red

Definition at line 115 of file albaColor.h.

◆ m_Green

int albaColor::m_Green

Definition at line 115 of file albaColor.h.

◆ m_Blue

int albaColor::m_Blue

rgb color representation

Definition at line 115 of file albaColor.h.

◆ m_Hue

int albaColor::m_Hue

Definition at line 116 of file albaColor.h.

◆ m_Saturation

int albaColor::m_Saturation

Definition at line 116 of file albaColor.h.

◆ m_Value

int albaColor::m_Value

hsv color representation

Definition at line 116 of file albaColor.h.

◆ m_Alpha

int albaColor::m_Alpha

alpha value

Definition at line 117 of file albaColor.h.

Referenced by CheckeredColor().


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