00001
00002
00003
00004 #ifndef _XVDRAWABLE_H_
00005 #define _XVDRAWABLE_H_
00006
00007 #include <XVImageBase.h>
00008 #include <stdio.h>
00009
00010
00011 #define DEFAULT_COLOR "red"
00012
00013 typedef char * DrawColor;
00014
00015 class XVDrawable {
00016
00017 public:
00018
00019 inline bool drawPoint(XVPosition p, DrawColor c = DEFAULT_COLOR){
00020 return this->drawPoint(p.PosX(), p.PosY());
00021 };
00022
00023 inline virtual bool drawPoint(int x, int y, DrawColor c = DEFAULT_COLOR) = 0;
00024
00025 inline bool drawLine(XVPosition p1, XVPosition p2, DrawColor c = DEFAULT_COLOR){
00026 return this->drawLine(p1.PosX(), p1.PosY(), p2.PosX(), p2.PosY(), c);
00027 };
00028
00029 inline virtual bool drawLine(int x1, int y1, int x2, int y2, DrawColor c = DEFAULT_COLOR) = 0;
00030
00031 inline bool drawRectangle(XVImageGeneric rect, DrawColor c = DEFAULT_COLOR){
00032 return this->drawRectangle(rect.PosX(), rect.PosY(), rect.Width(), rect.Height(), c);
00033 };
00034
00035 inline bool drawRectangle(XVPosition p, XVSize s, DrawColor c = DEFAULT_COLOR){
00036 return this->drawRectangle(p.PosX(), p.PosY(), s.Width(), s.Height(), c);
00037 };
00038
00039 inline virtual bool drawRectangle(int x, int y, int w, int h, DrawColor c = DEFAULT_COLOR) = 0;
00040
00041 inline bool fillRectangle(XVImageGeneric rect, DrawColor c = DEFAULT_COLOR){
00042 return this->fillRectangle(rect.PosX(), rect.PosY(), rect.Width(), rect.Height(), c);
00043 };
00044
00045 inline bool fillRectangle(XVPosition p, XVSize s, DrawColor c = DEFAULT_COLOR){
00046 return this->fillRectangle(p.PosX(), p.PosY(), s.Width(), s.Height(), c);
00047 };
00048
00049 inline virtual bool fillRectangle(int x, int y, int w, int h, DrawColor c = DEFAULT_COLOR) = 0;
00050
00051 inline bool drawEllipse(XVImageGeneric rect, DrawColor c = DEFAULT_COLOR){
00052 return this->drawEllipse(rect.PosX(), rect.PosY(), rect.Width(), rect.Height(), c);
00053 };
00054
00055 inline bool drawEllipse(XVPosition p, XVSize s, DrawColor c = DEFAULT_COLOR){
00056 return this->drawEllipse(p.PosX(), p.PosY(), s.Width(), s.Height(), c);
00057 };
00058
00059 inline virtual bool drawEllipse(int x, int y, int w, int h, DrawColor c = DEFAULT_COLOR) = 0;
00060
00061
00062 inline bool fillEllipse(XVImageGeneric rect, DrawColor c = DEFAULT_COLOR){
00063 return this->fillEllipse(rect.PosX(), rect.PosY(), rect.Width(), rect.Height(), c);
00064 };
00065
00066 inline bool fillEllipse(XVPosition p, XVSize s, DrawColor c = DEFAULT_COLOR){
00067 return this->fillEllipse(p.PosX(), p.PosY(), s.Width(), s.Height(), c);
00068 };
00069
00070 inline virtual bool fillEllipse(int x, int y, int w, int h, DrawColor c = DEFAULT_COLOR) = 0;
00071
00072 inline bool drawString(XVPosition p, char * string, int length, DrawColor c = DEFAULT_COLOR){
00073 return this->drawString(p.PosX(), p.PosY(), string, length, c);
00074 };
00075
00076 inline virtual bool drawString(int x, int y, char * string, int length, DrawColor c = DEFAULT_COLOR) = 0;
00077
00078 inline virtual DrawColor addColor(DrawColor) = 0;
00079 inline virtual void setXOR() = 0;
00080 inline virtual void setCOPY() = 0;
00081 };
00082
00083 #endif