diff options
author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-05-04 15:46:41 +0000 |
---|---|---|
committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-05-04 15:46:41 +0000 |
commit | 20f76d61ae58bd47b647d79e40beebbbe747e480 (patch) | |
tree | d37569a127b02fdd051c6a3da77c70ac2d72e8ab /apps/recorder | |
parent | dfb24d6ceee703361b8120d689d8d77cfc15830d (diff) | |
download | rockbox-20f76d61ae58bd47b647d79e40beebbbe747e480.tar.gz rockbox-20f76d61ae58bd47b647d79e40beebbbe747e480.zip |
Make JPEG and BMP scaler optional with HAVE_JPEG and HAVE_BMP_SCALING, both defined for all targets that have HAVE_ALBUMART. Disable JPEG in PictureFlow and pluginlib album art search with 32KiB plugin buffer until PictureFlow
gets overlay support.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20851 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r-- | apps/recorder/albumart.c | 22 | ||||
-rw-r--r-- | apps/recorder/bmp.c | 86 | ||||
-rw-r--r-- | apps/recorder/resize.c | 19 | ||||
-rw-r--r-- | apps/recorder/resize.h | 6 |
4 files changed, 80 insertions, 53 deletions
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c index 3adedc8159..da85f99bbc 100644 --- a/apps/recorder/albumart.c +++ b/apps/recorder/albumart.c | |||
@@ -91,7 +91,7 @@ static void fix_path_part(char* path, int offset, int count) | |||
91 | } | 91 | } |
92 | } | 92 | } |
93 | 93 | ||
94 | #if LCD_DEPTH > 1 | 94 | #if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) |
95 | const char * extensions[] = { "jpeg", "jpg", "bmp" }; | 95 | const char * extensions[] = { "jpeg", "jpg", "bmp" }; |
96 | int extension_lens[] = { 4, 3, 3 }; | 96 | int extension_lens[] = { 4, 3, 3 }; |
97 | /* Try checking for several file extensions, return true if a file is found and | 97 | /* Try checking for several file extensions, return true if a file is found and |
@@ -134,7 +134,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, | |||
134 | const char *artist; | 134 | const char *artist; |
135 | int dirlen; | 135 | int dirlen; |
136 | int albumlen; | 136 | int albumlen; |
137 | #if LCD_DEPTH > 1 | 137 | #if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) |
138 | int pathlen; | 138 | int pathlen; |
139 | #endif | 139 | #endif |
140 | 140 | ||
@@ -153,7 +153,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, | |||
153 | /* the first file we look for is one specific to the track playing */ | 153 | /* the first file we look for is one specific to the track playing */ |
154 | strip_extension(path, sizeof(path) - strlen(size_string) - 4, trackname); | 154 | strip_extension(path, sizeof(path) - strlen(size_string) - 4, trackname); |
155 | strcat(path, size_string); | 155 | strcat(path, size_string); |
156 | #if LCD_DEPTH > 1 | 156 | #if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) |
157 | strcat(path, "."); | 157 | strcat(path, "."); |
158 | pathlen = strlen(path); | 158 | pathlen = strlen(path); |
159 | found = try_exts(path, pathlen); | 159 | found = try_exts(path, pathlen); |
@@ -165,7 +165,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, | |||
165 | { | 165 | { |
166 | /* if it doesn't exist, | 166 | /* if it doesn't exist, |
167 | * we look for a file specific to the track's album name */ | 167 | * we look for a file specific to the track's album name */ |
168 | #if LCD_DEPTH > 1 | 168 | #if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) |
169 | pathlen = snprintf(path, sizeof(path), | 169 | pathlen = snprintf(path, sizeof(path), |
170 | "%s%s%s.", dir, id3->album, size_string); | 170 | "%s%s%s.", dir, id3->album, size_string); |
171 | fix_path_part(path, dirlen, albumlen); | 171 | fix_path_part(path, dirlen, albumlen); |
@@ -181,7 +181,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, | |||
181 | if (!found) | 181 | if (!found) |
182 | { | 182 | { |
183 | /* if it still doesn't exist, we look for a generic file */ | 183 | /* if it still doesn't exist, we look for a generic file */ |
184 | #if LCD_DEPTH > 1 | 184 | #if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) |
185 | pathlen = snprintf(path, sizeof(path), | 185 | pathlen = snprintf(path, sizeof(path), |
186 | "%scover%s.", dir, size_string); | 186 | "%scover%s.", dir, size_string); |
187 | found = try_exts(path, pathlen); | 187 | found = try_exts(path, pathlen); |
@@ -192,7 +192,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, | |||
192 | #endif | 192 | #endif |
193 | } | 193 | } |
194 | 194 | ||
195 | #if LCD_DEPTH > 1 | 195 | #if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) |
196 | if (!found) | 196 | if (!found) |
197 | { | 197 | { |
198 | snprintf (path, sizeof(path), "%sfolder.jpg", dir); | 198 | snprintf (path, sizeof(path), "%sfolder.jpg", dir); |
@@ -205,7 +205,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, | |||
205 | if (!found && artist && id3->album) | 205 | if (!found && artist && id3->album) |
206 | { | 206 | { |
207 | /* look in the albumart subdir of .rockbox */ | 207 | /* look in the albumart subdir of .rockbox */ |
208 | #if LCD_DEPTH > 1 | 208 | #if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) |
209 | pathlen = snprintf(path, sizeof(path), | 209 | pathlen = snprintf(path, sizeof(path), |
210 | ROCKBOX_DIR "/albumart/%s-%s%s.", | 210 | ROCKBOX_DIR "/albumart/%s-%s%s.", |
211 | artist, | 211 | artist, |
@@ -241,7 +241,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, | |||
241 | { | 241 | { |
242 | /* we look in the parent directory | 242 | /* we look in the parent directory |
243 | * for a file specific to the track's album name */ | 243 | * for a file specific to the track's album name */ |
244 | #if LCD_DEPTH > 1 | 244 | #if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) |
245 | pathlen = snprintf(path, sizeof(path), | 245 | pathlen = snprintf(path, sizeof(path), |
246 | "%s%s%s.", dir, id3->album, size_string); | 246 | "%s%s%s.", dir, id3->album, size_string); |
247 | fix_path_part(path, dirlen, albumlen); | 247 | fix_path_part(path, dirlen, albumlen); |
@@ -258,7 +258,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, | |||
258 | { | 258 | { |
259 | /* if it still doesn't exist, we look in the parent directory | 259 | /* if it still doesn't exist, we look in the parent directory |
260 | * for a generic file */ | 260 | * for a generic file */ |
261 | #if LCD_DEPTH > 1 | 261 | #if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) |
262 | pathlen = snprintf(path, sizeof(path), | 262 | pathlen = snprintf(path, sizeof(path), |
263 | "%scover%s.", dir, size_string); | 263 | "%scover%s.", dir, size_string); |
264 | found = try_exts(path, pathlen); | 264 | found = try_exts(path, pathlen); |
@@ -278,7 +278,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, | |||
278 | return true; | 278 | return true; |
279 | } | 279 | } |
280 | 280 | ||
281 | #ifdef HAVE_ALBUMART | 281 | #ifndef PLUGIN |
282 | /* Look for albumart bitmap in the same dir as the track and in its parent dir. | 282 | /* Look for albumart bitmap in the same dir as the track and in its parent dir. |
283 | * Stores the found filename in the buf parameter. | 283 | * Stores the found filename in the buf parameter. |
284 | * Returns true if a bitmap was found, false otherwise */ | 284 | * Returns true if a bitmap was found, false otherwise */ |
@@ -386,4 +386,4 @@ void get_albumart_size(struct bitmap *bmp) | |||
386 | bmp->width = data->albumart_max_width; | 386 | bmp->width = data->albumart_max_width; |
387 | bmp->height = data->albumart_max_height; | 387 | bmp->height = data->albumart_max_height; |
388 | } | 388 | } |
389 | #endif /* HAVE_ALBUMART */ | 389 | #endif /* PLUGIN */ |
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index 3fb8a4d6c1..403c34d951 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c | |||
@@ -184,8 +184,8 @@ struct bmp_args { | |||
184 | short depth; | 184 | short depth; |
185 | unsigned char buf[BM_MAX_WIDTH * 4]; | 185 | unsigned char buf[BM_MAX_WIDTH * 4]; |
186 | struct uint8_rgb *palette; | 186 | struct uint8_rgb *palette; |
187 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 187 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
188 | defined(PLUGIN) | 188 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
189 | int cur_row; | 189 | int cur_row; |
190 | int cur_col; | 190 | int cur_col; |
191 | struct img_part part; | 191 | struct img_part part; |
@@ -198,8 +198,8 @@ static unsigned int read_part_line(struct bmp_args *ba) | |||
198 | const int read_width = ba->read_width; | 198 | const int read_width = ba->read_width; |
199 | const int width = ba->width; | 199 | const int width = ba->width; |
200 | const int depth = ba->depth; | 200 | const int depth = ba->depth; |
201 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 201 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
202 | defined(PLUGIN) | 202 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
203 | int cur_row = ba->cur_row; | 203 | int cur_row = ba->cur_row; |
204 | int cur_col = ba->cur_col; | 204 | int cur_col = ba->cur_col; |
205 | #endif | 205 | #endif |
@@ -211,8 +211,8 @@ static unsigned int read_part_line(struct bmp_args *ba) | |||
211 | int ret; | 211 | int ret; |
212 | int i, cols, len; | 212 | int i, cols, len; |
213 | 213 | ||
214 | #if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) || \ | 214 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
215 | defined(PLUGIN) | 215 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
216 | cols = MIN(width - cur_col,(int)BM_MAX_WIDTH); | 216 | cols = MIN(width - cur_col,(int)BM_MAX_WIDTH); |
217 | BDEBUGF("reading %d cols (width: %d, max: %d)\n",cols,width,BM_MAX_WIDTH); | 217 | BDEBUGF("reading %d cols (width: %d, max: %d)\n",cols,width,BM_MAX_WIDTH); |
218 | len = (cols * (depth == 15 ? 16 : depth) + 7) >> 3; | 218 | len = (cols * (depth == 15 ? 16 : depth) + 7) >> 3; |
@@ -227,8 +227,8 @@ static unsigned int read_part_line(struct bmp_args *ba) | |||
227 | { | 227 | { |
228 | DEBUGF("read_part_line: error reading image, read returned %d " | 228 | DEBUGF("read_part_line: error reading image, read returned %d " |
229 | "expected %d\n", ret, len); | 229 | "expected %d\n", ret, len); |
230 | #if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) || \ | 230 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
231 | defined(PLUGIN) | 231 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
232 | BDEBUGF("cur_row: %d cur_col: %d cols: %d len: %d\n", cur_row, cur_col, | 232 | BDEBUGF("cur_row: %d cur_col: %d cols: %d len: %d\n", cur_row, cur_col, |
233 | cols, len); | 233 | cols, len); |
234 | #endif | 234 | #endif |
@@ -290,17 +290,17 @@ static unsigned int read_part_line(struct bmp_args *ba) | |||
290 | } | 290 | } |
291 | } | 291 | } |
292 | 292 | ||
293 | #if (!defined(HAVE_LCD_COLOR) && \ | 293 | #if !defined(HAVE_LCD_COLOR) && \ |
294 | (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1))) || \ | 294 | ((LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) || \ |
295 | defined(PLUGIN) | 295 | defined(PLUGIN)) |
296 | ibuf = ba->buf; | 296 | ibuf = ba->buf; |
297 | buf = (struct uint8_rgb*)ba->buf; | 297 | buf = (struct uint8_rgb*)ba->buf; |
298 | while (ibuf < ba->buf + cols) | 298 | while (ibuf < ba->buf + cols) |
299 | *ibuf++ = brightness(*buf++); | 299 | *ibuf++ = brightness(*buf++); |
300 | #endif | 300 | #endif |
301 | 301 | ||
302 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 302 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
303 | defined(PLUGIN) | 303 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
304 | cur_col += cols; | 304 | cur_col += cols; |
305 | if (cur_col == width) | 305 | if (cur_col == width) |
306 | { | 306 | { |
@@ -311,8 +311,8 @@ static unsigned int read_part_line(struct bmp_args *ba) | |||
311 | BDEBUGF("seeking %d bytes to next line\n",pad); | 311 | BDEBUGF("seeking %d bytes to next line\n",pad); |
312 | lseek(fd, pad, SEEK_CUR); | 312 | lseek(fd, pad, SEEK_CUR); |
313 | } | 313 | } |
314 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 314 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
315 | defined(PLUGIN) | 315 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
316 | cur_col = 0; | 316 | cur_col = 0; |
317 | BDEBUGF("read_part_line: completed row %d\n", cur_row); | 317 | BDEBUGF("read_part_line: completed row %d\n", cur_row); |
318 | cur_row += 1; | 318 | cur_row += 1; |
@@ -324,8 +324,8 @@ static unsigned int read_part_line(struct bmp_args *ba) | |||
324 | return cols; | 324 | return cols; |
325 | } | 325 | } |
326 | 326 | ||
327 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 327 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
328 | defined(PLUGIN) | 328 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
329 | static struct img_part *store_part_bmp(void *args) | 329 | static struct img_part *store_part_bmp(void *args) |
330 | { | 330 | { |
331 | struct bmp_args *ba = (struct bmp_args *)args; | 331 | struct bmp_args *ba = (struct bmp_args *)args; |
@@ -375,10 +375,13 @@ int read_bmp_fd(int fd, | |||
375 | struct uint8_rgb palette[256]; | 375 | struct uint8_rgb palette[256]; |
376 | struct rowset rset; | 376 | struct rowset rset; |
377 | struct dim src_dim; | 377 | struct dim src_dim; |
378 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)) \ | 378 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) || \ |
379 | || defined(PLUGIN) | 379 | defined(PLUGIN) |
380 | unsigned int resize = IMG_NORESIZE; | ||
381 | bool dither = false; | 380 | bool dither = false; |
381 | #endif | ||
382 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ | ||
383 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) | ||
384 | unsigned int resize = IMG_NORESIZE; | ||
382 | bool transparent = false; | 385 | bool transparent = false; |
383 | 386 | ||
384 | #ifdef HAVE_REMOTE_LCD | 387 | #ifdef HAVE_REMOTE_LCD |
@@ -398,14 +401,16 @@ int read_bmp_fd(int fd, | |||
398 | if (format & FORMAT_TRANSPARENT) { | 401 | if (format & FORMAT_TRANSPARENT) { |
399 | transparent = true; | 402 | transparent = true; |
400 | } | 403 | } |
401 | if (format & FORMAT_DITHER) { | ||
402 | dither = true; | ||
403 | } | ||
404 | #else | 404 | #else |
405 | 405 | ||
406 | (void)format; | 406 | (void)format; |
407 | #endif /*(LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)*/ | 407 | #endif /*(LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)*/ |
408 | 408 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) || \ | |
409 | defined(PLUGIN) | ||
410 | if (format & FORMAT_DITHER) { | ||
411 | dither = true; | ||
412 | } | ||
413 | #endif | ||
409 | /* read fileheader */ | 414 | /* read fileheader */ |
410 | ret = read(fd, &bmph, sizeof(struct bmp_header)); | 415 | ret = read(fd, &bmph, sizeof(struct bmp_header)); |
411 | if (ret < 0) { | 416 | if (ret < 0) { |
@@ -444,8 +449,11 @@ int read_bmp_fd(int fd, | |||
444 | bm->format = format & 1; | 449 | bm->format = format & 1; |
445 | if ((format & 1) == FORMAT_MONO) | 450 | if ((format & 1) == FORMAT_MONO) |
446 | { | 451 | { |
452 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ | ||
453 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) | ||
447 | resize &= ~IMG_RESIZE; | 454 | resize &= ~IMG_RESIZE; |
448 | resize |= IMG_NORESIZE; | 455 | resize |= IMG_NORESIZE; |
456 | #endif | ||
449 | #ifdef HAVE_REMOTE_LCD | 457 | #ifdef HAVE_REMOTE_LCD |
450 | remote = 0; | 458 | remote = 0; |
451 | #endif | 459 | #endif |
@@ -455,8 +463,8 @@ int read_bmp_fd(int fd, | |||
455 | return -6; | 463 | return -6; |
456 | #endif /*(LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)*/ | 464 | #endif /*(LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)*/ |
457 | 465 | ||
458 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 466 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
459 | defined(PLUGIN) | 467 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
460 | if (resize & IMG_RESIZE) { | 468 | if (resize & IMG_RESIZE) { |
461 | if(format & FORMAT_KEEP_ASPECT) { | 469 | if(format & FORMAT_KEEP_ASPECT) { |
462 | /* keep aspect ratio.. */ | 470 | /* keep aspect ratio.. */ |
@@ -471,19 +479,19 @@ int read_bmp_fd(int fd, | |||
471 | } | 479 | } |
472 | } | 480 | } |
473 | 481 | ||
474 | format &= 1; | ||
475 | |||
476 | if (!(resize & IMG_RESIZE)) { | 482 | if (!(resize & IMG_RESIZE)) { |
477 | #endif | 483 | #endif |
478 | /* returning image size */ | 484 | /* returning image size */ |
479 | bm->width = src_dim.width; | 485 | bm->width = src_dim.width; |
480 | bm->height = src_dim.height; | 486 | bm->height = src_dim.height; |
481 | 487 | ||
482 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 488 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
483 | defined(PLUGIN) | 489 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
484 | } | 490 | } |
485 | #endif | 491 | #endif |
486 | 492 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) | |
493 | format &= 1; | ||
494 | #endif | ||
487 | if (rset.rowstep > 0) { /* Top-down BMP file */ | 495 | if (rset.rowstep > 0) { /* Top-down BMP file */ |
488 | rset.rowstart = 0; | 496 | rset.rowstart = 0; |
489 | rset.rowstop = bm->height; | 497 | rset.rowstop = bm->height; |
@@ -581,15 +589,15 @@ int read_bmp_fd(int fd, | |||
581 | struct bmp_args ba = { | 589 | struct bmp_args ba = { |
582 | .fd = fd, .padded_width = padded_width, .read_width = read_width, | 590 | .fd = fd, .padded_width = padded_width, .read_width = read_width, |
583 | .width = src_dim.width, .depth = depth, .palette = palette, | 591 | .width = src_dim.width, .depth = depth, .palette = palette, |
584 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 592 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
585 | defined(PLUGIN) | 593 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
586 | .cur_row = 0, .cur_col = 0, .part = {0,0} | 594 | .cur_row = 0, .cur_col = 0, .part = {0,0} |
587 | #endif | 595 | #endif |
588 | }; | 596 | }; |
589 | 597 | ||
590 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 598 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ |
591 | defined(PLUGIN) | 599 | defined(HAVE_BMP_SCALING) || defined(PLUGIN) |
592 | #if LCD_DEPTH > 1 | 600 | #if LCD_DEPTH > 1 && defined(HAVE_BMP_SCALING) |
593 | if (resize || cformat) | 601 | if (resize || cformat) |
594 | #endif | 602 | #endif |
595 | { | 603 | { |
@@ -600,12 +608,12 @@ int read_bmp_fd(int fd, | |||
600 | else | 608 | else |
601 | return 0; | 609 | return 0; |
602 | } | 610 | } |
603 | #ifndef PLUGIN | ||
604 | int fb_width = BM_WIDTH(bm->width,bm->format,remote); | ||
605 | #endif | ||
606 | #endif /* LCD_DEPTH */ | 611 | #endif /* LCD_DEPTH */ |
607 | 612 | ||
608 | #ifndef PLUGIN | 613 | #ifndef PLUGIN |
614 | #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) | ||
615 | int fb_width = BM_WIDTH(bm->width,bm->format,remote); | ||
616 | #endif | ||
609 | int col, row; | 617 | int col, row; |
610 | 618 | ||
611 | /* loop to read rows and put them to buffer */ | 619 | /* loop to read rows and put them to buffer */ |
diff --git a/apps/recorder/resize.c b/apps/recorder/resize.c index 79be59804a..7000c448e6 100644 --- a/apps/recorder/resize.c +++ b/apps/recorder/resize.c | |||
@@ -516,8 +516,9 @@ static inline bool scale_v_linear(struct rowset *rset, | |||
516 | } | 516 | } |
517 | #endif /* HAVE_UPSCALER */ | 517 | #endif /* HAVE_UPSCALER */ |
518 | 518 | ||
519 | #ifndef PLUGIN | 519 | #if !defined(PLUGIN) || LCD_DEPTH > 1 |
520 | static void output_row_native(uint32_t row, void * row_in, struct scaler_context *ctx) | 520 | void output_row_native(uint32_t row, void * row_in, |
521 | struct scaler_context *ctx) | ||
521 | { | 522 | { |
522 | int col; | 523 | int col; |
523 | int fb_width = BM_WIDTH(ctx->bm->width,FORMAT_NATIVE,0); | 524 | int fb_width = BM_WIDTH(ctx->bm->width,FORMAT_NATIVE,0); |
@@ -606,6 +607,18 @@ static void output_row_native(uint32_t row, void * row_in, struct scaler_context | |||
606 | } | 607 | } |
607 | #endif | 608 | #endif |
608 | 609 | ||
610 | #if defined(PLUGIN) && LCD_DEPTH > 1 | ||
611 | unsigned int get_size_native(struct bitmap *bm) | ||
612 | { | ||
613 | return BM_SIZE(bm->width,bm->height,FORMAT_NATIVE,FALSE); | ||
614 | } | ||
615 | |||
616 | const struct custom_format format_native = { | ||
617 | .output_row = output_row_native, | ||
618 | .get_size = get_size_native | ||
619 | }; | ||
620 | #endif | ||
621 | |||
609 | int resize_on_load(struct bitmap *bm, bool dither, struct dim *src, | 622 | int resize_on_load(struct bitmap *bm, bool dither, struct dim *src, |
610 | struct rowset *rset, unsigned char *buf, unsigned int len, | 623 | struct rowset *rset, unsigned char *buf, unsigned int len, |
611 | const struct custom_format *format, | 624 | const struct custom_format *format, |
@@ -669,7 +682,7 @@ int resize_on_load(struct bitmap *bm, bool dither, struct dim *src, | |||
669 | ctx.bm = bm; | 682 | ctx.bm = bm; |
670 | ctx.src = src; | 683 | ctx.src = src; |
671 | ctx.dither = dither; | 684 | ctx.dither = dither; |
672 | #ifndef PLUGIN | 685 | #if !defined(PLUGIN) |
673 | ctx.output_row = output_row_native; | 686 | ctx.output_row = output_row_native; |
674 | if (format) | 687 | if (format) |
675 | #endif | 688 | #endif |
diff --git a/apps/recorder/resize.h b/apps/recorder/resize.h index dc93585a08..de9e8a9ab0 100644 --- a/apps/recorder/resize.h +++ b/apps/recorder/resize.h | |||
@@ -149,6 +149,12 @@ struct custom_format { | |||
149 | }; | 149 | }; |
150 | 150 | ||
151 | struct rowset; | 151 | struct rowset; |
152 | |||
153 | void output_row_native(uint32_t row, void * row_in, | ||
154 | struct scaler_context *ctx); | ||
155 | |||
156 | extern const struct custom_format format_native; | ||
157 | |||
152 | int recalc_dimension(struct dim *dst, struct dim *src); | 158 | int recalc_dimension(struct dim *dst, struct dim *src); |
153 | 159 | ||
154 | int resize_on_load(struct bitmap *bm, bool dither, | 160 | int resize_on_load(struct bitmap *bm, bool dither, |