/* * Each pixel-format conversion helper takes a raw pixel in a * specific input format and returns a raw pixel in a specific * output format. All pixels are in little-endian byte order. * * Function names are * * drm_pixel_<input>_to_<output>_<algorithm>() * * where <input> and <output> refer to pixel formats. The * <algorithm> is optional and hints to the method used for the * conversion. Helpers with no algorithm given apply pixel-bit * shifting. * * The argument type is u32. We expect this to be wide enough to * hold all conversion input from 32-bit RGB to any output format. * The Linux kernel should avoid format conversion for anything * but XRGB8888 input data. Converting from other format can still * be acceptable in some cases. * * The return type is u32. It is wide enough to hold all conversion * output from XRGB8888. For output formats wider than 32 bit, a * return type of u64 would be acceptable.
*/
/* * Conversions from XRGB8888
*/
staticinline u32 drm_pixel_xrgb8888_to_r8_bt601(u32 pix)
{
u32 r = (pix & 0x00ff0000) >> 16;
u32 g = (pix & 0x0000ff00) >> 8;
u32 b = pix & 0x000000ff;
/* ITU-R BT.601: Y = 0.299 R + 0.587 G + 0.114 B */ return (77 * r + 150 * g + 29 * b) / 256;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.