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/plugins | |
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/plugins')
-rw-r--r-- | apps/plugins/lib/SOURCES | 12 | ||||
-rw-r--r-- | apps/plugins/lib/feature_wrappers.h | 17 | ||||
-rw-r--r-- | apps/plugins/lib/pluginlib_bmp.c | 12 | ||||
-rw-r--r-- | apps/plugins/lib/read_image.c | 4 | ||||
-rw-r--r-- | apps/plugins/pictureflow.c | 5 |
5 files changed, 29 insertions, 21 deletions
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index dfdd569843..dc4d41c35c 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES | |||
@@ -5,15 +5,13 @@ fixedpoint.c | |||
5 | playback_control.c | 5 | playback_control.c |
6 | rgb_hsv.c | 6 | rgb_hsv.c |
7 | buflib.c | 7 | buflib.c |
8 | #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) | 8 | #if !defined(HAVE_BMP_SCALING) || !defined(HAVE_JPEG) |
9 | /* | ||
10 | The scaler is not provided in core on mono targets, but is built in | ||
11 | pluginlib for use with greylib overlay output | ||
12 | */ | ||
13 | #if LCD_DEPTH == 1 | ||
14 | pluginlib_resize.c | 9 | pluginlib_resize.c |
10 | #endif | ||
11 | #ifndef HAVE_JPEG | ||
15 | pluginlib_jpeg_load.c | 12 | pluginlib_jpeg_load.c |
16 | #endif | 13 | #endif |
14 | #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) | ||
17 | grey_core.c | 15 | grey_core.c |
18 | grey_draw.c | 16 | grey_draw.c |
19 | grey_parm.c | 17 | grey_parm.c |
@@ -45,7 +43,7 @@ read_image.c | |||
45 | #ifdef HAVE_LCD_COLOR | 43 | #ifdef HAVE_LCD_COLOR |
46 | bmp_smooth_scale.c | 44 | bmp_smooth_scale.c |
47 | #endif | 45 | #endif |
48 | #ifndef HAVE_ALBUMART | 46 | #if !defined(HAVE_ALBUMART) || !defined(HAVE_JPEG) |
49 | pluginlib_albumart.c | 47 | pluginlib_albumart.c |
50 | #endif | 48 | #endif |
51 | #endif | 49 | #endif |
diff --git a/apps/plugins/lib/feature_wrappers.h b/apps/plugins/lib/feature_wrappers.h index 3f47f23c00..50552fbda4 100644 --- a/apps/plugins/lib/feature_wrappers.h +++ b/apps/plugins/lib/feature_wrappers.h | |||
@@ -30,24 +30,27 @@ | |||
30 | * but can easily be implement in pluginlib as long as the database is | 30 | * but can easily be implement in pluginlib as long as the database is |
31 | * available. | 31 | * available. |
32 | */ | 32 | */ |
33 | #ifdef HAVE_ALBUMART | 33 | #if defined(HAVE_ALBUMART) && defined(HAVE_JPEG) |
34 | #define search_albumart_files rb->search_albumart_files | 34 | #define search_albumart_files rb->search_albumart_files |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | /* This should only be used when loading scaled bitmaps, or using custom output | 37 | /* This should only be used when loading scaled bitmaps, or using custom output |
38 | * plugins. The pluginlib loader does not support loading bitmaps unscaled in | 38 | * plugins. A native output plugin for the scaler is available as format_native |
39 | * native format, so rb->read_bmp_file should always be used directly to load | 39 | * on targets with LCD_DEPTH > 1 |
40 | * such images. | ||
41 | */ | 40 | */ |
42 | #if LCD_DEPTH > 1 | 41 | #ifdef HAVE_BMP_SCALING |
43 | #define scaled_read_bmp_file rb->read_bmp_file | 42 | #define scaled_read_bmp_file rb->read_bmp_file |
44 | #define scaled_read_bmp_fd rb->read_bmp_fd | 43 | #define scaled_read_bmp_fd rb->read_bmp_fd |
45 | #define read_jpeg_file rb->read_jpeg_file | ||
46 | #define read_jpeg_fd rb->read_jpeg_fd | ||
47 | #else | 44 | #else |
48 | #define scaled_read_bmp_file read_bmp_file | 45 | #define scaled_read_bmp_file read_bmp_file |
49 | #define scaled_read_bmp_fd read_bmp_fd | 46 | #define scaled_read_bmp_fd read_bmp_fd |
50 | #endif | 47 | #endif |
51 | 48 | ||
49 | #ifdef HAVE_JPEG | ||
50 | #define read_jpeg_file rb->read_jpeg_file | ||
51 | #define read_jpeg_fd rb->read_jpeg_fd | ||
52 | #else | ||
53 | #endif | ||
54 | |||
52 | #endif | 55 | #endif |
53 | 56 | ||
diff --git a/apps/plugins/lib/pluginlib_bmp.c b/apps/plugins/lib/pluginlib_bmp.c index b9cfc4ded3..110e534be0 100644 --- a/apps/plugins/lib/pluginlib_bmp.c +++ b/apps/plugins/lib/pluginlib_bmp.c | |||
@@ -122,10 +122,16 @@ void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst) | |||
122 | } | 122 | } |
123 | } | 123 | } |
124 | 124 | ||
125 | #else /* LCD_DEPTH == 1 */ | 125 | #endif /* LCD_DEPTH > 1 */ |
126 | |||
127 | #ifndef HAVE_BMP_SCALING | ||
126 | #include "wrappers.h" | 128 | #include "wrappers.h" |
127 | 129 | ||
128 | /* import the core bmp loader */ | 130 | /* import the core bmp loader */ |
129 | #include "../../recorder/bmp.c" | 131 | #include "recorder/bmp.c" |
130 | 132 | #else | |
133 | /* the full 16x16 Bayer dither matrix may be calculated quickly with this table | ||
134 | */ | ||
135 | const unsigned char dither_table[16] = | ||
136 | { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }; | ||
131 | #endif | 137 | #endif |
diff --git a/apps/plugins/lib/read_image.c b/apps/plugins/lib/read_image.c index 8b6d784213..5b07882764 100644 --- a/apps/plugins/lib/read_image.c +++ b/apps/plugins/lib/read_image.c | |||
@@ -28,12 +28,10 @@ | |||
28 | int read_image_file(const char* filename, struct bitmap *bm, int maxsize, | 28 | int read_image_file(const char* filename, struct bitmap *bm, int maxsize, |
29 | int format, const struct custom_format *cformat) | 29 | int format, const struct custom_format *cformat) |
30 | { | 30 | { |
31 | #if LCD_DEPTH > 1 | ||
32 | int namelen = rb->strlen(filename); | 31 | int namelen = rb->strlen(filename); |
33 | if (rb->strcmp(filename + namelen - 4, ".bmp")) | 32 | if (rb->strcmp(filename + namelen - 4, ".bmp")) |
34 | return read_jpeg_file(filename, bm, maxsize, format, cformat); | 33 | return read_jpeg_file(filename, bm, maxsize, format, cformat); |
35 | else | 34 | else |
36 | #endif | ||
37 | return scaled_read_bmp_file(filename, bm, maxsize, format, cformat); | 35 | return scaled_read_bmp_file(filename, bm, maxsize, format, cformat); |
38 | } | 36 | } |
39 | 37 | ||
@@ -46,11 +44,9 @@ int read_image_file_offset(int offset, const char* filename, struct bitmap *bm, | |||
46 | return fd; | 44 | return fd; |
47 | if (offset != rb->lseek(fd, offset, SEEK_SET)) | 45 | if (offset != rb->lseek(fd, offset, SEEK_SET)) |
48 | return -1; | 46 | return -1; |
49 | #if LCD_DEPTH > 1 | ||
50 | int namelen = rb->strlen(filename); | 47 | int namelen = rb->strlen(filename); |
51 | if (rb->strcmp(filename + namelen - 4, ".bmp")) | 48 | if (rb->strcmp(filename + namelen - 4, ".bmp")) |
52 | return read_jpeg_fd(fd, bm, maxsize, format, cformat); | 49 | return read_jpeg_fd(fd, bm, maxsize, format, cformat); |
53 | else | 50 | else |
54 | #endif | ||
55 | return scaled_read_bmp_fd(fd, bm, maxsize, format, cformat); | 51 | return scaled_read_bmp_fd(fd, bm, maxsize, format, cformat); |
56 | } | 52 | } |
diff --git a/apps/plugins/pictureflow.c b/apps/plugins/pictureflow.c index f0931820d5..b78b953f13 100644 --- a/apps/plugins/pictureflow.c +++ b/apps/plugins/pictureflow.c | |||
@@ -927,8 +927,13 @@ bool create_albumart_cache(void) | |||
927 | input_bmp.data = buf; | 927 | input_bmp.data = buf; |
928 | input_bmp.width = DISPLAY_WIDTH; | 928 | input_bmp.width = DISPLAY_WIDTH; |
929 | input_bmp.height = DISPLAY_HEIGHT; | 929 | input_bmp.height = DISPLAY_HEIGHT; |
930 | #if PLUGIN_BUFFER_SIZE > 0x10000 | ||
930 | ret = read_image_file(albumart_file, &input_bmp, | 931 | ret = read_image_file(albumart_file, &input_bmp, |
931 | buf_size, format, &format_transposed); | 932 | buf_size, format, &format_transposed); |
933 | #else | ||
934 | ret = scaled_read_bmp_file(albumart_file, &input_bmp, | ||
935 | buf_size, format, &format_transposed); | ||
936 | #endif | ||
932 | if (ret <= 0) { | 937 | if (ret <= 0) { |
933 | rb->splash(HZ, "Could not read bmp"); | 938 | rb->splash(HZ, "Could not read bmp"); |
934 | continue; /* skip missing/broken files */ | 939 | continue; /* skip missing/broken files */ |