31 #ifndef PT_GFX_PAINTERBASE_H
32 #define PT_GFX_PAINTERBASE_H
34 #include <Pt/Gfx/Api.h>
35 #include <Pt/Gfx/Size.h>
36 #include <Pt/Gfx/Point.h>
37 #include <Pt/Gfx/Rect.h>
38 #include <Pt/Gfx/Font.h>
39 #include <Pt/Gfx/FontMetrics.h>
40 #include <Pt/Gfx/TextMetrics.h>
41 #include <Pt/Gfx/Pen.h>
42 #include <Pt/Gfx/Brush.h>
43 #include <Pt/Gfx/Scaling.h>
44 #include <Pt/Gfx/Transform.h>
45 #include <Pt/Gfx/Path.h>
46 #include <Pt/Gfx/CompositionMode.h>
47 #include <Pt/Gfx/Paint.h>
49 #include <Pt/NonCopyable.h>
50 #include <Pt/String.h>
196 float degBegin,
float degEnd);
201 float degBegin,
float degEnd);
206 float degBegin,
float degEnd);
294 void onBeginPaint(
Canvas& canvas);
virtual ~PainterBase()
Destructor.
Core module.
Definition: Allocator.h:33
void setBrush(const Brush &brush)
Sets the brush used to fill areas.
void drawPolyline(const PointF *points, const size_t pointCount)
Draws a connected sequence of line segments.
void setClip(const RectF &clip)
Sets the clipping rect.
Paint state used by drawing operations.
Definition: Paint.h:50
void setTransform(const Transform &tx)
Sets the user transform.
void drawRect(const RectF &rect)
Draws the outline of a rectangle.
Attributes for the drawing of outlines.
Definition: Pen.h:54
virtual void onDetachContext(PaintContext &context)
Called when the context is detached.
void drawCircle(const PointF &topLeft, double diameter)
Draws the outline of a circle.
void drawText(const PointF &to, const Pt::String &text)
Draws a line of text at the given position.
void fillCircle(const PointF &topLeft, double diameter)
Fills a circular area.
Backend canvas for drawing commands.
Definition: Canvas.h:66
void resetTransform()
Resets the user transform to identity.
Metrics that describe a font face at a given size.
Definition: FontMetrics.h:46
const CompositionMode & compositionMode() const
Returns the current composition mode.
void fillChord(const PointF &topLeft, const SizeF &size, float degBegin, float degEnd)
Fills a chord on an ellipse.
void fillRect(const RectF &rect)
Fills a rectangular area.
void finish()
Ends the current painting operation.
void drawLine(const PointF &from, const PointF &to)
Draws a line between two points.
const Scaling & scaling() const
Returns the logical-to-physical scaling of the target.
const Brush & brush() const
Returns the current brush.
void setCompositionMode(const CompositionMode &mode)
Sets the composition mode.
void fillPolygon(const PointF *points, const size_t pointCount)
Fills a polygon defined by the given points.
Active painting session for a surface.
Definition: PaintContext.h:52
Blend mode used for drawing operations.
Definition: CompositionMode.h:47
void drawImage(const PointF &to, const Image &im)
Draws an image.
const Paint & paint() const
Returns the current paint state.
void setPen(const Pen &pen)
Sets the pen used to stroke lines.
Base class for drawing commands and paint state.
Definition: PainterBase.h:73
void drawBitmap(const PointF &to, const Bitmap &bm, const RectF &rect)
Draws a rectangular part of a bitmap.
Logical-to-physical unit conversion.
Definition: Scaling.h:49
const RectF * clip() const
Returns the current clip rectangle or null if clipping is disabled.
Size with floating-point width and height.
Definition: Size.h:45
void fillPie(const PointF &topLeft, const SizeF &size, float degBegin, float degEnd)
Fills a pie segment on an ellipse.
const Transform & transform() const
Returns the user transform.
Point with floating-point X and Y coordinates.
Definition: Point.h:45
const ImageFormat & format() const
Returns the pixel format of the current target.
void beginPaint(PaintContext &context)
Begins painting to a paint context.
Metrics for a measured line of text.
Definition: TextMetrics.h:46
const Font & font() const
Returns the current font.
void setFont(const Font &font)
Sets the font used to draw text.
Abstract target for drawing operations.
Definition: PaintSurface.h:55
const Pen & pen() const
Returns the current pen.
Vector path for drawing outlines and filled shapes.
Definition: Path.h:61
void beginPaint(PaintSurface &surface)
Begins painting to a paint surface.
void setPath(const Path &path)
Sets the current path.
Canvas * canvas() const
Returns the current canvas or null.
void drawText(const PointF &to, const Pt::String &text, const Transform &t)
Draws a line of text using an additional text transform.
void resetClip()
Resets the clipping rect.
void drawArc(const PointF &topLeft, const SizeF &size, float degBegin, float degEnd)
Draws an arc on an ellipse.
Font request used for text drawing and measurement.
Definition: Font.h:56
void drawPath(const Path &path)
Draws the given path.
Basic image.
Definition: Image.h:52
void fillEllipse(const PointF &topLeft, const SizeF &size)
Fills an elliptical area.
void fillPath(const Path &path)
Fills the given path.
void drawPath()
Draws the current path.
TextMetrics textMetrics(const Pt::String &text) const
Measures a line of text using the current font.
void drawImage(const PointF &to, const Image &im, const RectF &rect)
Draws a rectangular part of an image.
Unicode capable basic_string.
Definition: Api-String.h:44
Protects derived classes from being copied.
Definition: NonCopyable.h:54
void fillPath()
Fills the current path.
void drawEllipse(const PointF &topLeft, const SizeF &size)
Draws the outline of an ellipse.
Fill description for shapes and text.
Definition: Brush.h:145
Rect with floating-point coordinates.
Definition: Rect.h:45
Off-screen drawing surface backed by an image.
Definition: Bitmap.h:60
PainterBase()
Default constructor.
const Gfx::Path & path() const
Returns the current path.
void drawBitmap(const PointF &to, const Bitmap &bm)
Draws a bitmap.
const FontMetrics & fontMetrics() const
Returns the font metrics of the current font.
virtual void onDetachSurface(PaintSurface &surface)
Called when the surface is detached.