13 #include "Rectangle.h"
28 Color(
unsigned int rgba = 0 )
31 Color(
unsigned char red,
unsigned char green,
unsigned char blue,
unsigned char alpha = 255 )
32 : r(red), g(green), b(blue), a(alpha)
47 virtual int getWidth()
const = 0;
48 virtual int getHeight()
const = 0;
50 virtual bool setColorCorrection(
int Brightness,
int Contrast )
52 brightness_ = Brightness;
58 static Image* createImageFromRGBA(
size_t w,
size_t h,
const unsigned char* data );
60 int brightness()
const {
return brightness_; }
61 int contrast()
const {
return contrast_; }
70 enum FONT_STYLE { Regular = 0, Bold = 1, Italic = 2, BoldItalic = 3 };
71 enum HORZ_ALIGN { Left, Center, Right };
72 enum VERT_ALIGN { Top, Middle, BaseLine, Bottom };
76 : a(a), b(b), c(c), d(d), x(x), y(y)
91 virtual bool drawImage(
const Image* img,
int x,
int y,
int width,
int height) = 0;
92 virtual void drawLine(
int x1,
int y1,
int x2,
int y2) = 0;
93 virtual void setColor(
Color c) = 0;
94 virtual void drawRect(
int x,
int y,
int width,
int height) = 0;
95 virtual void fillRect(
int x,
int y,
int width,
int height) = 0;
96 virtual void drawEllipse(
int x,
int y,
int width,
int height) = 0;
97 virtual void fillEllipse(
int x,
int y,
int width,
int height) = 0;
98 virtual void drawPolyline(
const std::vector<int>& xCoords,
const std::vector<int>& yCoords,
int count ) = 0;
99 virtual void drawPolyline(
const std::vector<Point2>& points ) = 0;
100 virtual void fillPolygon(
const std::vector<int>& xCoords,
const std::vector<int>& yCoords,
int count ) = 0;
101 virtual void fillPolygon(
const std::vector<Point2>& points ) = 0;
103 virtual float getStrokeWidth()
const = 0;
104 virtual void setStrokeWidth(
float strokeWidth ) = 0;
106 virtual void setFont(
const char* fontName,
float fontSize, FONT_STYLE fontStyle ) = 0;
107 virtual float fontAscent()
const = 0;
108 virtual float fontDescent()
const = 0;
109 virtual Point2 measureText(
const std::string& text ) = 0;
110 virtual Rectangle2 drawString(
const std::string& text,
float x,
float y, HORZ_ALIGN horzAlign = Left, VERT_ALIGN vertAlign = BaseLine ) = 0;
112 virtual void pushState() = 0;
113 virtual void popState() = 0;
114 virtual void setTransform2Identity() = 0;
115 virtual void setTransform2( Transform2Matrix matrix ) = 0;
116 virtual Transform2Matrix getTransform2() = 0;
117 virtual void multiplyTransform2( Transform2Matrix matrix ) = 0;
118 virtual void scaleTransform2(
float sx,
float sy ) = 0;
119 virtual void rotateTransform2(
float angle ) = 0;
120 virtual void translateTransform2(
float dx,
float dy ) = 0;
126 enum SHAPE { Arrow, Finger, Move, Moving };
127 virtual void setShape( SHAPE Shape ) = 0;