31 #ifndef PT_GFX_IMAGEPAINTER_2_H
32 #define PT_GFX_IMAGEPAINTER_2_H
34 #include <Pt/Gfx/Painter.h>
35 #include <Pt/Gfx/Transform.h>
36 #include <Pt/Gfx/Path.h>
37 #include <Pt/System/Path.h>
45 class PT_GFX_API ImagePainter2 :
public Painter
48 ImagePainter2(Image& image);
50 virtual ~ImagePainter2();
52 void setImage(Image& image);
54 virtual const ImageFormat& format()
const;
56 virtual bool isAntiAliasing()
const;
58 virtual void setAntiAliasing(
bool on);
60 virtual const CompositionMode& compositionMode()
const;
62 virtual void setCompositionMode(
const CompositionMode& mode);
64 virtual void setClip(
const RectF& clip);
66 virtual const Pen& pen()
const;
68 virtual void setPen(
const Pen& pen);
70 virtual const Brush& brush()
const;
72 virtual void setBrush(
const Brush& brush);
74 virtual const Font& font()
const;
76 virtual void setFont(
const Font& font);
78 virtual void drawImage(
const PointF& to,
const Image& image);
80 virtual void drawImage(
const PointF& to,
const Image& image,
const RectF& imageRect);
82 virtual void drawText(
const PointF& to,
const Pt::String& text);
84 void drawText(
const PointF& to,
const Pt::String& text,
const Transform& t);
86 virtual FontMetrics fontMetrics(
const Pt::String& text)
const;
88 static FontMetrics fontMetrics(
const Font& font,
const Pt::String& text);
90 virtual void drawLine(
const PointF& from,
const PointF& to);
92 virtual void drawRect(
const RectF& rect);
94 virtual void drawRoundedRect(
const RectF& rect,
float radius);
97 virtual void drawPolyline(
const PointF* points,
const size_t pointCount);
100 virtual void drawArc(
const PointF& topLeft,
const SizeF& size,
101 float degBegin,
float degEnd);
104 virtual void drawChord(
const PointF& topLeft,
const SizeF& size,
105 float degBegin,
float degEnd);
108 virtual void drawPie(
const PointF& topLeft,
const SizeF& size,
109 float degBegin,
float degEnd);
111 virtual void drawEllipse(
const PointF& topLeft,
const SizeF& size);
114 virtual void drawPath(
const Path& path,
float smoothness = 1.0f);
116 virtual void fillRect(
const RectF& rect);
118 virtual void fillRoundedRect(
const RectF& rect,
float radius);
120 virtual void fillPolygon(
const PointF* points,
const size_t pointCount);
122 virtual void fillEllipse(
const PointF& topLeft,
const SizeF& size);
124 virtual void fillPie(
const PointF& topLeft,
const SizeF& size,
125 float degBegin,
float degEnd);
127 virtual void fillChord(
const PointF& topLeft,
const SizeF& size,
128 float degBegin,
float degEnd);
131 virtual void fillPath(
const Path& path,
float smoothness = 1.0f);
134 static void setFontDir(
const System::Path& path);
136 static void setDefaultFont(
const std::string& name);
138 static std::string defaultFont();
140 static std::vector<std::string> fontNames();
149 Rasterizer2* _rasterizer;
Unicode capable basic_string.
Definition: String.h:42