diff options
| author | Magnus Holmgren <magnushol@gmail.com> | 2007-11-11 21:31:38 +0000 |
|---|---|---|
| committer | Magnus Holmgren <magnushol@gmail.com> | 2007-11-11 21:31:38 +0000 |
| commit | 56b8e99c10517622f640aae30a8582b6947377ce (patch) | |
| tree | 73ffe1e810b891bb01d4c174c3c8cbeba4cfa612 | |
| parent | e71bc67d94599be70da6f79365e765ea02d6b698 (diff) | |
| download | rockbox-56b8e99c10517622f640aae30a8582b6947377ce.zip rockbox-56b8e99c10517622f640aae30a8582b6947377ce.tar.gz rockbox-56b8e99c10517622f640aae30a8582b6947377ce.tar.bz2 rockbox-56b8e99c10517622f640aae30a8582b6947377ce.tar.xz | |
When unpacking a 16-bit color value to 24 bits, repeat the high bits of each component rather than the low bits. This makes the RGB value displayed in the color picker (and in settings files) more accurate. E.g., when using the reported color in a background, it will no longer be dithered.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15589 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/export/lcd.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index eedfc65..2e481fc 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -190,9 +190,9 @@ static inline unsigned lcd_color_to_native(unsigned color) /* pack/unpack 24-bit RGB values */ #define _RGBPACK(r, g, b) _RGBPACK_LCD((r) >> 3, (g) >> 2, (b) >> 3) -#define _RGB_UNPACK_RED(x) ( (((x) >> 8) & 0xf8) | (((x) >> 11) & 0x07) ) -#define _RGB_UNPACK_GREEN(x) ( (((x) >> 3) & 0xfc) | (((x) >> 5) & 0x03) ) -#define _RGB_UNPACK_BLUE(x) ( (((x) << 3) & 0xf8) | (((x) ) & 0x07) ) +#define _RGB_UNPACK_RED(x) ( (((x) >> 8) & 0xf8) | (((x) >> 13) & 0x07) ) +#define _RGB_UNPACK_GREEN(x) ( (((x) >> 3) & 0xfc) | (((x) >> 9) & 0x03) ) +#define _RGB_UNPACK_BLUE(x) ( (((x) << 3) & 0xf8) | (((x) >> 2) & 0x07) ) #if (LCD_PIXELFORMAT == RGB565SWAPPED) /* RGB3553 */ |