Chris Womack / DMBasicGUI

Fork of DMBasicGUI by Embedded Artists

Committer:
embeddedartists
Date:
Thu Dec 11 11:03:57 2014 +0000
Revision:
0:4977187e90c7
Child:
1:46c8df4608c8
First version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 0:4977187e90c7 1
embeddedartists 0:4977187e90c7 2 #ifndef APP_IMAGEVIEWER_H
embeddedartists 0:4977187e90c7 3 #define APP_IMAGEVIEWER_H
embeddedartists 0:4977187e90c7 4
embeddedartists 0:4977187e90c7 5 #include "App.h"
embeddedartists 0:4977187e90c7 6 #include "DMBoard.h"
embeddedartists 0:4977187e90c7 7 #include "lpc_swim.h"
embeddedartists 0:4977187e90c7 8 #include "Button.h"
embeddedartists 0:4977187e90c7 9 #include "Image.h"
embeddedartists 0:4977187e90c7 10
embeddedartists 0:4977187e90c7 11 /**
embeddedartists 0:4977187e90c7 12 * LcdController example
embeddedartists 0:4977187e90c7 13 *
embeddedartists 0:4977187e90c7 14 * @code
embeddedartists 0:4977187e90c7 15 * #include "mbed.h"
embeddedartists 0:4977187e90c7 16 * #include "LcdController.h"
embeddedartists 0:4977187e90c7 17 *
embeddedartists 0:4977187e90c7 18 * LcdController::Config innolux(
embeddedartists 0:4977187e90c7 19 * 45,
embeddedartists 0:4977187e90c7 20 * 17,
embeddedartists 0:4977187e90c7 21 * 2,
embeddedartists 0:4977187e90c7 22 * 800,
embeddedartists 0:4977187e90c7 23 * 22,
embeddedartists 0:4977187e90c7 24 * 22,
embeddedartists 0:4977187e90c7 25 * 2,
embeddedartists 0:4977187e90c7 26 * 480,
embeddedartists 0:4977187e90c7 27 * false,
embeddedartists 0:4977187e90c7 28 * false,
embeddedartists 0:4977187e90c7 29 * true,
embeddedartists 0:4977187e90c7 30 * true,
embeddedartists 0:4977187e90c7 31 * true,
embeddedartists 0:4977187e90c7 32 * LcdController::Bpp_16_565,
embeddedartists 0:4977187e90c7 33 * 36000000,
embeddedartists 0:4977187e90c7 34 * LcdController::Tft,
embeddedartists 0:4977187e90c7 35 * false);
embeddedartists 0:4977187e90c7 36 *
embeddedartists 0:4977187e90c7 37 * int main(void) {
embeddedartists 0:4977187e90c7 38 * LcdController lcd;
embeddedartists 0:4977187e90c7 39 *
embeddedartists 0:4977187e90c7 40 * lcd.open(&innolux);
embeddedartists 0:4977187e90c7 41 * lcd.setFrameBuffer(frameBuffer);
embeddedartists 0:4977187e90c7 42 * lcd.setPower(true);
embeddedartists 0:4977187e90c7 43 *
embeddedartists 0:4977187e90c7 44 * // draw on the frame buffer
embeddedartists 0:4977187e90c7 45 * ...
embeddedartists 0:4977187e90c7 46 * }
embeddedartists 0:4977187e90c7 47 * @endcode
embeddedartists 0:4977187e90c7 48 */
embeddedartists 0:4977187e90c7 49 class AppImageViewer : public App {
embeddedartists 0:4977187e90c7 50 public:
embeddedartists 0:4977187e90c7 51
embeddedartists 0:4977187e90c7 52 AppImageViewer();
embeddedartists 0:4977187e90c7 53 ~AppImageViewer();
embeddedartists 0:4977187e90c7 54
embeddedartists 0:4977187e90c7 55 virtual bool setup();
embeddedartists 0:4977187e90c7 56 virtual void runToCompletion();
embeddedartists 0:4977187e90c7 57 virtual bool teardown();
embeddedartists 0:4977187e90c7 58
embeddedartists 0:4977187e90c7 59 void load(const char* file);
embeddedartists 0:4977187e90c7 60
embeddedartists 0:4977187e90c7 61 private:
embeddedartists 0:4977187e90c7 62 Display* _disp;
embeddedartists 0:4977187e90c7 63 SWIM_WINDOW_T* _win;
embeddedartists 0:4977187e90c7 64 void* _fb1;
embeddedartists 0:4977187e90c7 65 void* _fb2;
embeddedartists 0:4977187e90c7 66 Button* _btn;
embeddedartists 0:4977187e90c7 67 Mail<Image::ImageData_t, 2> _mailbox;
embeddedartists 0:4977187e90c7 68 int _active;
embeddedartists 0:4977187e90c7 69 int _next;
embeddedartists 0:4977187e90c7 70 Mutex _allowedToRender;
embeddedartists 0:4977187e90c7 71 Mutex _imageLoaded;
embeddedartists 0:4977187e90c7 72
embeddedartists 0:4977187e90c7 73 void draw();
embeddedartists 0:4977187e90c7 74 };
embeddedartists 0:4977187e90c7 75
embeddedartists 0:4977187e90c7 76 #endif
embeddedartists 0:4977187e90c7 77
embeddedartists 0:4977187e90c7 78
embeddedartists 0:4977187e90c7 79