13#ifndef EXTENSION_INTERNAL_PDFOUTPUT_BUILD_DRAWING_H
14#define EXTENSION_INTERNAL_PDFOUTPUT_BUILD_DRAWING_H
41 SPStyle const *context_style =
nullptr);
47 std::optional<CapyPDF_TransparencyGroupId> soft_mask = {});
54 void start_ocg(CapyPDF_OptionalContentGroupId ocgid);
65 std::optional<double>
get_softmask(
double opacity)
const;
3x3 matrix representing an affine transformation.
Axis-aligned rectangle that can be empty.
Sequence of contiguous curves, aka spline.
Axis aligned, non-empty rectangle.
void paint_group(CapyPDF_TransparencyGroupId child_id, SPStyle const *style=nullptr, Geom::Affine const &tr=Geom::identity(), std::optional< CapyPDF_TransparencyGroupId > soft_mask={})
Paint a child group at the requested location.
void paint_item_to_raster(SPItem const *item, Geom::Affine const &tr, double resolution, bool antialias)
Draw an item as a bitmap and return.
void set_matrix(Geom::Affine const &affine)
Set the transformation matrix for this context Group.
std::optional< double > get_softmask(double opacity) const
void paint_raster(SPImage const *image)
Draw the raster data stored in URI into the PDF context.
void paint_item_clone(SPUse const *use, SPStyle const *context_style)
Paint the given clone object, finding or generating a transparency group from it.
bool set_shape_rectangle(Geom::Rect const &rect)
void clip_text_layout(Text::Layout const &layout)
Use the text object as a clipping mask in the PDF.
void set_shape_path(Geom::Path const &path)
void start_ocg(CapyPDF_OptionalContentGroupId ocgid)
void set_clip_rectangle(Geom::OptRect const &rect)
Apply the clipping rectangle with a NONZERO fill rule.
bool set_shape_pathvector(Geom::PathVector const &pathv)
DrawContext(Document &doc, capypdf::DrawContext ctx, bool soft_mask)
void set_clip_path(std::optional< Geom::PathVector > clip, SPStyle *style=nullptr)
Apply the clip path to the existing context.
capypdf::DrawContext _ctx
Document & get_document()
bool set_shape(SPShape const *shape)
void paint_item(SPItem const *item, Geom::Affine const &tr=Geom::identity(), SPStyle const *context_style=nullptr)
Paint the given object into the given context, making groups if needed.
void paint_shape(SPShape const *shape, SPStyle const *context_style)
Paint a single shape path.
void set_paint_style(StyleMap const &map, SPStyle const *style, SPStyle const *context_style)
Set the style for drawing shapes from the SVG style, this is all the styles that relate to how vector...
void paint_text_layout(Text::Layout const &layout, SPStyle const *context_style)
Paint the given layout into the PDF document Drawing content.
void transform(Geom::Affine const &affine)
Add a transform to the current context stream.
void paint_item_group(SPGroup const *group, SPStyle const *context_style)
ItemCacheKey cache_key() const
Generates the layout for either wrapped or non-wrapped text and stores the result.
Base class for visual SVG elements.
Base class for shapes, including <path> element.
std::unordered_map< std::string, std::unique_ptr< SPDocument > > map
std::unique_ptr< Magick::Image > image
Affine identity()
Create an identity matrix.
std::tuple< std::string, std::string, std::string > ItemCacheKey
std::map< SPAttr, std::string > StyleMap
static T clip(T const &v, T const &a, T const &b)