diff options
Diffstat (limited to 'apps/recorder/resize.h')
-rw-r--r-- | apps/recorder/resize.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/apps/recorder/resize.h b/apps/recorder/resize.h new file mode 100644 index 0000000000..133ac50fdd --- /dev/null +++ b/apps/recorder/resize.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id | ||
9 | * | ||
10 | * Copyright (C) 2008 by Akio Idehara | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef _RESIZE_H_ | ||
22 | #define _RESIZE_H_ | ||
23 | |||
24 | #include "config.h" | ||
25 | #include "lcd.h" | ||
26 | |||
27 | /**************************************************************** | ||
28 | * resize_on_load() | ||
29 | * | ||
30 | * resize bitmap on load with scaling | ||
31 | * | ||
32 | * If HAVE_LCD_COLOR then this func use smooth scaling algorithm | ||
33 | * - downscaling both way use "Area Sampling" | ||
34 | * if IMG_RESIZE_BILINER or IMG_RESIZE_NEAREST is NOT set | ||
35 | * - otherwise "Bilinear" or "Nearest Neighbour" | ||
36 | * | ||
37 | * If !(HAVE_LCD_COLOR) then use simple scaling algorithm "Nearest Neighbour" | ||
38 | * | ||
39 | * return -1 for error | ||
40 | ****************************************************************/ | ||
41 | |||
42 | /* nothing needs the on-stack buffer right now */ | ||
43 | #define MAX_SC_STACK_ALLOC 0 | ||
44 | #define HAVE_UPSCALER 1 | ||
45 | |||
46 | struct img_part { | ||
47 | int len; | ||
48 | struct uint8_rgb* buf; | ||
49 | }; | ||
50 | |||
51 | int resize_on_load(struct bitmap *bm, bool dither, | ||
52 | struct dim *src, | ||
53 | struct rowset *tmp_row, bool remote, | ||
54 | #ifdef HAVE_LCD_COLOR | ||
55 | unsigned char *buf, unsigned int len, | ||
56 | #endif | ||
57 | struct img_part* (*store_part)(void *args), | ||
58 | bool (*skip_lines)(void *args, unsigned int lines), | ||
59 | void *args); | ||
60 | #endif /* _RESIZE_H_ */ | ||