mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
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
This commit is contained in:
parent
dfb24d6cee
commit
20f76d61ae
46 changed files with 318 additions and 79 deletions
|
@ -88,8 +88,6 @@ gui/viewport.c
|
|||
|
||||
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1))
|
||||
gui/backdrop.c
|
||||
recorder/resize.c
|
||||
recorder/jpeg_load.c
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
|
@ -101,6 +99,12 @@ recorder/bmp.c
|
|||
recorder/icons.c
|
||||
recorder/keyboard.c
|
||||
recorder/peakmeter.c
|
||||
#if defined(HAVE_ALBUMART) || defined(HAVE_JPEG)
|
||||
recorder/resize.c
|
||||
#endif
|
||||
#ifdef HAVE_JPEG
|
||||
recorder/jpeg_load.c
|
||||
#endif
|
||||
#ifdef HAVE_ALBUMART
|
||||
recorder/albumart.c
|
||||
#endif
|
||||
|
|
|
@ -834,7 +834,6 @@ static bool fill_buffer(void)
|
|||
static int load_image(int fd, const char *path)
|
||||
{
|
||||
int rc;
|
||||
int pathlen = strlen(path);
|
||||
struct bitmap *bmp = (struct bitmap *)&buffer[buf_widx];
|
||||
/* FIXME: alignment may be needed for the data buffer. */
|
||||
bmp->data = &buffer[buf_widx + sizeof(struct bitmap)];
|
||||
|
@ -848,10 +847,13 @@ static int load_image(int fd, const char *path)
|
|||
|
||||
get_albumart_size(bmp);
|
||||
|
||||
#ifdef HAVE_JPEG
|
||||
int pathlen = strlen(path);
|
||||
if (strcmp(path + pathlen - 4, ".bmp"))
|
||||
rc = read_jpeg_fd(fd, bmp, free, FORMAT_NATIVE|FORMAT_DITHER|
|
||||
FORMAT_RESIZE|FORMAT_KEEP_ASPECT, NULL);
|
||||
else
|
||||
#endif
|
||||
rc = read_bmp_fd(fd, bmp, free, FORMAT_NATIVE|FORMAT_DITHER|
|
||||
FORMAT_RESIZE|FORMAT_KEEP_ASPECT, NULL);
|
||||
return rc + (rc > 0 ? sizeof(struct bitmap) : 0);
|
||||
|
|
|
@ -644,7 +644,7 @@ static const struct plugin_api rockbox_api = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#if LCD_DEPTH > 1
|
||||
#ifdef HAVE_JPEG
|
||||
read_jpeg_file,
|
||||
read_jpeg_fd,
|
||||
#endif
|
||||
|
|
|
@ -805,7 +805,7 @@ struct plugin_api {
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#if LCD_DEPTH > 1
|
||||
#ifdef HAVE_JPEG
|
||||
int (*read_jpeg_file)(const char* filename, struct bitmap *bm, int maxsize,
|
||||
int format, const struct custom_format *cformat);
|
||||
int (*read_jpeg_fd)(int fd, struct bitmap *bm, int maxsize,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -927,8 +927,13 @@ bool create_albumart_cache(void)
|
|||
input_bmp.data = buf;
|
||||
input_bmp.width = DISPLAY_WIDTH;
|
||||
input_bmp.height = DISPLAY_HEIGHT;
|
||||
#if PLUGIN_BUFFER_SIZE > 0x10000
|
||||
ret = read_image_file(albumart_file, &input_bmp,
|
||||
buf_size, format, &format_transposed);
|
||||
#else
|
||||
ret = scaled_read_bmp_file(albumart_file, &input_bmp,
|
||||
buf_size, format, &format_transposed);
|
||||
#endif
|
||||
if (ret <= 0) {
|
||||
rb->splash(HZ, "Could not read bmp");
|
||||
continue; /* skip missing/broken files */
|
||||
|
|
|
@ -91,7 +91,7 @@ static void fix_path_part(char* path, int offset, int count)
|
|||
}
|
||||
}
|
||||
|
||||
#if LCD_DEPTH > 1
|
||||
#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000)
|
||||
const char * extensions[] = { "jpeg", "jpg", "bmp" };
|
||||
int extension_lens[] = { 4, 3, 3 };
|
||||
/* 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,
|
|||
const char *artist;
|
||||
int dirlen;
|
||||
int albumlen;
|
||||
#if LCD_DEPTH > 1
|
||||
#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000)
|
||||
int pathlen;
|
||||
#endif
|
||||
|
||||
|
@ -153,7 +153,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
/* the first file we look for is one specific to the track playing */
|
||||
strip_extension(path, sizeof(path) - strlen(size_string) - 4, trackname);
|
||||
strcat(path, size_string);
|
||||
#if LCD_DEPTH > 1
|
||||
#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000)
|
||||
strcat(path, ".");
|
||||
pathlen = strlen(path);
|
||||
found = try_exts(path, pathlen);
|
||||
|
@ -165,7 +165,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
{
|
||||
/* if it doesn't exist,
|
||||
* we look for a file specific to the track's album name */
|
||||
#if LCD_DEPTH > 1
|
||||
#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000)
|
||||
pathlen = snprintf(path, sizeof(path),
|
||||
"%s%s%s.", dir, id3->album, size_string);
|
||||
fix_path_part(path, dirlen, albumlen);
|
||||
|
@ -181,7 +181,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
if (!found)
|
||||
{
|
||||
/* if it still doesn't exist, we look for a generic file */
|
||||
#if LCD_DEPTH > 1
|
||||
#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000)
|
||||
pathlen = snprintf(path, sizeof(path),
|
||||
"%scover%s.", dir, size_string);
|
||||
found = try_exts(path, pathlen);
|
||||
|
@ -192,7 +192,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
#endif
|
||||
}
|
||||
|
||||
#if LCD_DEPTH > 1
|
||||
#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000)
|
||||
if (!found)
|
||||
{
|
||||
snprintf (path, sizeof(path), "%sfolder.jpg", dir);
|
||||
|
@ -205,7 +205,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
if (!found && artist && id3->album)
|
||||
{
|
||||
/* look in the albumart subdir of .rockbox */
|
||||
#if LCD_DEPTH > 1
|
||||
#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000)
|
||||
pathlen = snprintf(path, sizeof(path),
|
||||
ROCKBOX_DIR "/albumart/%s-%s%s.",
|
||||
artist,
|
||||
|
@ -241,7 +241,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
{
|
||||
/* we look in the parent directory
|
||||
* for a file specific to the track's album name */
|
||||
#if LCD_DEPTH > 1
|
||||
#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000)
|
||||
pathlen = snprintf(path, sizeof(path),
|
||||
"%s%s%s.", dir, id3->album, size_string);
|
||||
fix_path_part(path, dirlen, albumlen);
|
||||
|
@ -258,7 +258,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
{
|
||||
/* if it still doesn't exist, we look in the parent directory
|
||||
* for a generic file */
|
||||
#if LCD_DEPTH > 1
|
||||
#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000)
|
||||
pathlen = snprintf(path, sizeof(path),
|
||||
"%scover%s.", dir, size_string);
|
||||
found = try_exts(path, pathlen);
|
||||
|
@ -278,7 +278,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ALBUMART
|
||||
#ifndef PLUGIN
|
||||
/* Look for albumart bitmap in the same dir as the track and in its parent dir.
|
||||
* Stores the found filename in the buf parameter.
|
||||
* Returns true if a bitmap was found, false otherwise */
|
||||
|
@ -386,4 +386,4 @@ void get_albumart_size(struct bitmap *bmp)
|
|||
bmp->width = data->albumart_max_width;
|
||||
bmp->height = data->albumart_max_height;
|
||||
}
|
||||
#endif /* HAVE_ALBUMART */
|
||||
#endif /* PLUGIN */
|
||||
|
|
|
@ -184,8 +184,8 @@ struct bmp_args {
|
|||
short depth;
|
||||
unsigned char buf[BM_MAX_WIDTH * 4];
|
||||
struct uint8_rgb *palette;
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
int cur_row;
|
||||
int cur_col;
|
||||
struct img_part part;
|
||||
|
@ -198,8 +198,8 @@ static unsigned int read_part_line(struct bmp_args *ba)
|
|||
const int read_width = ba->read_width;
|
||||
const int width = ba->width;
|
||||
const int depth = ba->depth;
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
int cur_row = ba->cur_row;
|
||||
int cur_col = ba->cur_col;
|
||||
#endif
|
||||
|
@ -211,8 +211,8 @@ static unsigned int read_part_line(struct bmp_args *ba)
|
|||
int ret;
|
||||
int i, cols, len;
|
||||
|
||||
#if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
cols = MIN(width - cur_col,(int)BM_MAX_WIDTH);
|
||||
BDEBUGF("reading %d cols (width: %d, max: %d)\n",cols,width,BM_MAX_WIDTH);
|
||||
len = (cols * (depth == 15 ? 16 : depth) + 7) >> 3;
|
||||
|
@ -227,8 +227,8 @@ static unsigned int read_part_line(struct bmp_args *ba)
|
|||
{
|
||||
DEBUGF("read_part_line: error reading image, read returned %d "
|
||||
"expected %d\n", ret, len);
|
||||
#if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
BDEBUGF("cur_row: %d cur_col: %d cols: %d len: %d\n", cur_row, cur_col,
|
||||
cols, len);
|
||||
#endif
|
||||
|
@ -290,17 +290,17 @@ static unsigned int read_part_line(struct bmp_args *ba)
|
|||
}
|
||||
}
|
||||
|
||||
#if (!defined(HAVE_LCD_COLOR) && \
|
||||
(LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1))) || \
|
||||
defined(PLUGIN)
|
||||
#if !defined(HAVE_LCD_COLOR) && \
|
||||
((LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) || \
|
||||
defined(PLUGIN))
|
||||
ibuf = ba->buf;
|
||||
buf = (struct uint8_rgb*)ba->buf;
|
||||
while (ibuf < ba->buf + cols)
|
||||
*ibuf++ = brightness(*buf++);
|
||||
#endif
|
||||
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
cur_col += cols;
|
||||
if (cur_col == width)
|
||||
{
|
||||
|
@ -311,8 +311,8 @@ static unsigned int read_part_line(struct bmp_args *ba)
|
|||
BDEBUGF("seeking %d bytes to next line\n",pad);
|
||||
lseek(fd, pad, SEEK_CUR);
|
||||
}
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
cur_col = 0;
|
||||
BDEBUGF("read_part_line: completed row %d\n", cur_row);
|
||||
cur_row += 1;
|
||||
|
@ -324,8 +324,8 @@ static unsigned int read_part_line(struct bmp_args *ba)
|
|||
return cols;
|
||||
}
|
||||
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
static struct img_part *store_part_bmp(void *args)
|
||||
{
|
||||
struct bmp_args *ba = (struct bmp_args *)args;
|
||||
|
@ -375,10 +375,13 @@ int read_bmp_fd(int fd,
|
|||
struct uint8_rgb palette[256];
|
||||
struct rowset rset;
|
||||
struct dim src_dim;
|
||||
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)) \
|
||||
|| defined(PLUGIN)
|
||||
unsigned int resize = IMG_NORESIZE;
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) || \
|
||||
defined(PLUGIN)
|
||||
bool dither = false;
|
||||
#endif
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
unsigned int resize = IMG_NORESIZE;
|
||||
bool transparent = false;
|
||||
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
|
@ -398,14 +401,16 @@ int read_bmp_fd(int fd,
|
|||
if (format & FORMAT_TRANSPARENT) {
|
||||
transparent = true;
|
||||
}
|
||||
if (format & FORMAT_DITHER) {
|
||||
dither = true;
|
||||
}
|
||||
#else
|
||||
|
||||
(void)format;
|
||||
#endif /*(LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)*/
|
||||
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) || \
|
||||
defined(PLUGIN)
|
||||
if (format & FORMAT_DITHER) {
|
||||
dither = true;
|
||||
}
|
||||
#endif
|
||||
/* read fileheader */
|
||||
ret = read(fd, &bmph, sizeof(struct bmp_header));
|
||||
if (ret < 0) {
|
||||
|
@ -444,8 +449,11 @@ int read_bmp_fd(int fd,
|
|||
bm->format = format & 1;
|
||||
if ((format & 1) == FORMAT_MONO)
|
||||
{
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
resize &= ~IMG_RESIZE;
|
||||
resize |= IMG_NORESIZE;
|
||||
#endif
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
remote = 0;
|
||||
#endif
|
||||
|
@ -455,8 +463,8 @@ int read_bmp_fd(int fd,
|
|||
return -6;
|
||||
#endif /*(LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)*/
|
||||
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
if (resize & IMG_RESIZE) {
|
||||
if(format & FORMAT_KEEP_ASPECT) {
|
||||
/* keep aspect ratio.. */
|
||||
|
@ -471,19 +479,19 @@ int read_bmp_fd(int fd,
|
|||
}
|
||||
}
|
||||
|
||||
format &= 1;
|
||||
|
||||
if (!(resize & IMG_RESIZE)) {
|
||||
#endif
|
||||
/* returning image size */
|
||||
bm->width = src_dim.width;
|
||||
bm->height = src_dim.height;
|
||||
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)
|
||||
format &= 1;
|
||||
#endif
|
||||
if (rset.rowstep > 0) { /* Top-down BMP file */
|
||||
rset.rowstart = 0;
|
||||
rset.rowstop = bm->height;
|
||||
|
@ -581,15 +589,15 @@ int read_bmp_fd(int fd,
|
|||
struct bmp_args ba = {
|
||||
.fd = fd, .padded_width = padded_width, .read_width = read_width,
|
||||
.width = src_dim.width, .depth = depth, .palette = palette,
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
.cur_row = 0, .cur_col = 0, .part = {0,0}
|
||||
#endif
|
||||
};
|
||||
|
||||
#if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \
|
||||
defined(PLUGIN)
|
||||
#if LCD_DEPTH > 1
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
|
||||
defined(HAVE_BMP_SCALING) || defined(PLUGIN)
|
||||
#if LCD_DEPTH > 1 && defined(HAVE_BMP_SCALING)
|
||||
if (resize || cformat)
|
||||
#endif
|
||||
{
|
||||
|
@ -600,12 +608,12 @@ int read_bmp_fd(int fd,
|
|||
else
|
||||
return 0;
|
||||
}
|
||||
#ifndef PLUGIN
|
||||
int fb_width = BM_WIDTH(bm->width,bm->format,remote);
|
||||
#endif
|
||||
#endif /* LCD_DEPTH */
|
||||
|
||||
#ifndef PLUGIN
|
||||
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1))
|
||||
int fb_width = BM_WIDTH(bm->width,bm->format,remote);
|
||||
#endif
|
||||
int col, row;
|
||||
|
||||
/* loop to read rows and put them to buffer */
|
||||
|
|
|
@ -516,8 +516,9 @@ static inline bool scale_v_linear(struct rowset *rset,
|
|||
}
|
||||
#endif /* HAVE_UPSCALER */
|
||||
|
||||
#ifndef PLUGIN
|
||||
static void output_row_native(uint32_t row, void * row_in, struct scaler_context *ctx)
|
||||
#if !defined(PLUGIN) || LCD_DEPTH > 1
|
||||
void output_row_native(uint32_t row, void * row_in,
|
||||
struct scaler_context *ctx)
|
||||
{
|
||||
int col;
|
||||
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
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PLUGIN) && LCD_DEPTH > 1
|
||||
unsigned int get_size_native(struct bitmap *bm)
|
||||
{
|
||||
return BM_SIZE(bm->width,bm->height,FORMAT_NATIVE,FALSE);
|
||||
}
|
||||
|
||||
const struct custom_format format_native = {
|
||||
.output_row = output_row_native,
|
||||
.get_size = get_size_native
|
||||
};
|
||||
#endif
|
||||
|
||||
int resize_on_load(struct bitmap *bm, bool dither, struct dim *src,
|
||||
struct rowset *rset, unsigned char *buf, unsigned int len,
|
||||
const struct custom_format *format,
|
||||
|
@ -669,7 +682,7 @@ int resize_on_load(struct bitmap *bm, bool dither, struct dim *src,
|
|||
ctx.bm = bm;
|
||||
ctx.src = src;
|
||||
ctx.dither = dither;
|
||||
#ifndef PLUGIN
|
||||
#if !defined(PLUGIN)
|
||||
ctx.output_row = output_row_native;
|
||||
if (format)
|
||||
#endif
|
||||
|
|
|
@ -149,6 +149,12 @@ struct custom_format {
|
|||
};
|
||||
|
||||
struct rowset;
|
||||
|
||||
void output_row_native(uint32_t row, void * row_in,
|
||||
struct scaler_context *ctx);
|
||||
|
||||
extern const struct custom_format format_native;
|
||||
|
||||
int recalc_dimension(struct dim *dst, struct dim *src);
|
||||
|
||||
int resize_on_load(struct bitmap *bm, bool dither,
|
||||
|
|
|
@ -29,6 +29,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have a light associated with the buttons */
|
||||
#define HAVE_BUTTON_LIGHT
|
||||
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have a light associated with the buttons */
|
||||
#define HAVE_BUTTON_LIGHT
|
||||
|
||||
|
|
|
@ -41,6 +41,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
/* define this if you have access to the pitchscreen */
|
||||
|
|
|
@ -29,6 +29,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have a light associated with the buttons */
|
||||
#define HAVE_BUTTON_LIGHT
|
||||
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have a light associated with the buttons */
|
||||
#define HAVE_BUTTON_LIGHT
|
||||
|
||||
|
|
|
@ -35,6 +35,12 @@
|
|||
#ifndef BOOTLOADER/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have a light associated with the buttons */
|
||||
#define HAVE_BUTTON_LIGHT
|
||||
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
|
||||
|
|
|
@ -34,6 +34,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can flip your LCD */
|
||||
#define HAVE_LCD_FLIP
|
||||
|
||||
|
|
|
@ -34,6 +34,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
|
||||
|
|
|
@ -18,6 +18,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can flip your LCD */
|
||||
#define HAVE_LCD_FLIP
|
||||
|
||||
|
|
|
@ -21,6 +21,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can flip your LCD */
|
||||
#define HAVE_LCD_FLIP
|
||||
|
||||
|
|
|
@ -35,6 +35,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
|
||||
|
|
|
@ -42,6 +42,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
|
||||
|
|
|
@ -30,6 +30,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can flip your LCD */
|
||||
#define HAVE_LCD_FLIP
|
||||
|
||||
|
|
|
@ -30,6 +30,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can flip your LCD */
|
||||
#define HAVE_LCD_FLIP
|
||||
|
||||
|
|
|
@ -36,6 +36,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can invert the colours on your LCD */
|
||||
#define HAVE_LCD_INVERT
|
||||
|
||||
|
|
|
@ -30,6 +30,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can invert the colours on your LCD */
|
||||
#define HAVE_LCD_INVERT
|
||||
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can invert the colours on your LCD */
|
||||
#define HAVE_LCD_INVERT
|
||||
|
||||
|
|
|
@ -32,6 +32,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can invert the colours on your LCD */
|
||||
#define HAVE_LCD_INVERT
|
||||
|
||||
|
|
|
@ -35,6 +35,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
/* define this if you have access to the pitchscreen */
|
||||
|
|
|
@ -30,6 +30,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can invert the colours on your LCD */
|
||||
#define HAVE_LCD_INVERT
|
||||
|
||||
|
|
|
@ -30,6 +30,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can invert the colours on your LCD */
|
||||
#define HAVE_LCD_INVERT
|
||||
|
||||
|
|
|
@ -35,6 +35,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
/* define this if you have access to the pitchscreen */
|
||||
|
|
|
@ -37,6 +37,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
/* define this if you have access to the pitchscreen */
|
||||
|
|
|
@ -52,6 +52,12 @@
|
|||
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
#define CONFIG_KEYPAD LYRE_PROTO1_PAD
|
||||
|
||||
/* Define this if you do software codec */
|
||||
|
|
|
@ -33,6 +33,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can invert the colours on your LCD */
|
||||
//#define HAVE_LCD_INVERT
|
||||
|
||||
|
|
|
@ -33,6 +33,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can invert the colours on your LCD */
|
||||
//#define HAVE_LCD_INVERT
|
||||
|
||||
|
|
|
@ -33,6 +33,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you can invert the colours on your LCD */
|
||||
//#define HAVE_LCD_INVERT
|
||||
|
||||
|
|
|
@ -44,6 +44,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
|
||||
|
|
|
@ -54,6 +54,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
|
||||
|
|
|
@ -18,6 +18,12 @@
|
|||
/* define this if you want album art for this target */
|
||||
#define HAVE_ALBUMART
|
||||
|
||||
/* define this to enable bitmap scaling */
|
||||
#define HAVE_BMP_SCALING
|
||||
|
||||
/* define this to enable JPEG decoding */
|
||||
#define HAVE_JPEG
|
||||
|
||||
/* define this if you have a light associated with the buttons */
|
||||
#define HAVE_BUTTON_LIGHT
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue