30 #ifndef PT_GFX_IMAGEPAINTER_H
31 #define PT_GFX_IMAGEPAINTER_H
33 #include <Pt/Gfx/Api.h>
34 #include <Pt/Gfx/Painter.h>
35 #include <Pt/Gfx/Rect.h>
36 #include <Pt/System/Path.h>
44 class PT_GFX_API ImagePainter :
public Painter
47 ImagePainter( Image& image );
49 virtual ~ImagePainter();
51 void setImage(Image& image);
53 virtual const ImageFormat& format()
const;
55 virtual void setCompositionMode(
const CompositionMode& mode);
57 virtual const CompositionMode& compositionMode()
const;
59 virtual void setClip(
const RectF& clip );
61 virtual void setPen(
const Pen& pen);
63 virtual const Pen& pen()
const;
65 virtual void setBrush(
const Brush& brush);
67 virtual const Brush& brush()
const;
69 virtual void setFont(
const Font& font);
71 virtual const Font& font()
const;
73 virtual FontMetrics fontMetrics(
const Pt::String& text)
const;
75 virtual void drawLine(
const PointF& from,
const PointF& to);
77 virtual void drawText(
const PointF& to,
const Pt::String& text );
79 virtual void drawRect(
const RectF& rect);
81 virtual void fillRect(
const RectF& rect);
83 virtual void drawEllipse(
const PointF& topLeft,
const SizeF& size);
85 virtual void fillEllipse(
const PointF& topLeft,
const SizeF& size);
87 virtual void drawPolyline(
const PointF* points,
const size_t pointCount);
89 virtual void fillPolygon(
const PointF* points,
const size_t pointCount);
91 virtual void drawImage(
const PointF& to,
const Image& image);
93 virtual void drawImage(
const PointF& to,
const Image& image,
const RectF& imageRect);
96 static void setFontDir(
const System::Path& path);
98 static std::string defaultFont();
100 static void setDefaultFont(
const std::string& name);
102 static std::vector<std::string> fontNames();
104 static FontMetrics fontMetrics(
const Font& font,
const Pt::String& text );
107 Rasterizer* _rasterizer;
Unicode capable basic_string.
Definition: String.h:42