summaryrefslogtreecommitdiff
path: root/apps/plugins/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r--apps/plugins/lib/SOURCES12
-rw-r--r--apps/plugins/lib/feature_wrappers.h17
-rw-r--r--apps/plugins/lib/pluginlib_bmp.c12
-rw-r--r--apps/plugins/lib/read_image.c4
4 files changed, 24 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
5playback_control.c 5playback_control.c
6rgb_hsv.c 6rgb_hsv.c
7buflib.c 7buflib.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
14pluginlib_resize.c 9pluginlib_resize.c
10#endif
11#ifndef HAVE_JPEG
15pluginlib_jpeg_load.c 12pluginlib_jpeg_load.c
16#endif 13#endif
14#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4)
17grey_core.c 15grey_core.c
18grey_draw.c 16grey_draw.c
19grey_parm.c 17grey_parm.c
@@ -45,7 +43,7 @@ read_image.c
45#ifdef HAVE_LCD_COLOR 43#ifdef HAVE_LCD_COLOR
46bmp_smooth_scale.c 44bmp_smooth_scale.c
47#endif 45#endif
48#ifndef HAVE_ALBUMART 46#if !defined(HAVE_ALBUMART) || !defined(HAVE_JPEG)
49pluginlib_albumart.c 47pluginlib_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*/
135const 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 @@
28int read_image_file(const char* filename, struct bitmap *bm, int maxsize, 28int 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}