Chris Taylor / Mbed 2 deprecated RETRO-CityRally

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Bitmap2bpp.h Source File

Bitmap2bpp.h

00001 #ifndef __BITMAP2BPP_H__
00002 #define __BITMAP2BPP_H__
00003 
00004 class Bitmap2bpp
00005 {
00006     public:
00007         Bitmap2bpp(const uint8_t *bitmap);
00008         Bitmap2bpp(uint16_t width, uint16_t height);
00009         ~Bitmap2bpp();
00010         
00011         inline uint16_t getWidth() { return _width; }
00012         inline uint16_t getHeight() { return _height; }
00013         inline uint16_t getStride() { return _stride; }
00014         
00015         inline uint8_t *getBitmapData() { return _pBitmapData; }
00016         
00017         void clear();
00018         
00019         void setPixel(int16_t x, int16_t y, uint16_t color);
00020         void fastHLine(int16_t x1, int16_t x2, int16_t y, uint16_t color);
00021         void fastVLine(int16_t y1, int16_t y2, int16_t x, uint16_t color);
00022         void drawBitmap(int16_t x, int16_t y, Bitmap2bpp &bmp, uint16_t srcX, uint16_t srcY, uint16_t srcWidth, uint16_t srcHeight, bool transparent);
00023         
00024                 
00025     private:
00026         uint16_t    _width;
00027         uint16_t    _height;
00028         uint16_t    _stride;
00029         uint8_t     *_pBitmapData;
00030 };
00031 
00032 #endif //__BITMAP2BPP_H__