summaryrefslogtreecommitdiffstats
path: root/apps/recorder/resize.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder/resize.h')
-rw-r--r--apps/recorder/resize.h60
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 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id
+ *
+ * Copyright (C) 2008 by Akio Idehara
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef _RESIZE_H_
+#define _RESIZE_H_
+
+#include "config.h"
+#include "lcd.h"
+
+/****************************************************************
+ * resize_on_load()
+ *
+ * resize bitmap on load with scaling
+ *
+ * If HAVE_LCD_COLOR then this func use smooth scaling algorithm
+ * - downscaling both way use "Area Sampling"
+ * if IMG_RESIZE_BILINER or IMG_RESIZE_NEAREST is NOT set
+ * - otherwise "Bilinear" or "Nearest Neighbour"
+ *
+ * If !(HAVE_LCD_COLOR) then use simple scaling algorithm "Nearest Neighbour"
+ *
+ * return -1 for error
+ ****************************************************************/
+
+/* nothing needs the on-stack buffer right now */
+#define MAX_SC_STACK_ALLOC 0
+#define HAVE_UPSCALER 1
+
+struct img_part {
+ int len;
+ struct uint8_rgb* buf;
+};
+
+int resize_on_load(struct bitmap *bm, bool dither,
+ struct dim *src,
+ struct rowset *tmp_row, bool remote,
+#ifdef HAVE_LCD_COLOR
+ unsigned char *buf, unsigned int len,
+#endif
+ struct img_part* (*store_part)(void *args),
+ bool (*skip_lines)(void *args, unsigned int lines),
+ void *args);
+#endif /* _RESIZE_H_ */