diff options
Diffstat (limited to 'apps/plugins/lib')
| -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 |
4 files changed, 24 insertions, 21 deletions
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index dfdd569..dc4d41c 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES @@ -5,15 +5,13 @@ fixedpoint.c playback_control.c rgb_hsv.c buflib.c -#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) -/* - The scaler is not provided in core on mono targets, but is built in - pluginlib for use with greylib overlay output -*/ -#if LCD_DEPTH == 1 +#if !defined(HAVE_BMP_SCALING) || !defined(HAVE_JPEG) pluginlib_resize.c +#endif +#ifndef HAVE_JPEG pluginlib_jpeg_load.c #endif +#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) grey_core.c grey_draw.c grey_parm.c @@ -45,7 +43,7 @@ read_image.c #ifdef HAVE_LCD_COLOR bmp_smooth_scale.c #endif -#ifndef HAVE_ALBUMART +#if !defined(HAVE_ALBUMART) || !defined(HAVE_JPEG) pluginlib_albumart.c #endif #endif diff --git a/apps/plugins/lib/feature_wrappers.h b/apps/plugins/lib/feature_wrappers.h index 3f47f23..50552fb 100644 --- a/apps/plugins/lib/feature_wrappers.h +++ b/apps/plugins/lib/feature_wrappers.h @@ -30,24 +30,27 @@ * but can easily be implement in pluginlib as long as the database is * available. */ -#ifdef HAVE_ALBUMART +#if defined(HAVE_ALBUMART) && defined(HAVE_JPEG) #define search_albumart_files rb->search_albumart_files #endif /* This should only be used when loading scaled bitmaps, or using custom output - * plugins. The pluginlib loader does not support loading bitmaps unscaled in - * native format, so rb->read_bmp_file should always be used directly to load - * such images. + * plugins. A native output plugin for the scaler is available as format_native + * on targets with LCD_DEPTH > 1 */ -#if LCD_DEPTH > 1 +#ifdef HAVE_BMP_SCALING #define scaled_read_bmp_file rb->read_bmp_file #define scaled_read_bmp_fd rb->read_bmp_fd -#define read_jpeg_file rb->read_jpeg_file -#define read_jpeg_fd rb->read_jpeg_fd #else #define scaled_read_bmp_file read_bmp_file #define scaled_read_bmp_fd read_bmp_fd #endif +#ifdef HAVE_JPEG +#define read_jpeg_file rb->read_jpeg_file +#define read_jpeg_fd rb->read_jpeg_fd +#else +#endif + #endif diff --git a/apps/plugins/lib/pluginlib_bmp.c b/apps/plugins/lib/pluginlib_bmp.c index b9cfc4d..110e534 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) } } -#else /* LCD_DEPTH == 1 */ +#endif /* LCD_DEPTH > 1 */ + +#ifndef HAVE_BMP_SCALING #include "wrappers.h" /* import the core bmp loader */ -#include "../../recorder/bmp.c" - +#include "recorder/bmp.c" +#else +/* the full 16x16 Bayer dither matrix may be calculated quickly with this table +*/ +const unsigned char dither_table[16] = + { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }; #endif diff --git a/apps/plugins/lib/read_image.c b/apps/plugins/lib/read_image.c index 8b6d784..5b07882 100644 --- a/apps/plugins/lib/read_image.c +++ b/apps/plugins/lib/read_image.c @@ -28,12 +28,10 @@ int read_image_file(const char* filename, struct bitmap *bm, int maxsize, int format, const struct custom_format *cformat) { -#if LCD_DEPTH > 1 int namelen = rb->strlen(filename); if (rb->strcmp(filename + namelen - 4, ".bmp")) return read_jpeg_file(filename, bm, maxsize, format, cformat); else -#endif return scaled_read_bmp_file(filename, bm, maxsize, format, cformat); } @@ -46,11 +44,9 @@ int read_image_file_offset(int offset, const char* filename, struct bitmap *bm, return fd; if (offset != rb->lseek(fd, offset, SEEK_SET)) return -1; -#if LCD_DEPTH > 1 int namelen = rb->strlen(filename); if (rb->strcmp(filename + namelen - 4, ".bmp")) return read_jpeg_fd(fd, bm, maxsize, format, cformat); else -#endif return scaled_read_bmp_fd(fd, bm, maxsize, format, cformat); } |