- Main Page
- Classes
- Files

- File List

# C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.40/Woopsi/libwoopsi/include/graphics.h

    00001 #ifndef _GRAPHICS_H_
    00002 #define _GRAPHICS_H_
    00003
    00004 #include <nds.h>
    00005 #include "woopsiarray.h"
    00006 #include "bitmapbase.h"
    00007 #include "mutablebitmapbase.h"
    00008 #include "graphicsunclipped.h"
    00009
    00010 namespace WoopsiUI {
    00011
    00012         class FontBase;
    00013
    00018         class Graphics : public GraphicsUnclipped {
    00019         public:
    00020
    00025                 Graphics(MutableBitmapBase* bitmap);
    00026
    00030                 virtual inline ~Graphics() { };
    00031
    00038                 const u16 getPixel(s16 x, s16 y) const;
    00039
    00046                 virtual void drawPixel(s16 x, s16 y, u16 colour);
    00047
    00056                 virtual void drawFilledRect(s16 x, s16 y, u16 width, u16 height, u16 colour);
    00057
    00065                 virtual void drawHorizLine(s16 x, s16 y, u16 width, u16 colour);
    00066
    00074                 virtual void drawVertLine(s16 x, s16 y, u16 height, u16 colour);
    00075
    00081                 virtual void drawXORPixel(s16 x, s16 y);
    00082
    00089                 virtual void drawXORHorizLine(s16 x, s16 y, u16 width);
    00090
    00097                 virtual void drawXORVertLine(s16 x, s16 y, u16 height);
    00098
    00109                 virtual void drawBitmap(s16 x, s16 y, u16 width, u16 height, const BitmapBase* bitmap, s16 bitmapX, s16  bitmapY);
    00110
    00124                 virtual void drawBitmap(s16 x, s16 y, u16 width, u16 height, const BitmapBase* bitmap, s16 bitmapX, s16 bitmapY, u16 transparentColour);
    00125
    00132                 virtual void floodFill(s16 x, s16 y, u16 newColour);
    00133
    00148                 void copy(s16 sourceX, s16 sourceY, s16 destX, s16 destY, u16 width, u16 height);
    00149
    00157                 void dim(s16 x, s16 y, u16 width, u16 height);
    00158
    00167                 virtual void drawLine(s16 x1, s16 y1, s16 x2, s16 y2, u16 colour);
    00168
    00169         protected:
    00170
    00178                 bool clipBitmapCoordinates(s16* x, s16* y, u16* width, u16* height);
    00179
    00187                 bool popStack(s16* x, s16* y, WoopsiArray<s32>* stack);
    00188
    00195                 void pushStack(s16 x, s16 y, WoopsiArray<s32>* stack);
    00196
    00207                 u8 getClipLineOutCode(s16 x, s16 y, s16 xMin, s16 yMin, s16 xMax, s16 yMax);
    00208
    00212                 inline Graphics(const Graphics& graphics) : GraphicsUnclipped(graphics) { };
    00213         };
    00214 }
    00215
    00216 #endif