Lines Matching defs:color

11  *	and a palette <-> true color conversion class.
32 /*! \brief Returns the brightness of an RGB 24 color.
36 \return The brightness for the supplied RGB color as a value between 0
52 This functions defines an metric on the RGB color space. The distance
55 \param red1 Red component of the first color.
56 \param green1 Green component of the first color.
57 \param blue1 Blue component of the first color.
58 \param red2 Red component of the second color.
59 \param green2 Green component of the second color.
60 \param blue2 Blue component of the second color.
106 color map.
107 \param colorMap The completely initialized color map.
136 // alloc color map
142 // init color map
145 // init color list
150 for (int32 color = 0; color < 32768; color++) {
152 uint8 red = (color & 0x7c00) >> 7;
153 uint8 green = (color & 0x3e0) >> 2;
154 uint8 blue = (color & 0x1f) << 3;
158 // find closest color
170 fOwnColorMap->index_map[color] = closestIndex;
179 /*! \brief Initializes the converter to the supplied color map.
180 \param colorMap The completely initialized color map.
210 /*! \brief Returns the palette color index closest to a given RGB 15 color.
214 \param rgb The RGB 15 color value (R[14:10]G[9:5]B[4:0]).
215 \return The palette color index for the supplied color.
225 /*! \brief Returns the palette color index closest to a given RGB 15 color.
229 \param red Red component of the color (R[4:0]).
230 \param green Green component of the color (G[4:0]).
231 \param blue Blue component of the color (B[4:0]).
232 \return The palette color index for the supplied color.
243 /*! \brief Returns the palette color index closest to a given RGB 16 color.
247 \param rgb The RGB 16 color value (R[15:11]G[10:5]B[4:0]).
248 \return The palette color index for the supplied color.
258 /*! \brief Returns the palette color index closest to a given RGB 16 color.
262 \param red Red component of the color (R[4:0]).
263 \param green Green component of the color (G[5:0]).
264 \param blue Blue component of the color (B[4:0]).
265 \return The palette color index for the supplied color.
276 /*! \brief Returns the palette color index closest to a given RGB 32 color.
280 \param rgb The RGB 32 color value (R[31:24]G[23:16]B[15:8]).
281 \return The palette color index for the supplied color.
293 /*! \brief Returns the palette color index closest to a given RGB 24 color.
297 \param red Red component of the color.
298 \param green Green component of the color.
299 \param blue Blue component of the color.
300 \return The palette color index for the supplied color.
312 /*! \brief Returns the palette color index closest to a given RGBA 32 color.
316 \param rgb The RGB 32A color value (R[31:24]G[23:16]B[15:8]A[7:0]).
317 \return The palette color index for the supplied color.
329 /*! \brief Returns the palette color index closest to a given Gray 8 color.
333 \param gray The Gray 8 color value.
334 \return The palette color index for the supplied color.
344 /*! \brief Returns the RGB color for a given palette color index.
348 \param index The palette color index.
349 \return The color for the supplied palette color index.
359 /*! \brief Returns the RGB 15 color for a given palette color index.
363 \param index The palette color index.
364 \return The color for the supplied palette color index
371 const rgb_color &color = fColorMap->color_list[index];
372 return ((color.red & 0xf8) << 7)
373 | ((color.green & 0xf8) << 2)
374 | (color.blue >> 3);
378 /*! \brief Returns the RGB 16 color for a given palette color index.
382 \param index The palette color index.
383 \return The color for the supplied palette color index
390 const rgb_color &color = fColorMap->color_list[index];
391 return ((color.red & 0xf8) << 8)
392 | ((color.green & 0xfc) << 3)
393 | (color.blue >> 3);
397 /*! \brief Returns the RGBA 32 color for a given palette color index.
401 \param index The palette color index.
402 \return The color for the supplied palette color index
409 const rgb_color &color = fColorMap->color_list[index];
410 return (color.red << 16) | (color.green << 8) | color.blue
411 | (color.alpha << 24);
415 /*! \brief Returns the RGBA 32 color for a given palette color index.
419 \param index The palette color index.
434 const rgb_color &color = fColorMap->color_list[index];
435 red = color.red;
436 green = color.green;
437 blue = color.blue;
438 alpha = color.alpha;
442 /*! \brief Returns the Gray 8 color for a given palette color index.
446 \param index The palette color index.
447 \return The color for the supplied palette color index.
453 const rgb_color &color = fColorMap->color_list[index];
454 return brightness_for(color.red, color.green, color.blue);
462 /*! \brief Initialize the global instance of PaletteConverter using the system color palette.
562 // (low/view color). So we map them to 00 and 0xFF, respectively.