Lines Matching refs:color

299 // Parse fractional color of form [0.##, 0.##, 0.##]
305 ColorFract color;
315 if (!in || ((chStart != '<') && (chStart != '['))) { return color; }
319 if (!in) { return color; }
320 if ((c1 < 0.0) || (c1 > 1.0)) { return color; }
322 if (!in || (ch != ',')) { return color; }
326 if (!in) { return color; }
327 if ((c2 < 0.0) || (c2 > 1.0)) { return color; }
329 if (!in || (ch != ',')) { return color; }
333 if (!in) { return color; }
334 if ((c3 < 0.0) || (c3 > 1.0)) { return color; }
338 if (!in) { return color; }
340 || ((chStart == '[') && (ch != ']'))) { return color; }
345 || (c3 < 0.0) || (c3 > 1.0)) { return color; }
542 // single pixel of the given color and alpha values.
543 uint32_t hwcTestColor2Pixel(uint32_t format, ColorFract color, float alpha)
579 pixel = htonl((uint32_t) round((((1 << attrib->c1Size) - 1) * color.c1()))
582 pixel |= htonl((uint32_t) round((((1 << attrib->c2Size) - 1) * color.c2()))
585 pixel |= htonl((uint32_t) round((((1 << attrib->c3Size) - 1) * color.c3()))
601 // Sets the pixel at the given x and y coordinates to the color and alpha
654 // Fill a given graphic buffer with a uniform color and alpha
655 void hwcTestFillColor(GraphicBuffer *gBuf, ColorFract color, float alpha)
661 pixel = hwcTestColor2Pixel(gBuf->getPixelFormat(), color, alpha);
685 // side color given by startColor and the right side color given by
688 // graphic buffer. When different, a color conversion is done when possible
689 // to the graphic format of the graphic buffer. A color of black is
710 ColorFract color(startColor.c1() + (endColor.c1() - startColor.c1())
721 hwcTestColorConvert(colorFormat, gBuf->getPixelFormat(), color);
723 pixel = hwcTestColor2Pixel(gBuf->getPixelFormat(), color, 1.0);
742 * When possible, converts color specified as a full range value in
743 * the fromFormat, into an equivalent full range color in the toFormat.
744 * When conversion is impossible (e.g. out of gamut color) a color
746 * color is given as a fractional color in the parameter named color.
747 * The produced color is written over the same parameter used to
748 * provide the input color.
750 * Each graphic format has 3 color components and each of these
763 * 1. Produce black if the input color is out of gamut.
765 * 2. Convert the in gamut color into the fraction of the fromFromat
770 * if an equivalent color does not exists.
791 * | | +-- fromFormat to toFormat color conversion
796 ColorFract& color)
847 // valid color range
849 + ((float) (fromAttrib->c1Max - fromAttrib->c1Min) * color.c1());
851 + ((float) (fromAttrib->c2Max - fromAttrib->c2Min) * color.c2());
853 + ((float) (fromAttrib->c3Max - fromAttrib->c3Min) * color.c3());
861 color = ColorFract(0.0, 0.0, 0.0);
862 hwcTestColorConvert(HAL_PIXEL_FORMAT_RGBA_8888, toFormat, color);
868 color = ColorFract((c1Val - fromAttrib->c1Low)
878 float r = color.c1(), g = color.c2(), b = color.c3();
883 // Produce black if color is outside the YUV gamut
891 color = ColorFract(y, u, v);
915 float y = color.c1(), u = color.c2(), v = color.c3();
920 // Produce black if color is outside the RGB gamut
927 color = ColorFract(r, g, b);
933 + (float) (toAttrib->c1High - toAttrib->c1Low) * color.c1());
935 + (float) (toAttrib->c2High - toAttrib->c2Low) * color.c2());
937 + (float) (toAttrib->c3High - toAttrib->c3Low) * color.c3());
938 color = ColorFract((float) (c1Val - toAttrib->c1Min)