EmbeddedArtists AB / Mbed 2 deprecated app_lcdboard_demo_globe

Dependencies:   EALib mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GlobeDemo.h Source File

GlobeDemo.h

00001 
00002 #ifndef GLOBEDEMO_H
00003 #define GLOBEDEMO_H
00004 
00005 #include "Graphics.h"
00006 #include "GFXFb.h"
00007 
00008 class GlobeDemo {
00009 public:
00010 
00011     /** Set the address of the frame buffer to use.
00012      *
00013      *  It is the content of the frame buffer that is shown on the
00014      *  display. All the drawing on the frame buffer can be done
00015      *  'offline' and whenever it should be shown this function
00016      *  can be called with the address of the offline frame buffer.
00017      *
00018      *  @param pFrameBuf  Pointer to the frame buffer, which must be
00019      *                    3 times as big as the frame size (for tripple
00020      *                    buffering).
00021      *         dispWidth  The width of the display (in pixels).
00022      *         dispHeight The height of the display (in pixels).
00023      *         loops      Number of loops in the demo code.
00024      *         delayMs    Delay in milliseconds between schreen updates.
00025      *
00026      *  @returns
00027      *       none
00028      */
00029     GlobeDemo(uint8_t *pFrameBuf, uint16_t dispWidth, uint16_t dispHeight);
00030     
00031     void run(uint32_t loops, uint32_t delayMs);
00032 
00033 private:
00034     enum Constants {
00035         BACKGROUND_COLOR         = BLACK,
00036         LARGE_CIRCLE_COLOR       = 0x39e7, //DARK_GRAY
00037         SMALL_CIRCLE_FRONT_COLOR = WHITE,
00038         SMALL_CIRCLE_BACK_COLOR  = 0x7bef, //LIGHT_GRAY
00039     };
00040 
00041     int32_t windowX;
00042     int32_t windowY;
00043     uint16_t *pFrmBuf;
00044     uint16_t *pFrmBuf1;
00045     uint16_t *pFrmBuf2;
00046     uint16_t *pFrmBuf3;
00047     
00048     Graphics graphics;
00049     
00050     unsigned short isqrt(unsigned long a) const;
00051     short _sin(short y) const;
00052     short _cos(short y) const;
00053     short isine(short x) const;
00054     short icosine(short x) const;
00055     void rotate_z(uint32_t angle);
00056     void rotate_y(uint32_t angle);
00057     void initialize();
00058     void render(uint32_t idx);
00059 
00060 };
00061 
00062 #endif /* GLOBEDEMO_H */
00063