1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>g2: color manipulations</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
</ul></div>
<h1>color manipulations<br>
<small>
[<a class="el" href="group__interface.html">g2 User Interface</a>]</small>
</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__color.html#g23fb2c58c675c566a16f8e9f738f102e">g2_pen</a> (int dev, int color)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__color.html#g8d697444755ba6547eda9732c6b541c8">g2_set_background</a> (int dev, int color)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__color.html#g85f53048c6eb057e1ebdaeed53e3e5d9">g2_ink</a> (int pd_dev, double red, double green, double blue)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__color.html#g30156659826923e02d120789151bd317">g2_reset_palette</a> (int dev)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__color.html#g26ec16f8e6acc9fb75d02b25e3168fc0">g2_clear_palette</a> (int dev)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__color.html#g198d8d8a36b027be24e2c46076ecabd2">g2_allocate_basic_colors</a> (int dev)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The color concept used in the g2 library is inspired by Sir Clive Sinclair solution implemented in the ZX Spectrum computer. With the <a class="el" href="group__color.html#g23fb2c58c675c566a16f8e9f738f102e">g2_pen()</a> function it is possible to choose a pen created by the <a class="el" href="group__color.html#g85f53048c6eb057e1ebdaeed53e3e5d9">g2_ink()</a> function. Note that g2_ink function is only defined for physical devices. The predefined colors (see g2_test demo program) have pens from 0 till 26 (inclusive).<p>
Some basic colors are:<ul>
<li>0 white</li><li>1 black</li><li>3 blue</li><li>7 green</li><li>19 red</li><li>25 yellow </li></ul>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g198d8d8a36b027be24e2c46076ecabd2"></a><!-- doxytag: member="g2_ui_control.c::g2_allocate_basic_colors" ref="g198d8d8a36b027be24e2c46076ecabd2" args="(int dev)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void g2_allocate_basic_colors </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname1" valign="top" nowrap> <em>dev</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Allocate basic colors<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>dev</em> </td><td>device </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="g26ec16f8e6acc9fb75d02b25e3168fc0"></a><!-- doxytag: member="g2_ui_control.c::g2_clear_palette" ref="g26ec16f8e6acc9fb75d02b25e3168fc0" args="(int dev)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void g2_clear_palette </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname1" valign="top" nowrap> <em>dev</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Remove all inks.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>dev</em> </td><td>device </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="g85f53048c6eb057e1ebdaeed53e3e5d9"></a><!-- doxytag: member="g2_ui_control.c::g2_ink" ref="g85f53048c6eb057e1ebdaeed53e3e5d9" args="(int pd_dev, double red, double green, double blue)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int g2_ink </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname" nowrap> <em>pd_dev</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>double </td>
<td class="mdname" nowrap> <em>red</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>double </td>
<td class="mdname" nowrap> <em>green</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>double </td>
<td class="mdname" nowrap> <em>blue</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Create an ink. To put ink into the pen use <a class="el" href="group__color.html#g23fb2c58c675c566a16f8e9f738f102e">g2_pen()</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>pd_dev</em> </td><td>physical device </td></tr>
<tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>red component (0-1) according to the RGB color model </td></tr>
<tr><td valign="top"></td><td valign="top"><em>green</em> </td><td>green component (0-1) according to the RGB color model </td></tr>
<tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>blue component (0-1) according to the RGB color model </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>new pen, see <a class="el" href="group__color.html#g23fb2c58c675c566a16f8e9f738f102e">g2_pen()</a> </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="g23fb2c58c675c566a16f8e9f738f102e"></a><!-- doxytag: member="g2_ui_control.c::g2_pen" ref="g23fb2c58c675c566a16f8e9f738f102e" args="(int dev, int color)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void g2_pen </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname" nowrap> <em>dev</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>color</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Set pen color for all following operations, see also <a class="el" href="group__color.html#g85f53048c6eb057e1ebdaeed53e3e5d9">g2_ink()</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>dev</em> </td><td>device </td></tr>
<tr><td valign="top"></td><td valign="top"><em>color</em> </td><td>pen (either one of default pens 0-26, or a pen returned by <a class="el" href="group__color.html#g85f53048c6eb057e1ebdaeed53e3e5d9">g2_ink()</a> ) </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="g30156659826923e02d120789151bd317"></a><!-- doxytag: member="g2_ui_control.c::g2_reset_palette" ref="g30156659826923e02d120789151bd317" args="(int dev)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void g2_reset_palette </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname1" valign="top" nowrap> <em>dev</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Clear collor palette (remove all inks) and reallocate basic colors.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>dev</em> </td><td>device </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="g8d697444755ba6547eda9732c6b541c8"></a><!-- doxytag: member="g2_ui_control.c::g2_set_background" ref="g8d697444755ba6547eda9732c6b541c8" args="(int dev, int color)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void g2_set_background </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname" nowrap> <em>dev</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>color</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Set the background color<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>dev</em> </td><td>device </td></tr>
<tr><td valign="top"></td><td valign="top"><em>color</em> </td><td>pen (either one of default pens 0-26, or a pen returned by <a class="el" href="group__color.html#g85f53048c6eb057e1ebdaeed53e3e5d9">g2_ink()</a> ) </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 17 21:27:48 2006 for g2 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
</body>
</html>
|