Lines Matching refs:color

65 // types defining what is needed to store a color value
169 bitmap data (not including any padding) given a color space and a
171 \param colorSpace The color space.
174 0, if the color space is not supported.
237 data (including any padding) given a color space and a row width.
238 \param colorSpace The color space.
241 0, if the color space is not supported.
253 /*! \brief Returns the brightness of an RGB 24 color.
257 \return The brightness for the supplied RGB color as a value between 0
272 This functions defines an metric on the RGB color space. The distance
275 \param red1 Red component of the first color.
276 \param green1 Green component of the first color.
277 \param blue1 Blue component of the first color.
278 \param red2 Red component of the second color.
279 \param green2 Green component of the second color.
280 \param blue2 Blue component of the second color.
384 color map.
385 \param colorMap The completely initialized color map.
414 // alloc color map
420 // init color map
423 // init color list
426 for (int32 color = 0; color < 32768; color++) {
428 uint8 red = (color & 0x7c00) >> 7;
429 uint8 green = (color & 0x3e0) >> 2;
430 uint8 blue = (color & 0x1f) << 3;
434 // find closest color
446 fOwnColorMap->index_map[color] = closestIndex;
455 /*! \brief Initializes the converter to the supplied color map.
456 \param colorMap The completely initialized color map.
486 /*! \brief Returns the palette color index closest to a given RGB 15 color.
490 \param rgb The RGB 15 color value (R[14:10]G[9:5]B[4:0]).
491 \return The palette color index for the supplied color.
500 /*! \brief Returns the palette color index closest to a given RGB 15 color.
504 \param red Red component of the color (R[4:0]).
505 \param green Green component of the color (G[4:0]).
506 \param blue Blue component of the color (B[4:0]).
507 \return The palette color index for the supplied color.
517 /*! \brief Returns the palette color index closest to a given RGB 16 color.
521 \param rgb The RGB 16 color value (R[15:11]G[10:5]B[4:0]).
522 \return The palette color index for the supplied color.
531 /*! \brief Returns the palette color index closest to a given RGB 16 color.
535 \param red Red component of the color (R[4:0]).
536 \param green Green component of the color (G[5:0]).
537 \param blue Blue component of the color (B[4:0]).
538 \return The palette color index for the supplied color.
548 /*! \brief Returns the palette color index closest to a given RGB 32 color.
552 \param rgb The RGB 32 color value (R[31:24]G[23:16]B[15:8]).
553 \return The palette color index for the supplied color.
563 /*! \brief Returns the palette color index closest to a given RGB 24 color.
567 \param red Red component of the color.
568 \param green Green component of the color.
569 \param blue Blue component of the color.
570 \return The palette color index for the supplied color.
580 /*! \brief Returns the palette color index closest to a given Gray 8 color.
584 \param gray The Gray 8 color value.
585 \return The palette color index for the supplied color.
594 /*! \brief Returns the RGB color for a given palette color index.
598 \param index The palette color index.
599 \return The color for the supplied palette color index.
608 /*! \brief Returns the RGB 15 color for a given palette color index.
612 \param index The palette color index.
613 \return The color for the supplied palette color index
619 const rgb_color &color = fColorMap->color_list[index];
620 return ((color.red & 0xf8) << 7) | ((color.green & 0xf8) << 2)
621 | (color.blue >> 3);
625 /*! \brief Returns the RGB 16 color for a given palette color index.
629 \param index The palette color index.
630 \return The color for the supplied palette color index
636 const rgb_color &color = fColorMap->color_list[index];
637 return ((color.red & 0xf8) << 8) | ((color.green & 0xfc) << 3)
638 | (color.blue >> 3);
642 /*! \brief Returns the RGB 24 color for a given palette color index.
646 \param index The palette color index.
647 \return The color for the supplied palette color index
653 const rgb_color &color = fColorMap->color_list[index];
654 return (color.blue << 24) | (color.red << 8) | (color.green << 16)
655 | color.alpha;
659 /*! \brief Returns the RGB 24 color for a given palette color index.
663 \param index The palette color index.
675 const rgb_color &color = fColorMap->color_list[index];
676 red = color.red;
677 green = color.green;
678 blue = color.blue;
679 alpha = color.alpha;
683 /*! \brief Returns the Gray 8 color for a given palette color index.
687 \param index The palette color index.
688 \return The color for the supplied palette color index.
693 const rgb_color &color = fColorMap->color_list[index];
694 return brightness_for(color.red, color.green, color.blue);
702 /*! \brief Returns a PaletteConverter using the system color palette.
745 inline void Read(rgb_color_value &color)
748 color.red = pixel.red;
749 color.green = pixel.green;
750 color.blue = pixel.blue;
751 color.alpha = 255;
757 rgb_color_value color;
758 Read(color);
759 gray = brightness_for(color.red, color.green, color.blue);
771 inline void Read(rgb_color_value &color)
776 color.red = pixel.rg & 0xf8;
777 color.green = ((pixel.rg & 0x07) << 5) & ((pixel.gb & 0xe0) >> 3);
778 color.blue = (pixel.gb & 0x1f) << 3;
779 color.red |= color.red >> 5;
780 color.green |= color.green >> 6;
781 color.blue |= color.blue >> 5;
782 color.alpha = 255;
788 rgb_color_value color;
789 Read(color);
790 gray = brightness_for(color.red, color.green, color.blue);
802 inline void Read(rgb_color_value &color)
807 color.red = (pixel.rg & 0x7c) << 1;
808 color.green = ((pixel.rg & 0x03) << 6) & ((pixel.gb & 0xe0) >> 2);
809 color.blue = (pixel.gb & 0x1f) << 3;
810 color.red |= color.red >> 5;
811 color.green |= color.green >> 5;
812 color.blue |= color.blue >> 5;
813 color.alpha = 255;
819 rgb_color_value color;
820 Read(color);
821 gray = brightness_for(color.red, color.green, color.blue);
832 inline void Read(rgb_color_value &color)
834 converter.RGB24ColorForIndex(*BaseReader<uint8>::pixels, color.red, color.green,
835 color.blue, color.alpha);
854 inline void Read(rgb_color_value &color)
856 color.red = color.green = color.blue = *BaseReader<uint8>::pixels;
857 color.alpha = 255;
890 inline void Read(rgb_color_value &color)
893 color.red = color.green = color.blue = 255;
895 color.red = color.green = color.blue = 0;
896 color.alpha = 255;
945 inline void Write(const rgb_color_value &color)
948 pixel.red = color.red;
949 pixel.green = color.green;
950 pixel.blue = color.blue;
951 pixel.alpha = color.alpha;
974 inline void Write(const rgb_color_value &color)
977 pixel.red = color.red;
978 pixel.green = color.green;
979 pixel.blue = color.blue;
1001 inline void Write(const rgb_color_value &color)
1006 pixel.rg = (color.red & 0xf8) | (color.green >> 5);
1007 pixel.gb = ((color.green & 0x1c) << 3) | (color.blue >> 3);
1028 inline void Write(const rgb_color_value &color)
1033 pixel.rg = ((color.red & 0xf8) >> 1) | (color.green >> 6);
1034 pixel.gb = ((color.green & 0x38) << 2) | (color.blue >> 3);
1054 inline void Write(const rgb_color_value &color)
1056 *pixels = converter.IndexForRGB24(color.red, color.green, color.blue);
1075 inline void Write(const rgb_color_value &color)
1077 *pixels = brightness_for(color.red, color.green, color.blue);
1107 inline void Write(const rgb_color_value &color)
1109 Write(brightness_for(color.red, color.green, color.blue));
1121 \param color_value_t The color value type used to transport a pixel from
1168 color_value_t color;
1169 reader.Read(color);
1170 writer.Write(color);
1177 color_value_t color;
1178 reader.Read(color);
1179 writer.Write(color);
1193 it (converted) to another one, which uses color space \c B_GRAY1.
1196 \param color_value_t The color value type used to transport a pixel from
1242 color_value_t color;
1243 reader.Read(color);
1244 writer.Write(color);
1251 color_value_t color;
1252 reader.Read(color);
1253 writer.Write(color);
1430 \param colorSpace The bitmap's color space.
1456 \param colorSpace The bitmap's color space.
1706 /*! \brief Returns the bitmap's color space.
1707 \return The bitmap's color space.
1734 - other color spaces: The source buffer is supposed to contain data
1735 according to the specified color space being rowwise padded to int32.
1737 The currently supported source/target color spaces are
1768 // If in color space is B_CMAP8, but the bitmap's is another one,
1784 is supposed to contain data of that color space. \a bpr specifies how
1788 The currently supported source/target color spaces are
1828 // TODO: Retrieve color map from BScreen, when available:
1950 Its data are converted to the color space of this bitmap.
1952 The currently supported source/target color spaces are
1959 or the conversion from or to one of the color spaces is not supported.
2034 \param colorSpace The bitmap's color space.
2167 // dependent on color space.