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>
101 void reset(
const Gfx::SizeF&, std::size_t stride = 0);
118 const Gfx::Paint& paint,
const Gfx::RectF* rect = 0);
151 static std::vector<FontFace>
fontFaces(
const std::string& family);
154 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.
virtual void onReleaseCanvas() override
Releases the current Canvas.
void reset(const Gfx::SizeF &, std::size_t stride=0)
Resets the bitmap to a new size in physical pixels.
void reset(const Gfx::Image &image)
Replaces the bitmap with an existing image.
static std::vector< FontFace > fontFaces(const std::string &family)
Returns the font faces of a family.
virtual Gfx::Canvas * onCreateCanvas(Gfx::Canvas *reuse) override
Creates a Canvas.
virtual void onFinish() override
Finishes painting to the surface.
void setScaleFactor(double scaleFactor)
Sets the target scale factor.
Bitmap(const Gfx::SizeF &size, std::size_t stride=0)
Constructs a bitmap with the given size and optional stride.
virtual const Gfx::ImageFormat & onGetFormat() const
Returns the image format.
bool empty() const
Returns true if no image data is available.
virtual const Gfx::SizeF & onGetSize() const
Returns the size in physical pixel.
virtual void onSync() override
Synchronizes pending operations to the surface.
virtual const Scaling & onGetScaling() const
Returns the scaling fro logical to physical pixels.
virtual ~Bitmap()
Destroys the bitmap.
static const std::string & defaultFont()
Returns the default font family used by the backend.
static std::vector< std::string > fontFamilies()
Returns the available font families.
static void setDefaultFont(const std::string &family)
Sets the default font family used by the backend.
void reset()
Resets to empty state.
const Gfx::Image & image() const
Returns the underlying image.
Bitmap()
Constructs an empty bitmap.
Backend that executes drawing commands.
Definition Canvas.h:66
PaintSurface()
Default constructor.
const Gfx::SizeF & size() const
Returns the size in physical pixels.
Pen, brush, font and composition mode.
Definition Paint.h:53
Conversion between logical units and pixels.
Definition Scaling.h:52
Graphics and imaging services.
Definition Api-Argb32Image.h:12
Core module.
Definition Allocator.h:33