C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
VSN::Color Class Reference

Color class defines color based on RGB or HSV, or CMYK values. More...

#include <vsn_color.h>

+ Collaboration diagram for VSN::Color:

Public Types

enum  ColorType
 Enumeration of settings color types.
 

Public Member Functions

 Color ()
 Default constructor.
 
 Color (int red, int green, int blue, int alpha=255)
 Special constructor for setting all components.
 
 Color (float red, float green, float blue, float alpha=1.0)
 Special constructor for setting all components.
 
 Color (const Color &other)
 Copy constructor.
 
 ~Color ()
 Destructor.
 
bool IsValid () const
 True if all components are initialized.
 
int GetAlpha () const
 Returns the alpha component of given color.
 
void SetAlpha (int alpha)
 Sets the alpha component of given color.
 
float GetAlphaF () const
 Returns the alpha component of given color.
 
void SetAlphaF (float alpha)
 Sets the alpha component of given color.
 
int GetRed () const
 Returns the red component of given color.
 
void SetRed (int red)
 Sets the red component of given color.
 
int GetGreen () const
 Returns the green component of given color.
 
void SetGreen (int green)
 Sets the green component of given color.
 
int GetBlue () const
 Returns the blue component of given color.
 
void SetBlue (int blue)
 Sets the blue component of given color.
 
float GetRedF () const
 Returns the red component of given color.
 
void SetRedF (float red)
 Sets the red component of given color.
 
float GetGreenF () const
 Returns the green component of given color.
 
void SetGreenF (float green)
 Sets the green component of given color.
 
float GetBlueF () const
 Returns the blue component of given color.
 
void SetBlueF (float blue)
 Sets the blue component of given color.
 
void GetRgb (int *r, int *g, int *b, int *a=0) const
 Returns all values of color components.
 
void SetRgb (int r, int g, int b, int a=255)
 Sets all color components.
 
void GetRgbF (float *r, float *g, float *b, float *a=0) const
 Returns pointers to all components.
 
void SetRgbF (float r, float g, float b, float a=1.0)
 Sets pointers to all components.
 
vRgb GetRgba () const
 Returns RGB value of given color including the alpha component.
 
Color ToRgb () const
 Creates and returns RGB color based on given color.
 
Coloroperator= (const Color &other)
 Copy constructor.
 
bool operator== (const Color &c) const
 True if the color has such RGB and alpha values as specified color.
 
bool operator!= (const Color &c) const
 True if the color has different RGB and alpha values from the specified color.
 

Static Public Attributes

static const Color DEFINE_WHITE
 Define сolor.
 

Detailed Description

Color class defines color based on RGB or HSV, or CMYK values.

Color is often determined in terms of RGB components (red, green and blue), but it can also be set with HSV components (hue, saturation and value) or CMYK components (cyan, magenta, yellow and key color, or black). Besides, color can be determined using the color name.


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