Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > f48941b2df41f17d4c9519d16b753438 > files > 317

ClanLib06-devel-0.6.5-16.fc13.x86_64.rpm


<html>
<head><title>ClanLib Reference: CL_Color</title></head>
<body text=black link=blue vlink=#800080 bgcolor=white topmargin=0 leftmargin=0>
<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td><img border=0 src="../images/eyeheader-main-purple-a.gif" alt="ClanSoft logo" width=525 height=96></td></tr>
<tr bgcolor=#dadada><td align=left valign=top><img border=0 src="../images/eyeheader-main-purple-b.gif" alt="ClanSoft logo" width=190 height=14></td><td align=right valign=top><img border=0 src="../images/clanlib_light.gif" width=42 height=14></td></tr></table>
<table align=center border=0 cellspacing=10> <tr>
<td><a href="entire_class_index.html">Entire Class Index</a></td>
<td><a href="class_index.html">Main Class Index</a></td>
<td><a href="cross_index.html">Cross Index</a></td>
<td><a href="global_index.html">Global Index</a></td>
</table><h1 align=center>Class CL_Color</h1><p>
<b>  The Color class</b><br>
Contained in: <a href="global_index.html">global</a><br>
Derived from:
<i>none</i>
<br>
Derived by:
<i>none</i>
<br>Group: Display (Display 2D)
<p>
#include &lt;ClanLib/display.h&gt;
<p>
<hr noshade>
<table border=0>
<tr><td colspan=3><h3>public function member index:</h3></td>
<tr valign=top><td align=left><h3>Attributes:</h3></td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2302"><tt><font color=blue><b>get_red_mask</b></font></tt></a></td><td><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>pixelformat</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2303"><tt><font color=blue><b>get_green_mask</b></font></tt></a></td><td><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>pixelformat</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2304"><tt><font color=blue><b>get_blue_mask</b></font></tt></a></td><td><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>pixelformat</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2305"><tt><font color=blue><b>get_alpha_mask</b></font></tt></a></td><td><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>pixelformat</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2306"><tt><font color=blue><b>get_color</b></font></tt></a></td><td><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>fmt</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>a</font></tt>=255)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2307"><tt><font color=blue><b>get_color</b></font></tt></a></td><td><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>fmt</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>a</font></tt>=1.0)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2308"><tt><font color=blue><b>get_color</b></font></tt></a></td><td><tt>(<tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>rmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>gmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>bmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>amask</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>a</font></tt>=255)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2309"><tt><font color=blue><b>get_color</b></font></tt></a></td><td><tt>(<tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>rmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>gmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>bmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>amask</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>a</font></tt>=1.0)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2310"><tt><font color=blue><b>get_color</b></font></tt></a></td><td><tt>(<a href="CL_Target.html"><tt><font color=navy><b>CL_Target</b></font></tt></a>* <tt><font color=blue>target</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>a</font></tt>=255)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Color.html#2311"><tt><font color=blue><b>get_color</b></font></tt></a></td><td><tt>(<a href="CL_Target.html"><tt><font color=navy><b>CL_Target</b></font></tt></a>* <tt><font color=blue>target</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>a</font></tt>=1.0)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=purple>float</font></tt></tt> </td><td align=right><a href="CL_Color.html#2312"><tt><font color=blue><b>get_color</b></font></tt></a></td><td><tt>(<tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>cmask</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>color</font></tt>)</tt>;</td>
<tr><td>&nbsp;</td></table>
<hr noshade>
<h2>Description:</h2>
  This class provides methods that deal with colors,   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).<br>  Often you can specify color components as either  integers or floating points (the component value   divided by it's maximum possible value.)<br><p>
<hr noshade>
<h2>Function Member Descriptions:</h2>
<a name="2305"><font size=+1><b>CL_Color::get_alpha_mask</b></font></a> -   Returns the bit mask for alpha using the given pixel format.<br><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2305"><tt><font color=blue><b>get_alpha_mask</b></font></tt></a><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>pixelformat</font></tt>)</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2304"><font size=+1><b>CL_Color::get_blue_mask</b></font></a> -   Returns the bit mask for blue using the given pixel format.<br><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2304"><tt><font color=blue><b>get_blue_mask</b></font></tt></a><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>pixelformat</font></tt>)</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2306"><font size=+1><b>CL_Color::get_color</b></font></a> -   Converts separate red, blue, green and alpha  integer values into a color value<br><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2306"><tt><font color=blue><b>get_color</b></font></tt></a><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>fmt</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>a</font></tt>=255)</tt>;<br><blockquote>  fmt - the pixel format to use<br>  r - the red value as an integer<br>  g - the green value as an integer<br>  b - the blue value as an integer<br>  a - the alpha value as an integer(defaults to opaque)<br>  Returns - the color value in the requested pixel format</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2307"><font size=+1><b>CL_Color::get_color</b></font></a> -   Converts separate red, blue, green and alpha floating  point values into a single color value<br><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2307"><tt><font color=blue><b>get_color</b></font></tt></a><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>fmt</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>a</font></tt>=1.0)</tt>;<br><blockquote>  fmt - the pixel format to use<br>  r - the red value as a floating point number<br>  g - the green value as a floating point number<br>  b - the blue value as a floating point number<br>  a - the alpha value as a floating point number (defaults to opaque)<br>  Returns - the color value in the requested pixel format</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2308"><font size=+1><b>CL_Color::get_color</b></font></a> -   Returns the color value in a format you specify  by giving the red, green, blue and alpha  masks, along with the corresponding red, blue,  green and alpha values.<br><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2308"><tt><font color=blue><b>get_color</b></font></tt></a><tt>(<tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>rmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>gmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>bmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>amask</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>a</font></tt>=255)</tt>;<br><blockquote>  rmask - the bit mask for red<br>  gmask - the bit mask for green<br>  bmask - the bit mask for blue<br>  amask - the bit mask for the alpha<br>  r - the red value as an integer<br>  g - the green value as an integer<br>  b - the blue value as an integer<br>  a - the alpha value as an integer (default is opaque)<br>  Returns - the color value in the format you specify</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2309"><font size=+1><b>CL_Color::get_color</b></font></a> -   Returns the color value in a format you specify  by giving the red, green, blue and alpha  masks, along with the corresponding red, blue,  green and alpha values.<br><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2309"><tt><font color=blue><b>get_color</b></font></tt></a><tt>(<tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>rmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>gmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>bmask</font></tt>, <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>amask</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>a</font></tt>=1.0)</tt>;<br><blockquote>  rmask - the bit mask for red<br>  gmask - the bit mask for green<br>  bmask - the bit mask for blue<br>  amask - the bit mask for the alpha<br>  r - the red value as a floating point <br>  g - the green value as a floating point <br>  b - the blue value as a flaoting point<br>  a - the alpha value as a floating point (default is opaque)<br>  Returns - the color value in the format you specify</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2310"><font size=+1><b>CL_Color::get_color</b></font></a> -   Returns the color value for the specified  red, blue and green integer components,  in the  same pixel format as the target.<tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2310"><tt><font color=blue><b>get_color</b></font></tt></a><tt>(<a href="CL_Target.html"><tt><font color=navy><b>CL_Target</b></font></tt></a>* <tt><font color=blue>target</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>a</font></tt>=255)</tt>;<br><blockquote>  target - a pointer to a target &lt;/p&gt;<br>  r - the red value as an integer<br>  g - the green value as an integer<br>  b - the blue value as an integer<br>  a - the alpha value (default is opaque)</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2311"><font size=+1><b>CL_Color::get_color</b></font></a> -   Returns the color value for the specified   red, blue and green floating point components  in the same pixel format as the target.<br><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2311"><tt><font color=blue><b>get_color</b></font></tt></a><tt>(<a href="CL_Target.html"><tt><font color=navy><b>CL_Target</b></font></tt></a>* <tt><font color=blue>target</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>r</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>g</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>b</font></tt>, <tt><font color=purple>float</font></tt> <tt><font color=blue>a</font></tt>=1.0)</tt>;<br><blockquote>  target - pointer to the target<br>  r - the red value as a floating point<br>  g - the green value as a floating point<br>  b - the blue value as a floating point</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2312"><font size=+1><b>CL_Color::get_color</b></font></a> -   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.) <br>   For example:<br>  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.7843<br><tt><tt>static</tt> <tt><font color=purple>float</font></tt></tt> <a href="CL_Color.html#2312"><tt><font color=blue><b>get_color</b></font></tt></a><tt>(<tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt> <tt><font color=blue>cmask</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>color</font></tt>)</tt>;<br><blockquote>  cmask - the bit mask for the color component you want<br>  color - the color to extract the component from<br>  Returns - the R, G, B or A value as a floating point</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2303"><font size=+1><b>CL_Color::get_green_mask</b></font></a> -   Returns the bit mask for green using the given pixel format.<br><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2303"><tt><font color=blue><b>get_green_mask</b></font></tt></a><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>pixelformat</font></tt>)</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2302"><font size=+1><b>CL_Color::get_red_mask</b></font></a> -   Returns the bit mask for red using the given pixel format.<br><tt><tt>static</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_Color.html#2302"><tt><font color=blue><b>get_red_mask</b></font></tt></a><tt>(<tt><font color=navy>EPixelFormat</font></tt> <tt><font color=blue>pixelformat</font></tt>)</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<hr noshade>
</body>
</html>