/usr/share/doc/allegro4-doc/html/alleg012.html is in allegro4-doc 2:4.4.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><title>
Allegro Manual: Truecolor pixel formats
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" title="Default" type="text/css" href="allegro.css"></head><body bgcolor=white text=black link="#0000ee" alink="#ff0000" vlink="#551a8b">
<h1><a name="Truecolor pixel formats">Truecolor pixel formats</a></h1>
<ul>
<li><a href="#geta">geta</a> — Extract a color component from the current pixel format.
<li><a href="#geta32">geta32</a> — Extract the alpha component form a 32-bit pixel format color.
<li><a href="#geta_depth">geta_depth</a> — Extract a color component from a color in a specified pixel format.
<li><a href="#getb">getb</a> — Extract a color component from the current pixel format.
<li><a href="#getb15">getb15</a> — Extract a color component from the specified pixel format.
<li><a href="#getb16">getb16</a> — Extract a color component from the specified pixel format.
<li><a href="#getb24">getb24</a> — Extract a color component from the specified pixel format.
<li><a href="#getb32">getb32</a> — Extract a color component from the specified pixel format.
<li><a href="#getb8">getb8</a> — Extract a color component from the specified pixel format.
<li><a href="#getb_depth">getb_depth</a> — Extract a color component from a color in a specified pixel format.
<li><a href="#getg">getg</a> — Extract a color component from the current pixel format.
<li><a href="#getg15">getg15</a> — Extract a color component from the specified pixel format.
<li><a href="#getg16">getg16</a> — Extract a color component from the specified pixel format.
<li><a href="#getg24">getg24</a> — Extract a color component from the specified pixel format.
<li><a href="#getg32">getg32</a> — Extract a color component from the specified pixel format.
<li><a href="#getg8">getg8</a> — Extract a color component from the specified pixel format.
<li><a href="#getg_depth">getg_depth</a> — Extract a color component from a color in a specified pixel format.
<li><a href="#getr">getr</a> — Extract a color component from the current pixel format.
<li><a href="#getr15">getr15</a> — Extract a color component from the specified pixel format.
<li><a href="#getr16">getr16</a> — Extract a color component from the specified pixel format.
<li><a href="#getr24">getr24</a> — Extract a color component from the specified pixel format.
<li><a href="#getr32">getr32</a> — Extract a color component from the specified pixel format.
<li><a href="#getr8">getr8</a> — Extract a color component from the specified pixel format.
<li><a href="#getr_depth">getr_depth</a> — Extract a color component from a color in a specified pixel format.
<li><a href="#makeacol">makeacol</a> — Converts RGBA colors into display dependent pixel formats.
<li><a href="#makeacol32">makeacol32</a> — Converts an RGBA color into a 32-bit display pixel format.
<li><a href="#makeacol_depth">makeacol_depth</a> — Converts RGBA colors into display dependent pixel formats.
<li><a href="#makecol">makecol</a> — Converts an RGB value into the current pixel format.
<li><a href="#makecol15">makecol15</a> — Converts an RGB value into a display dependent pixel format.
<li><a href="#makecol15_dither">makecol15_dither</a> — Calculates a dithered 15 or 16-bit RGB value.
<li><a href="#makecol16">makecol16</a> — Converts an RGB value into a display dependent pixel format.
<li><a href="#makecol16_dither">makecol16_dither</a> — Calculates a dithered 15 or 16-bit RGB value.
<li><a href="#makecol24">makecol24</a> — Converts an RGB value into a display dependent pixel format.
<li><a href="#makecol32">makecol32</a> — Converts an RGB value into a display dependent pixel format.
<li><a href="#makecol8">makecol8</a> — Converts an RGB value into a display dependent pixel format.
<li><a href="#makecol_depth">makecol_depth</a> — Converts an RGB value into the specified pixel format.
<li><a href="#MASK_COLOR_15">MASK_COLOR_15</a> — Constant representing the mask value in sprites.
<li><a href="#MASK_COLOR_16">MASK_COLOR_16</a> — Constant representing the mask value in sprites.
<li><a href="#MASK_COLOR_24">MASK_COLOR_24</a> — Constant representing the mask value in sprites.
<li><a href="#MASK_COLOR_32">MASK_COLOR_32</a> — Constant representing the mask value in sprites.
<li><a href="#MASK_COLOR_8">MASK_COLOR_8</a> — Constant representing the mask value in sprites.
<li><a href="#palette_color">palette_color</a> — Maps palette indexes into the current pixel format colors.
</ul>
<p>
In a truecolor video mode the red, green, and blue components for each pixel
are packed directly into the color value, rather than using a palette lookup
table. In a 15-bit mode there are 5 bits for each color, in 16-bit modes
there are 5 bits each of red and blue and six bits of green, and both 24 and
32-bit modes use 8 bits for each color (the 32-bit pixels simply have an
extra padding byte to align the data nicely). The layout of these components
can vary depending on your hardware, but will generally either be RGB or
BGR. Since the layout is not known until you select the video mode you will
be using, you must call set_gfx_mode() before using any of the following
routines!
<p><br>
<div class="al-api"><b>int <a name="makecol8">makecol8</a>(int r, int g, int b);</b></div><br>
<div class="al-api-cont"><b>int <a name="makecol15">makecol15</a>(int r, int g, int b);</b></div><br>
<div class="al-api-cont"><b>int <a name="makecol16">makecol16</a>(int r, int g, int b);</b></div><br>
<div class="al-api-cont"><b>int <a name="makecol24">makecol24</a>(int r, int g, int b);</b></div><br>
<div class="al-api-cont"><b>int <a name="makecol32">makecol32</a>(int r, int g, int b);</b></div><br>
These functions convert colors from a hardware independent form (red,
green, and blue values ranging 0-255) into various display dependent
pixel formats. Converting to 15, 16, 24, or 32-bit formats only takes a
few shifts, so it is fairly efficient. Converting to an 8-bit color
involves searching the palette to find the closest match, which is quite
slow unless you have set up an RGB mapping table (see below). Example:
<blockquote class="code"><pre>
/* 16 bit color version of green. */
int green_color = <a href="#makecol16" class="autotype" title="Converts an RGB value into a display dependent pixel format.">makecol16</a>(0, 255, 0);</pre></blockquote>
<p><b>Return value:</b>
Returns the requested RGB triplet in the specified color depth.
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#makeacol32" title="Converts an RGBA color into a 32-bit display pixel format.">makeacol32</a>,
<a class="xref" href="#makecol" title="Converts an RGB value into the current pixel format.">makecol</a>,
<a class="xref" href="#makecol_depth" title="Converts an RGB value into the specified pixel format.">makecol_depth</a>,
<a class="xref" href="#makecol15_dither" title="Calculates a dithered 15 or 16-bit RGB value.">makecol15_dither</a>,
<a class="xref" href="alleg021.html#rgb_map" title="Look up table to speed up reducing RGB values to palette colors.">rgb_map</a>,
<a class="xref" href="alleg021.html#bestfit_color" title="Finds a palette color fitting the requested RGB values.">bestfit_color</a>,
<a class="xref" href="alleg008.html#set_color_depth" title="Sets the global pixel color depth.">set_color_depth</a>.</blockquote>
<blockquote class="eref"><em><b>Examples using this:</b></em>
<a class="eref" href="alleg045.html#exrgbhsv" title="RGB <-> HSV color space conversions.">exrgbhsv</a>.</blockquote>
<div class="al-api"><b>int <a name="makeacol32">makeacol32</a>(int r, int g, int b, int a);</b></div><br>
Converts an RGBA color into a 32-bit display pixel format, which includes
an alpha (transparency) value. There are no versions of this routine for
other color depths, because only the 32-bit format has enough room to
store a proper alpha channel. You should only use RGBA format colors as
the input to draw_trans_sprite() or draw_trans_rle_sprite() after calling
set_alpha_blender(), rather than drawing them directly to the screen.
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#makeacol" title="Converts RGBA colors into display dependent pixel formats.">makeacol</a>,
<a class="xref" href="alleg020.html#set_alpha_blender" title="Enables a special alpha-channel blending mode.">set_alpha_blender</a>,
<a class="xref" href="alleg020.html#set_write_alpha_blender" title="Enables the special alpha-channel editing mode.">set_write_alpha_blender</a>.</blockquote>
<div class="al-api"><b>int <a name="makecol">makecol</a>(int r, int g, int b);</b></div><br>
Converts colors from a hardware independent format (red, green, and blue
values ranging 0-255) to the pixel format required by the current video
mode, calling the preceding 8, 15, 16, 24, or 32-bit makecol functions as
appropriate. Example:
<blockquote class="code"><pre>
/* Regardless of color depth, this will look green. */
int green_color = <a href="#makecol" class="autotype" title="Converts an RGB value into the current pixel format.">makecol</a>(0, 255, 0);</pre></blockquote>
<p><b>Return value:</b>
Returns the requested RGB triplet in the current color depth.
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#makeacol" title="Converts RGBA colors into display dependent pixel formats.">makeacol</a>,
<a class="xref" href="#makecol8" title="Converts an RGB value into a display dependent pixel format.">makecol8</a>,
<a class="xref" href="#makecol_depth" title="Converts an RGB value into the specified pixel format.">makecol_depth</a>,
<a class="xref" href="#makecol15_dither" title="Calculates a dithered 15 or 16-bit RGB value.">makecol15_dither</a>,
<a class="xref" href="alleg021.html#rgb_map" title="Look up table to speed up reducing RGB values to palette colors.">rgb_map</a>,
<a class="xref" href="alleg008.html#set_color_depth" title="Sets the global pixel color depth.">set_color_depth</a>.</blockquote>
<blockquote class="eref"><em><b>Examples using this:</b></em>
<a class="eref" href="alleg045.html#Available Allegro examples" title="">Available Allegro examples</a>.</blockquote>
<div class="al-api"><b>int <a name="makecol_depth">makecol_depth</a>(int color_depth, int r, int g, int b);</b></div><br>
Converts colors from a hardware independent format (red, green, and blue
values ranging 0-255) to the pixel format required by the specified color
depth. Example:
<blockquote class="code"><pre>
/* Compose the green color for 15 bit color depth. */
int green_15bit = <a href="#makecol_depth" class="autotype" title="Converts an RGB value into the specified pixel format.">makecol_depth</a>(15, 0, 255, 0);</pre></blockquote>
<p><b>Return value:</b>
Returns the requested RGB triplet in the specified color depth.
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#makeacol" title="Converts RGBA colors into display dependent pixel formats.">makeacol</a>,
<a class="xref" href="#makecol" title="Converts an RGB value into the current pixel format.">makecol</a>,
<a class="xref" href="#makecol8" title="Converts an RGB value into a display dependent pixel format.">makecol8</a>,
<a class="xref" href="#makecol15_dither" title="Calculates a dithered 15 or 16-bit RGB value.">makecol15_dither</a>,
<a class="xref" href="alleg021.html#rgb_map" title="Look up table to speed up reducing RGB values to palette colors.">rgb_map</a>,
<a class="xref" href="alleg008.html#set_color_depth" title="Sets the global pixel color depth.">set_color_depth</a>.</blockquote>
<div class="al-api"><b>int <a name="makeacol">makeacol</a>(int r, int g, int b, int a);</b></div><br>
<div class="al-api-cont"><b>int <a name="makeacol_depth">makeacol_depth</a>(int color_depth, int r, int g, int b, int a);</b></div><br>
Convert RGBA colors into display dependent pixel formats. In anything
less than a 32-bit mode, these are the same as calling makecol() or
makecol_depth(), but by using these routines it is possible to create
32-bit color values that contain a true 8 bit alpha channel along with
the red, green, and blue components. You should only use RGBA format
colors as the input to draw_trans_sprite() or draw_trans_rle_sprite()
after calling set_alpha_blender(), rather than drawing them directly to
the screen.
<p><b>Return value:</b>
Returns the requested RGBA quadruplet.
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#makecol" title="Converts an RGB value into the current pixel format.">makecol</a>,
<a class="xref" href="#makecol_depth" title="Converts an RGB value into the specified pixel format.">makecol_depth</a>,
<a class="xref" href="alleg020.html#set_alpha_blender" title="Enables a special alpha-channel blending mode.">set_alpha_blender</a>,
<a class="xref" href="alleg020.html#set_write_alpha_blender" title="Enables the special alpha-channel editing mode.">set_write_alpha_blender</a>.</blockquote>
<blockquote class="eref"><em><b>Examples using this:</b></em>
<a class="eref" href="alleg045.html#exrotscl" title="Demonstrates rotate_scaled_sprite functions.">exrotscl</a>.</blockquote>
<div class="al-api"><b>int <a name="makecol15_dither">makecol15_dither</a>(int r, int g, int b, int x, int y);</b></div><br>
<div class="al-api-cont"><b>int <a name="makecol16_dither">makecol16_dither</a>(int r, int g, int b, int x, int y);</b></div><br>
Given both a color value and a pixel coordinate, calculate a dithered 15
or 16-bit RGB value. This can produce better results when reducing images
from truecolor to hicolor. In addition to calling these functions
directly, hicolor dithering can be automatically enabled when loading
graphics by calling the set_color_conversion() function, for example
set_color_conversion(COLORCONV_REDUCE_TRUE_TO_HI | COLORCONV_DITHER).
<p>
Example:
<blockquote class="code"><pre>
int pixel1, pixel2;
/* The following two color values MAY be different. */
pixel1 = <a href="#makecol16_dither" class="autotype" title="Calculates a dithered 15 or 16-bit RGB value.">makecol16_dither</a>(255, 192, 64, 0, 0);
pixel2 = <a href="#makecol16_dither" class="autotype" title="Calculates a dithered 15 or 16-bit RGB value.">makecol16_dither</a>(255, 192, 64, 1, 0);</pre></blockquote>
<p><b>Return value:</b>
Returns the RGB value dithered for the specified coordinate.
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#makecol" title="Converts an RGB value into the current pixel format.">makecol</a>,
<a class="xref" href="#makecol8" title="Converts an RGB value into a display dependent pixel format.">makecol8</a>,
<a class="xref" href="alleg010.html#set_color_conversion" title="Tells Allegro how to convert images during loading time.">set_color_conversion</a>.</blockquote>
<div class="al-api"><b>int <a name="getr8">getr8</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getg8">getg8</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getb8">getb8</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getr15">getr15</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getg15">getg15</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getb15">getb15</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getr16">getr16</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getg16">getg16</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getb16">getb16</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getr24">getr24</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getg24">getg24</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getb24">getb24</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getr32">getr32</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getg32">getg32</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getb32">getb32</a>(int c);</b></div><br>
Given a color in a display dependent format, these functions extract one
of the red, green, or blue components (ranging 0-255). Example:
<blockquote class="code"><pre>
int r, g, b, color_value;
color_value = <a href="alleg013.html#_getpixel15" class="autotype" title="Faster specific version of getpixel().">_getpixel15</a>(<a href="alleg009.html#screen" class="autotype" title="Global pointer to the screen hardware video memory.">screen</a>, 100, 100);
r = <a href="#getr15" class="autotype" title="Extract a color component from the specified pixel format.">getr15</a>(color_value);
g = <a href="#getg15" class="autotype" title="Extract a color component from the specified pixel format.">getg15</a>(color_value);
b = <a href="#getb15" class="autotype" title="Extract a color component from the specified pixel format.">getb15</a>(color_value);</pre></blockquote>
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#geta32" title="Extract the alpha component form a 32-bit pixel format color.">geta32</a>,
<a class="xref" href="#getr" title="Extract a color component from the current pixel format.">getr</a>,
<a class="xref" href="#getr_depth" title="Extract a color component from a color in a specified pixel format.">getr_depth</a>,
<a class="xref" href="#makecol" title="Converts an RGB value into the current pixel format.">makecol</a>,
<a class="xref" href="alleg008.html#set_color_depth" title="Sets the global pixel color depth.">set_color_depth</a>.</blockquote>
<div class="al-api"><b>int <a name="geta32">geta32</a>(int c);</b></div><br>
Given a color in a 32-bit pixel format, this function extracts the alpha
component (ranging 0-255).
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#getr8" title="Extract a color component from the specified pixel format.">getr8</a>.</blockquote>
<div class="al-api"><b>int <a name="getr">getr</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getg">getg</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getb">getb</a>(int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="geta">geta</a>(int c);</b></div><br>
Given a color in the format being used by the current video mode, these
functions extract one of the red, green, blue, or alpha components
(ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get
functions as appropriate. The alpha part is only meaningful for 32-bit
pixels. Example:
<blockquote class="code"><pre>
int r, g, b, color_value;
color_value = <a href="alleg013.html#getpixel" class="autotype" title="Reads a pixel from a bitmap.">getpixel</a>(<a href="alleg009.html#screen" class="autotype" title="Global pointer to the screen hardware video memory.">screen</a>, 100, 100);
r = <a href="#getr" class="autotype" title="Extract a color component from the current pixel format.">getr</a>(color_value);
g = <a href="#getg" class="autotype" title="Extract a color component from the current pixel format.">getg</a>(color_value);
b = <a href="#getb" class="autotype" title="Extract a color component from the current pixel format.">getb</a>(color_value);</pre></blockquote>
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#getr8" title="Extract a color component from the specified pixel format.">getr8</a>,
<a class="xref" href="#getr_depth" title="Extract a color component from a color in a specified pixel format.">getr_depth</a>,
<a class="xref" href="#makecol" title="Converts an RGB value into the current pixel format.">makecol</a>,
<a class="xref" href="alleg008.html#set_color_depth" title="Sets the global pixel color depth.">set_color_depth</a>.</blockquote>
<blockquote class="eref"><em><b>Examples using this:</b></em>
<a class="eref" href="alleg045.html#exalpha" title="Creating and using 32 bit RGBA sprites.">exalpha</a>.</blockquote>
<div class="al-api"><b>int <a name="getr_depth">getr_depth</a>(int color_depth, int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getg_depth">getg_depth</a>(int color_depth, int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="getb_depth">getb_depth</a>(int color_depth, int c);</b></div><br>
<div class="al-api-cont"><b>int <a name="geta_depth">geta_depth</a>(int color_depth, int c);</b></div><br>
Given a color in the format being used by the specified color depth,
these functions extract one of the red, green, blue, or alpha components
(ranging 0-255). The alpha part is only meaningful for 32-bit pixels.
Example:
<blockquote class="code"><pre>
int r, g, b, color_value, bpp;
bpp = <a href="alleg009.html#bitmap_color_depth" class="autotype" title="Returns the color depth of the specified bitmap.">bitmap_color_depth</a>(bitmap);
color_value = <a href="alleg013.html#getpixel" class="autotype" title="Reads a pixel from a bitmap.">getpixel</a>(bitmap, 100, 100);
r = <a href="#getr_depth" class="autotype" title="Extract a color component from a color in a specified pixel format.">getr_depth</a>(bpp, color_value);
g = <a href="#getg_depth" class="autotype" title="Extract a color component from a color in a specified pixel format.">getg_depth</a>(bpp, color_value);
b = <a href="#getb_depth" class="autotype" title="Extract a color component from a color in a specified pixel format.">getb_depth</a>(bpp, color_value);</pre></blockquote>
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#getr" title="Extract a color component from the current pixel format.">getr</a>,
<a class="xref" href="#getr8" title="Extract a color component from the specified pixel format.">getr8</a>,
<a class="xref" href="#geta32" title="Extract the alpha component form a 32-bit pixel format color.">geta32</a>,
<a class="xref" href="#makecol" title="Converts an RGB value into the current pixel format.">makecol</a>,
<a class="xref" href="alleg008.html#set_color_depth" title="Sets the global pixel color depth.">set_color_depth</a>.</blockquote>
<blockquote class="eref"><em><b>Examples using this:</b></em>
<a class="eref" href="alleg045.html#exlights" title="One way to do colored lighting effects in a hicolor video mode.">exlights</a>.</blockquote>
<div class="al-api"><b>extern int <a name="palette_color">palette_color</a>[256];</b></div><br>
Table mapping palette index colors (0-255) into whatever pixel format is
being used by the current display mode. In a 256-color mode this just
maps onto the array index. In truecolor modes it looks up the specified
entry in the current palette, and converts that RGB value into the
appropriate packed pixel format. Example:
<blockquote class="code"><pre>
<a href="alleg008.html#set_color_depth" class="autotype" title="Sets the global pixel color depth.">set_color_depth</a>(32);
...
<a href="alleg011.html#set_palette" class="autotype" title="Sets the entire palette of 256 colors.">set_palette</a>(<a href="alleg011.html#desktop_palette" class="autotype" title="The palette used by the Atari ST low resolution desktop.">desktop_palette</a>);
/* Put a pixel with the color 2 (green) of the palette */
<a href="alleg013.html#putpixel" class="autotype" title="Writes a pixel into a bitmap.">putpixel</a>(<a href="alleg009.html#screen" class="autotype" title="Global pointer to the screen hardware video memory.">screen</a>, 100, 100, <a href="#palette_color" class="autotype" title="Maps palette indexes into the current pixel format colors.">palette_color</a>[2]);</pre></blockquote>
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="alleg011.html#set_palette" title="Sets the entire palette of 256 colors.">set_palette</a>,
<a class="xref" href="#makecol" title="Converts an RGB value into the current pixel format.">makecol</a>,
<a class="xref" href="alleg008.html#set_color_depth" title="Sets the global pixel color depth.">set_color_depth</a>.</blockquote>
<blockquote class="eref"><em><b>Examples using this:</b></em>
<a class="eref" href="alleg045.html#Available Allegro examples" title="">Available Allegro examples</a>.</blockquote>
<div class="al-api"><b>#define <a name="MASK_COLOR_8">MASK_COLOR_8</a> 0</b></div><br>
<div class="al-api-cont"><b>#define <a name="MASK_COLOR_15">MASK_COLOR_15</a> (5.5.5 pink)</b></div><br>
<div class="al-api-cont"><b>#define <a name="MASK_COLOR_16">MASK_COLOR_16</a> (5.6.5 pink)</b></div><br>
<div class="al-api-cont"><b>#define <a name="MASK_COLOR_24">MASK_COLOR_24</a> (8.8.8 pink)</b></div><br>
<div class="al-api-cont"><b>#define <a name="MASK_COLOR_32">MASK_COLOR_32</a> (8.8.8 pink)</b></div><br>
Constants representing the colors used to mask transparent sprite pixels
for each color depth. In 256-color resolutions this is zero, and in
truecolor modes it is bright pink (maximum red and blue, zero green).
<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="alleg009.html#bitmap_mask_color" title="Returns the mask color of the specified bitmap.">bitmap_mask_color</a>,
<a class="xref" href="#makecol" title="Converts an RGB value into the current pixel format.">makecol</a>,
<a class="xref" href="alleg014.html#draw_sprite" title="Draws a copy of the sprite onto the destination bitmap.">draw_sprite</a>,
<a class="xref" href="alleg014.html#masked_blit" title="Copies a rectangle skipping pixels with the mask color.">masked_blit</a>.</blockquote>
<hr><div class="al-back-to-contents"><a href="allegro.html">Back to contents</a></div>
</body>
</html>
|