summaryrefslogtreecommitdiff
path: root/firmware/export/lcd.h
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2007-11-11 21:31:38 +0000
committerMagnus Holmgren <magnushol@gmail.com>2007-11-11 21:31:38 +0000
commit56b8e99c10517622f640aae30a8582b6947377ce (patch)
tree73ffe1e810b891bb01d4c174c3c8cbeba4cfa612 /firmware/export/lcd.h
parente71bc67d94599be70da6f79365e765ea02d6b698 (diff)
downloadrockbox-56b8e99c10517622f640aae30a8582b6947377ce.tar.gz
rockbox-56b8e99c10517622f640aae30a8582b6947377ce.zip
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
Diffstat (limited to 'firmware/export/lcd.h')
-rw-r--r--firmware/export/lcd.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index eedfc651c7..2e481fc938 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -190,9 +190,9 @@ static inline unsigned lcd_color_to_native(unsigned color)
190 190
191/* pack/unpack 24-bit RGB values */ 191/* pack/unpack 24-bit RGB values */
192#define _RGBPACK(r, g, b) _RGBPACK_LCD((r) >> 3, (g) >> 2, (b) >> 3) 192#define _RGBPACK(r, g, b) _RGBPACK_LCD((r) >> 3, (g) >> 2, (b) >> 3)
193#define _RGB_UNPACK_RED(x) ( (((x) >> 8) & 0xf8) | (((x) >> 11) & 0x07) ) 193#define _RGB_UNPACK_RED(x) ( (((x) >> 8) & 0xf8) | (((x) >> 13) & 0x07) )
194#define _RGB_UNPACK_GREEN(x) ( (((x) >> 3) & 0xfc) | (((x) >> 5) & 0x03) ) 194#define _RGB_UNPACK_GREEN(x) ( (((x) >> 3) & 0xfc) | (((x) >> 9) & 0x03) )
195#define _RGB_UNPACK_BLUE(x) ( (((x) << 3) & 0xf8) | (((x) ) & 0x07) ) 195#define _RGB_UNPACK_BLUE(x) ( (((x) << 3) & 0xf8) | (((x) >> 2) & 0x07) )
196 196
197#if (LCD_PIXELFORMAT == RGB565SWAPPED) 197#if (LCD_PIXELFORMAT == RGB565SWAPPED)
198/* RGB3553 */ 198/* RGB3553 */