summaryrefslogtreecommitdiff
path: root/firmware/export/lcd-remote.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-10-14 01:32:58 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-10-14 01:32:58 +0000
commit6aa12c11f741a4544d780d11fc583a25a5aef171 (patch)
tree0fe4b08bd13817657660c5339247e8ea203f2508 /firmware/export/lcd-remote.h
parent1f3360f0216dbf54bcd50547a759fa6e514c6e76 (diff)
downloadrockbox-6aa12c11f741a4544d780d11fc583a25a5aef171.tar.gz
rockbox-6aa12c11f741a4544d780d11fc583a25a5aef171.zip
Added a small interface to screens to translate colors into remote gray levels on the x5. Splash screens paint properly with light gray. Should be adapted to a more general approach in the future. A few trailing whitespace trimmings got into a couple files but that is fine.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11218 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/lcd-remote.h')
-rw-r--r--firmware/export/lcd-remote.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index 5f1551e395..13d78ac428 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -60,9 +60,18 @@ typedef void lcd_remote_pixelfunc_type(int x, int y);
60typedef void lcd_remote_blockfunc_type(fb_remote_data *address, unsigned mask, 60typedef void lcd_remote_blockfunc_type(fb_remote_data *address, unsigned mask,
61 unsigned bits); 61 unsigned bits);
62 62
63#if LCD_REMOTE_DEPTH > 1 /* greyscale */ 63#if LCD_REMOTE_DEPTH > 1 /* greyscale - 8 bit max */
64#ifdef HAVE_LCD_COLOR
65extern unsigned lcd_remote_color_to_native(unsigned color);
66#endif
67
64#define LCD_REMOTE_MAX_LEVEL ((1 << LCD_REMOTE_DEPTH) - 1) 68#define LCD_REMOTE_MAX_LEVEL ((1 << LCD_REMOTE_DEPTH) - 1)
65#define LCD_REMOTE_BRIGHTNESS(y) (((y) * LCD_REMOTE_MAX_LEVEL + 127) / 255) 69/**
70 * On 2 bit for example (y >> (8-DEPTH)) = (y >> 6) = y/64 gives:
71 * |000-063|064-127|128-191|192-255|
72 * | 0 | 1 | 2 | 3 |
73 */
74#define LCD_REMOTE_BRIGHTNESS(y) ((y) >> (8-LCD_REMOTE_DEPTH))
66 75
67#define LCD_REMOTE_BLACK LCD_REMOTE_BRIGHTNESS(0) 76#define LCD_REMOTE_BLACK LCD_REMOTE_BRIGHTNESS(0)
68#define LCD_REMOTE_DARKGRAY LCD_REMOTE_BRIGHTNESS(85) 77#define LCD_REMOTE_DARKGRAY LCD_REMOTE_BRIGHTNESS(85)
@@ -70,7 +79,6 @@ typedef void lcd_remote_blockfunc_type(fb_remote_data *address, unsigned mask,
70#define LCD_REMOTE_WHITE LCD_REMOTE_BRIGHTNESS(255) 79#define LCD_REMOTE_WHITE LCD_REMOTE_BRIGHTNESS(255)
71#define LCD_REMOTE_DEFAULT_FG LCD_REMOTE_BLACK 80#define LCD_REMOTE_DEFAULT_FG LCD_REMOTE_BLACK
72#define LCD_REMOTE_DEFAULT_BG LCD_REMOTE_WHITE 81#define LCD_REMOTE_DEFAULT_BG LCD_REMOTE_WHITE
73
74#endif 82#endif
75 83
76/* Memory copy of display bitmap */ 84/* Memory copy of display bitmap */
@@ -91,7 +99,7 @@ extern void lcd_remote_clear_display(void);
91extern void lcd_remote_puts(int x, int y, const unsigned char *str); 99extern void lcd_remote_puts(int x, int y, const unsigned char *str);
92extern void lcd_remote_puts_style(int x, int y, const unsigned char *str, 100extern void lcd_remote_puts_style(int x, int y, const unsigned char *str,
93 int style); 101 int style);
94extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, 102extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str,
95 int offset); 103 int offset);
96extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, 104extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str,
97 int style, int offset); 105 int style, int offset);