diff options
author | Thomas Martitz <kugel@rockbox.org> | 2014-06-18 07:15:00 +0200 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-06-21 00:15:53 +0200 |
commit | a1842c04f9cb73210d4cacde61a9e4b115050765 (patch) | |
tree | a37af61ef9285b763a42cd33797e2f3d634fbf9f /apps/plugins/imageviewer | |
parent | 0250be1d6799db7b5ddc99cb33f31bf9cff01ed2 (diff) | |
download | rockbox-a1842c04f9cb73210d4cacde61a9e4b115050765.tar.gz rockbox-a1842c04f9cb73210d4cacde61a9e4b115050765.zip |
lcd-24bit: Introduce a 24-bit mid-level LCD driver
With LCD driver all calculation will be performed on RGB888 and the hardware/OS
can display from our 24bit framebuffer.
It is not yet as performance optimized as the existing drivers but should be
good enough.The vast number of small changes is due to the fact that
fb_data can be a struct type now, while most of the code expected a scalar type.
lcd-as-memframe ASM code does not work with 24bit currently so the with 24bit
it enforces the generic C code.
All plugins are ported over. Except for rockpaint. It uses so much memory that
it wouldnt fit into the 512k plugin buffer anymore (patches welcome).
Change-Id: Ibb1964545028ce0d8ff9833ccc3ab66be3ee0754
Diffstat (limited to 'apps/plugins/imageviewer')
-rw-r--r-- | apps/plugins/imageviewer/jpeg/yuv2rgb.c | 8 | ||||
-rw-r--r-- | apps/plugins/imageviewer/ppm/ppm_decoder.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/apps/plugins/imageviewer/jpeg/yuv2rgb.c b/apps/plugins/imageviewer/jpeg/yuv2rgb.c index 2395f232b2..764dc71a47 100644 --- a/apps/plugins/imageviewer/jpeg/yuv2rgb.c +++ b/apps/plugins/imageviewer/jpeg/yuv2rgb.c | |||
@@ -106,7 +106,7 @@ static fb_data pixel_to_lcd_colour(void) | |||
106 | b = component_to_lcd(p->b, LCD_BLUE_BITS, NODITHER_DELTA); | 106 | b = component_to_lcd(p->b, LCD_BLUE_BITS, NODITHER_DELTA); |
107 | b = clamp_component_bits(b, LCD_BLUE_BITS); | 107 | b = clamp_component_bits(b, LCD_BLUE_BITS); |
108 | 108 | ||
109 | return LCD_RGBPACK_LCD(r, g, b); | 109 | return FB_RGBPACK_LCD(r, g, b); |
110 | } | 110 | } |
111 | 111 | ||
112 | /** write a monochrome pixel to the colour LCD **/ | 112 | /** write a monochrome pixel to the colour LCD **/ |
@@ -119,7 +119,7 @@ static fb_data pixel_to_lcd_gray(void) | |||
119 | b = component_to_lcd(g, LCD_BLUE_BITS, NODITHER_DELTA); | 119 | b = component_to_lcd(g, LCD_BLUE_BITS, NODITHER_DELTA); |
120 | g = component_to_lcd(g, LCD_GREEN_BITS, NODITHER_DELTA); | 120 | g = component_to_lcd(g, LCD_GREEN_BITS, NODITHER_DELTA); |
121 | 121 | ||
122 | return LCD_RGBPACK_LCD(r, g, b); | 122 | return FB_RGBPACK_LCD(r, g, b); |
123 | } | 123 | } |
124 | 124 | ||
125 | /** | 125 | /** |
@@ -163,7 +163,7 @@ static fb_data pixel_odither_to_lcd(void) | |||
163 | 163 | ||
164 | p->col += p->inc; | 164 | p->col += p->inc; |
165 | 165 | ||
166 | return LCD_RGBPACK_LCD(r, g, b); | 166 | return FB_RGBPACK_LCD(r, g, b); |
167 | } | 167 | } |
168 | 168 | ||
169 | /** | 169 | /** |
@@ -217,7 +217,7 @@ static fb_data pixel_fsdither_to_lcd(void) | |||
217 | distribute_error(&p->ce[BLU], &p->e[BLU], bc, epos, inc); | 217 | distribute_error(&p->ce[BLU], &p->e[BLU], bc, epos, inc); |
218 | 218 | ||
219 | /* Pack and return pixel */ | 219 | /* Pack and return pixel */ |
220 | return LCD_RGBPACK_LCD(r, g, b); | 220 | return FB_RGBPACK_LCD(r, g, b); |
221 | } | 221 | } |
222 | 222 | ||
223 | /* Functions for each output mode, colour then grayscale. */ | 223 | /* Functions for each output mode, colour then grayscale. */ |
diff --git a/apps/plugins/imageviewer/ppm/ppm_decoder.c b/apps/plugins/imageviewer/ppm/ppm_decoder.c index be459293fe..4a86be1a3a 100644 --- a/apps/plugins/imageviewer/ppm/ppm_decoder.c +++ b/apps/plugins/imageviewer/ppm/ppm_decoder.c | |||
@@ -197,7 +197,7 @@ static int read_ppm_row(int fd, struct ppm_info *ppm, int row) | |||
197 | { | 197 | { |
198 | return PLUGIN_ERROR; | 198 | return PLUGIN_ERROR; |
199 | } | 199 | } |
200 | *dst = LCD_RGBPACK( | 200 | *dst = FB_RGBPACK( |
201 | (255 * r)/ppm->maxval, | 201 | (255 * r)/ppm->maxval, |
202 | (255 * g)/ppm->maxval, | 202 | (255 * g)/ppm->maxval, |
203 | (255 * b)/ppm->maxval); | 203 | (255 * b)/ppm->maxval); |
@@ -216,7 +216,7 @@ static int read_ppm_row(int fd, struct ppm_info *ppm, int row) | |||
216 | { | 216 | { |
217 | return PLUGIN_ERROR; | 217 | return PLUGIN_ERROR; |
218 | } | 218 | } |
219 | *dst = LCD_RGBPACK( | 219 | *dst = FB_RGBPACK( |
220 | (255 * r)/ppm->maxval, | 220 | (255 * r)/ppm->maxval, |
221 | (255 * g)/ppm->maxval, | 221 | (255 * g)/ppm->maxval, |
222 | (255 * b)/ppm->maxval); | 222 | (255 * b)/ppm->maxval); |