30 #ifndef PT_GFX_BITMAP_H
31 #define PT_GFX_BITMAP_H
33 #include <Pt/Gfx/Api.h>
34 #include <Pt/Gfx/FontFace.h>
35 #include <Pt/Gfx/PaintSurface.h>
36 #include <Pt/Gfx/Paint.h>
37 #include <Pt/Gfx/Point.h>
38 #include <Pt/Gfx/Size.h>
39 #include <Pt/Gfx/Rect.h>
40 #include <Pt/System/Path.h>
134 static std::vector<FontFace>
fontFaces(
const std::string& family);
137 BitmapSurface* _surface;
void drawBitmap(const Pt::Gfx::PointF &to, const Bitmap &image, const Gfx::Paint &paint, const Gfx::RectF *rect=0)
Draws another bitmap into this bitmap.
Core module.
Definition: Allocator.h:33
virtual Gfx::Canvas * onCreateCanvas(Gfx::Canvas *reuse) override
Creates a Canvas.
Paint state used by drawing operations.
Definition: Paint.h:50
void reset()
Resets to empty state.
static std::vector< FontFace > fontFaces(const std::string &family)
Returns the font faces of a family.
Backend canvas for drawing commands.
Definition: Canvas.h:66
static void setDefaultFont(const std::string &family)
Sets the default font family used by the backend.
virtual void onReleaseCanvas() override
Releases the current Canvas.
Logical-to-physical unit conversion.
Definition: Scaling.h:49
bool empty() const
Returns true if no image data is available.
Size with floating-point width and height.
Definition: Size.h:45
Point with floating-point X and Y coordinates.
Definition: Point.h:45
virtual const Gfx::ImageFormat & onGetFormat() const
Returns the image format.
void reset(const Gfx::Image &image)
Replaces the bitmap with an existing image.
Abstract target for drawing operations.
Definition: PaintSurface.h:55
static const std::string & defaultFont()
Returns the default font family used by the backend.
void reset(const Gfx::SizeF &, std::size_t stride=0)
Resets the bitmap to a new size in physical pixels.
virtual const Scaling & onGetScaling() const
Returns the scaling fro logical to physical pixels.
virtual ~Bitmap()
Destroys the bitmap.
Basic image.
Definition: Image.h:52
virtual void onFinish() override
Finishes painting to the surface.
void setScaleFactor(double scaleFactor)
Sets the target scale factor.
Bitmap()
Constructs an empty bitmap.
virtual const Gfx::SizeF & onGetSize() const
Returns the size in physical pixel.
virtual void onSync() override
Synchronizes pending operations to the surface.
Rect with floating-point coordinates.
Definition: Rect.h:45
Off-screen drawing surface backed by an image.
Definition: Bitmap.h:60
Bitmap(const Gfx::SizeF &size, std::size_t stride=0)
Constructs a bitmap with the given size and optional stride.
const Gfx::Image & image() const
Returns the underlying image.
static std::vector< std::string > fontFamilies()
Returns the available font families.