aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gdisp/gdisp_images
diff options
context:
space:
mode:
Diffstat (limited to 'demos/modules/gdisp/gdisp_images')
-rw-r--r--demos/modules/gdisp/gdisp_images/gfxconf.h56
-rw-r--r--demos/modules/gdisp/gdisp_images/main.c52
-rw-r--r--demos/modules/gdisp/gdisp_images/results_650x493.pngbin0 -> 32345 bytes
-rw-r--r--demos/modules/gdisp/gdisp_images/test-pal8.bmpbin0 -> 9254 bytes
4 files changed, 108 insertions, 0 deletions
diff --git a/demos/modules/gdisp/gdisp_images/gfxconf.h b/demos/modules/gdisp/gdisp_images/gfxconf.h
new file mode 100644
index 00000000..77e70f36
--- /dev/null
+++ b/demos/modules/gdisp/gdisp_images/gfxconf.h
@@ -0,0 +1,56 @@
+/**
+ * This file has a different license to the rest of the GFX system.
+ * You can copy, modify and distribute this file as you see fit.
+ * You do not need to publish your source modifications to this file.
+ * The only thing you are not permitted to do is to relicense it
+ * under a different license.
+ */
+
+#ifndef _GFXCONF_H
+#define _GFXCONF_H
+
+/* GFX sub-systems to turn on */
+#define GFX_USE_GDISP TRUE
+#define GFX_USE_GWIN FALSE
+#define GFX_USE_GEVENT FALSE
+#define GFX_USE_GTIMER FALSE
+#define GFX_USE_GINPUT FALSE
+
+/* Features for the GDISP sub-system. */
+#define GDISP_NEED_VALIDATION TRUE
+#define GDISP_NEED_CLIP TRUE
+#define GDISP_NEED_TEXT FALSE
+#define GDISP_NEED_CIRCLE FALSE
+#define GDISP_NEED_ELLIPSE FALSE
+#define GDISP_NEED_ARC FALSE
+#define GDISP_NEED_CONVEX_POLYGON FALSE
+#define GDISP_NEED_SCROLL FALSE
+#define GDISP_NEED_PIXELREAD FALSE
+#define GDISP_NEED_CONTROL FALSE
+#define GDISP_NEED_IMAGE TRUE
+#define GDISP_NEED_MULTITHREAD FALSE
+#define GDISP_NEED_ASYNC FALSE
+#define GDISP_NEED_MSGAPI FALSE
+
+/* Builtin Fonts */
+#define GDISP_INCLUDE_FONT_SMALL FALSE
+#define GDISP_INCLUDE_FONT_LARGER FALSE
+#define GDISP_INCLUDE_FONT_UI1 FALSE
+#define GDISP_INCLUDE_FONT_UI2 FALSE
+#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE
+
+/* GDISP image decoders */
+#define GDISP_NEED_IMAGE_NATIVE FALSE
+#define GDISP_NEED_IMAGE_GIF FALSE
+#define GDISP_NEED_IMAGE_BMP TRUE
+#define GDISP_NEED_IMAGE_JPG FALSE
+#define GDISP_NEED_IMAGE_PNG FALSE
+
+/* Features for the GWIN sub-system. */
+#define GWIN_NEED_BUTTON FALSE
+#define GWIN_NEED_CONSOLE FALSE
+
+/* Features for the GINPUT sub-system. */
+#define GINPUT_NEED_MOUSE FALSE
+
+#endif /* _GFXCONF_H */
diff --git a/demos/modules/gdisp/gdisp_images/main.c b/demos/modules/gdisp/gdisp_images/main.c
new file mode 100644
index 00000000..6ca5f640
--- /dev/null
+++ b/demos/modules/gdisp/gdisp_images/main.c
@@ -0,0 +1,52 @@
+/*
+ ChibiOS/GFX - Copyright (C) 2012, 2013
+ Joel Bodenmann aka Tectu <joel@unormal.org>
+
+ This file is part of ChibiOS/GFX.
+
+ ChibiOS/GFX 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 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/GFX is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "ch.h"
+#include "hal.h"
+#include "gfx.h"
+
+static gdispImage myImage;
+
+int main(void) {
+ coord_t swidth, sheight;
+
+ halInit(); // Initialise the Hardware
+ chSysInit(); // Initialize the OS
+ gdispInit(); // Initialize the display
+
+ gdispClear(Black);
+
+ // Get the display dimensions
+ swidth = gdispGetWidth();
+ sheight = gdispGetHeight();
+
+ // Set up IO for our image
+ gdispImageSetSimulFileReader(&myImage, "test-pal8.bmp");
+
+ gdispImageOpen(&myImage);
+ gdispImageDraw(&myImage, 0, 0, swidth, sheight, 0, 0);
+ gdispImageClose(&myImage);
+
+ while(1) {
+ chThdSleepMilliseconds(1000);
+ }
+
+ return 0;
+}
diff --git a/demos/modules/gdisp/gdisp_images/results_650x493.png b/demos/modules/gdisp/gdisp_images/results_650x493.png
new file mode 100644
index 00000000..66dcd6e3
--- /dev/null
+++ b/demos/modules/gdisp/gdisp_images/results_650x493.png
Binary files differ
diff --git a/demos/modules/gdisp/gdisp_images/test-pal8.bmp b/demos/modules/gdisp/gdisp_images/test-pal8.bmp
new file mode 100644
index 00000000..96b2f866
--- /dev/null
+++ b/demos/modules/gdisp/gdisp_images/test-pal8.bmp
Binary files differ