Graphical demo for the LPC4088 Experiment Base Board with one of the Display Expansion Kits. This program decodes decodes and shows two png images.
PictureDemo.h@0:b567d56a59d7, 2014-10-03 (annotated)
- Committer:
- embeddedartists
- Date:
- Fri Oct 03 13:30:09 2014 +0000
- Revision:
- 0:b567d56a59d7
First version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 0:b567d56a59d7 | 1 | |
embeddedartists | 0:b567d56a59d7 | 2 | #ifndef PICTUREDEMO_H |
embeddedartists | 0:b567d56a59d7 | 3 | #define PICTUREDEMO_H |
embeddedartists | 0:b567d56a59d7 | 4 | |
embeddedartists | 0:b567d56a59d7 | 5 | #include "EaLcdBoardGPIO.h" |
embeddedartists | 0:b567d56a59d7 | 6 | |
embeddedartists | 0:b567d56a59d7 | 7 | class PictureDemo { |
embeddedartists | 0:b567d56a59d7 | 8 | public: |
embeddedartists | 0:b567d56a59d7 | 9 | |
embeddedartists | 0:b567d56a59d7 | 10 | |
embeddedartists | 0:b567d56a59d7 | 11 | /** Set the address of the frame buffer to use. |
embeddedartists | 0:b567d56a59d7 | 12 | * |
embeddedartists | 0:b567d56a59d7 | 13 | * It is the content of the frame buffer that is shown on the |
embeddedartists | 0:b567d56a59d7 | 14 | * display. All the drawing on the frame buffer can be done |
embeddedartists | 0:b567d56a59d7 | 15 | * 'offline' and whenever it should be shown this function |
embeddedartists | 0:b567d56a59d7 | 16 | * can be called with the address of the offline frame buffer. |
embeddedartists | 0:b567d56a59d7 | 17 | * |
embeddedartists | 0:b567d56a59d7 | 18 | * @param pFrameBuf Pointer to the frame buffer, which must be |
embeddedartists | 0:b567d56a59d7 | 19 | * 3 times as big as the frame size (for tripple |
embeddedartists | 0:b567d56a59d7 | 20 | * buffering). |
embeddedartists | 0:b567d56a59d7 | 21 | * dispWidth The width of the display (in pixels). |
embeddedartists | 0:b567d56a59d7 | 22 | * dispHeight The height of the display (in pixels). |
embeddedartists | 0:b567d56a59d7 | 23 | * loops Number of loops in the demo code. |
embeddedartists | 0:b567d56a59d7 | 24 | * delayMs Delay in milliseconds between schreen updates. |
embeddedartists | 0:b567d56a59d7 | 25 | * |
embeddedartists | 0:b567d56a59d7 | 26 | * @returns |
embeddedartists | 0:b567d56a59d7 | 27 | * none |
embeddedartists | 0:b567d56a59d7 | 28 | */ |
embeddedartists | 0:b567d56a59d7 | 29 | PictureDemo(uint8_t *pFrameBuf, uint16_t dispWidth, uint16_t dispHeight); |
embeddedartists | 0:b567d56a59d7 | 30 | |
embeddedartists | 0:b567d56a59d7 | 31 | void run(EaLcdBoardGPIO& lcdBoard, int image, uint32_t delayMs); |
embeddedartists | 0:b567d56a59d7 | 32 | |
embeddedartists | 0:b567d56a59d7 | 33 | private: |
embeddedartists | 0:b567d56a59d7 | 34 | int32_t windowX; |
embeddedartists | 0:b567d56a59d7 | 35 | int32_t windowY; |
embeddedartists | 0:b567d56a59d7 | 36 | uint16_t *pFrmBuf; |
embeddedartists | 0:b567d56a59d7 | 37 | uint16_t *pFrmBuf1; |
embeddedartists | 0:b567d56a59d7 | 38 | uint16_t *pFrmBuf2; |
embeddedartists | 0:b567d56a59d7 | 39 | uint16_t *pFrmBuf3; |
embeddedartists | 0:b567d56a59d7 | 40 | |
embeddedartists | 0:b567d56a59d7 | 41 | void drawCentered(const unsigned char* pData, int size, uint32_t delayMs); |
embeddedartists | 0:b567d56a59d7 | 42 | }; |
embeddedartists | 0:b567d56a59d7 | 43 | |
embeddedartists | 0:b567d56a59d7 | 44 | #endif /* PICTUREDEMO_H */ |
embeddedartists | 0:b567d56a59d7 | 45 |