NAME
CL_Color - This class provides methods that deal with colors,
DESCRIPTION
including the ability to find color-component bit masks for particular pixel formats. Also you can use this class to get colors, in any of the different pixel formats, from the color components (Red, Blue, Green and Alpha). Often you can specify color components as either integers or floating points (the component value divided by it's maximum possible value.)
CLASS MEMBERS
- static unsigned int get_red_mask(
-
EPixelFormat pixelformat)
- static unsigned int get_green_mask(
-
EPixelFormat pixelformat)
- static unsigned int get_blue_mask(
-
EPixelFormat pixelformat)
- static unsigned int get_alpha_mask(
-
EPixelFormat pixelformat)
- static unsigned int get_color(
-
EPixelFormat fmt, int r, int g, int b, int a=255)
- static unsigned int get_color(
-
EPixelFormat fmt, float r, float g, float b, float a=1.0)
- static unsigned int get_color(
-
unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask, int r, int g, int b, int a=255)
- static unsigned int get_color(
-
unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask, float r, float g, float b, float a=1.0)
- static unsigned int get_color(
-
CL_Target* target, int r, int g, int b, int a=255)
- static unsigned int get_color(
-
CL_Target* target, float r, float g, float b, float a=1.0)
- static float get_color(
-
unsigned int cmask, int color)
MEMBERS WITH DESCRIPTIONS
- static unsigned int get_red_mask(
-
EPixelFormat pixelformat)
Description:
Returns the bit mask for red using the given pixel format.
- static unsigned int get_green_mask(
-
EPixelFormat pixelformat)
Description:
Returns the bit mask for green using the given pixel format.
- static unsigned int get_blue_mask(
-
EPixelFormat pixelformat)
Description:
Returns the bit mask for blue using the given pixel format.
- static unsigned int get_alpha_mask(
-
EPixelFormat pixelformat)
Description:
Returns the bit mask for alpha using the given pixel format.
- static unsigned int get_color(
-
EPixelFormat fmt, int r, int g, int b, int a=255)
Parameters: fmt - the pixel format to use r - the red value as an integer g - the green value as an integer b - the blue value as an integer a - the alpha value as an integer(defaults to opaque)
Description:
Converts separate red, blue, green and alpha integer values into a color value
Return value:
the color value in the requested pixel format
- static unsigned int get_color(
-
EPixelFormat fmt, float r, float g, float b, float a=1.0)
Parameters: fmt - the pixel format to use r - the red value as a floating point number g - the green value as a floating point number b - the blue value as a floating point number a - the alpha value as a floating point number (defaults to opaque)
Description:
Converts separate red, blue, green and alpha floatingpoint values into a single color value
Return value:
the color value in the requested pixel format
- static unsigned int get_color(
-
unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask, int r, int g, int b, int a=255)
Parameters: rmask - the bit mask for red gmask - the bit mask for green bmask - the bit mask for blue amask - the bit mask for the alpha r - the red value as an integer g - the green value as an integer b - the blue value as an integer a - the alpha value as an integer (default is opaque)
Description:
Returns the color value in a format you specifyby giving the red, green, blue and alphamasks, along with the corresponding red, blue,green and alpha values.
Return value:
the color value in the format you specify
- static unsigned int get_color(
-
unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask, float r, float g, float b, float a=1.0)
Parameters: rmask - the bit mask for red gmask - the bit mask for green bmask - the bit mask for blue amask - the bit mask for the alpha r - the red value as a floating point g - the green value as a floating point b - the blue value as a flaoting point a - the alpha value as a floating point (default is opaque)
Description:
Returns the color value in a format you specifyby giving the red, green, blue and alphamasks, along with the corresponding red, blue,green and alpha values.
Return value:
the color value in the format you specify
- static unsigned int get_color(
-
CL_Target* target, int r, int g, int b, int a=255)
Parameters: target - a pointer to a target r - the red value as an integer g - the green value as an integer b - the blue value as an integer a - the alpha value (default is opaque)
Description:
Returns the color value for the specifiedred, blue and green integer components,in the same pixel format as the target.
- static unsigned int get_color(
-
CL_Target* target, float r, float g, float b, float a=1.0)
Parameters: target - pointer to the target r - the red value as a floating point g - the green value as a floating point b - the blue value as a floating point
Description:
Returns the color value for the specified red, blue and green floating point componentsin the same pixel format as the target.
- static float get_color(
-
unsigned int cmask, int color)
Parameters: cmask - the bit mask for the color component you want color - the color to extract the component from
Description:
Takes a color, extracts the color component (red, green, blue or alpha) specified by cmask, and returns it as a floating point. (The floating point value is the amount of the color component divided by that color component's maximum value.)
For example:
If the red component has a maximum value of 255, and the red component of your color was 200, the floating point returned would be 200/255 or 0.7843Return value:
the R, G, B or A value as a floating point
SEE ALSO
All ClanLib API classes can be found in clanlib (3).
AUTHORS
Originally written by Magnus Norddahl <[email protected]> and Martin Starch <[email protected]>. ClanLib is now developed by the ClanLib Development team as an Open Source project.
The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at http://somewhere.in.the.world.org).
See clanlib (3) to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.