2#ifndef EXTENSION_INTERNAL_CAIRO_RENDER_CONTEXT_H_SEEN
3#define EXTENSION_INTERNAL_CAIRO_RENDER_CONTEXT_H_SEEN
37namespace Extension::Internal {
40class CairoRenderContext;
41struct CairoRenderState;
97 bool finish(
bool finish_surface =
true);
145 void popLayer(cairo_operator_t composite = CAIRO_OPERATOR_CLEAR);
177 std::vector<CairoGlyphInfo>
const &glyphtext,
SPStyle const *style,
178 bool second_pass =
false);
216 cairo_surface_type_t
_target = CAIRO_SURFACE_TYPE_IMAGE;
260 template <cairo_surface_type_t type>
3x3 affine transformation matrix.
struct _PangoFont PangoFont
struct _PangoLayout PangoLayout
Cairo::RefPtr< Cairo::ImageSurface > surface
3x3 matrix representing an affine transformation.
Axis-aligned rectangle that can be empty.
void newPage()
On targets supporting multiple pages, sends subsequent rendering to a new page.
bool setPdfTarget(gchar const *utf8_fn)
bool setPsTarget(gchar const *utf8_fn)
void setPathVector(Geom::PathVector const &pv)
CairoRenderMode getRenderMode() const
std::vector< CairoRenderState > _state_stack
CairoRenderer * _renderer
CairoClipMode getClipMode() const
Geom::Affine getItemTransform() const
bool _finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t *ctm=nullptr)
unsigned getBitmapResolution()
OmitTextPageState _omittext_state
void _prepareRenderText()
void setPSLevel(unsigned int level)
CairoRenderContext(CairoRenderContext const &other)=delete
void setPDFLevel(unsigned int level)
cairo_pattern_t * _createPatternPainter(SPPaintServer const *const paintserver, Geom::OptRect const &pbox)
unsigned int _showGlyphs(cairo_t *cr, PangoFont *font, std::vector< CairoGlyphInfo > const &glyphtext, bool is_stroke)
void addClipPath(Geom::PathVector const &pv, SPIEnum< SPWindRule > const *fill_rule)
CairoRenderMode _render_mode
void setFilterToBitmap(bool filtertobitmap)
bool saveAsPng(const char *file_name)
Saves the contents of the context to a PNG file.
bool _setVectorTarget(gchar const *utf8_fn)
struct Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata _metadata
void setTransform(Geom::Affine const &transform)
void setMetadata(SPDocument const &document)
Extract metadata from the document and store it in the context.
CairoRenderer * getRenderer() const
void setOmitText(bool omittext)
std::map< gpointer, cairo_font_face_t * > _font_table
void setTextToPath(bool texttopath)
Geom::Affine getParentTransform() const
cairo_pattern_t * _createPatternForPaintServer(SPPaintServer const *const paintserver, Geom::OptRect const &pbox, float alpha)
bool renderPathVector(Geom::PathVector const &pathv, SPStyle const *style, Geom::OptRect const &pbox, CairoPaintOrder order=STROKE_OVER_FILL)
bool renderGlyphtext(PangoFont *font, Geom::Affine const &font_matrix, std::vector< CairoGlyphInfo > const &glyphtext, SPStyle const *style, bool second_pass=false)
Called by Layout-TNG-Output, this function decides how to apply styles and write out the final shapes...
bool finish(bool finish_surface=true)
const CairoRenderState * getParentState() const
void setStateForItem(SPItem const *item)
cairo_surface_type_t _target
Geom::Affine getTransform() const
bool renderImage(Inkscape::Pixbuf const *pb, Geom::Affine const &image_transform, SPStyle const *style)
CairoRenderContext createSimilar(double width, double height) const
Creates a new render context which will be compatible with the given context's Cairo surface.
cairo_format_t _target_format
CairoRenderState * _addState()
CairoRenderContext & operator=(CairoRenderContext const &other)=delete
cairo_surface_t * _surface
void destBegin(const char *link)
void setBitmapResolution(unsigned resolution)
unsigned int _clip_winding_failed
void _setSurfaceMetadata(cairo_surface_t *surface)
void _concatTransform(cairo_t *cr, Geom::Affine const &transform)
bool setSurfaceTarget(cairo_surface_t *surface, bool is_vector, cairo_matrix_t *ctm=nullptr)
Set the cairo_surface_t from an external source.
const CairoRenderState * getCurrentState() const
bool setImageTarget(cairo_format_t format)
bool nextPage(double width, double height, char const *label)
When writing multiple pages, resize the next page.
unsigned int _vector_based_target
void setClipMode(CairoClipMode mode)
void _prepareRenderGraphic()
void _setStrokeStyle(SPStyle const *style, Geom::OptRect const &pbox)
void transform(Geom::Affine const &transform)
bool finishPage()
Each page that's made should call finishPage to complete it.
void tagBegin(const char *link)
void setStateMergeOpacity(bool state_merge_opacity)
void _concatTransform(cairo_t *cr, double xx, double yx, double xy, double yy, double x0, double y0)
void setRenderMode(CairoRenderMode mode)
void setItemTransform(Geom::Affine const &transform)
void setStateForStyle(SPStyle const *style)
bool setupSurface(double width, double height)
Creates the cairo_surface_t for the context with the given width, height and with the currently set t...
void addClippingRect(double x, double y, double width, double height)
cairo_pattern_t * _createHatchPainter(SPPaintServer const *const paintserver, Geom::OptRect const &pbox)
static void font_data_free(gpointer data)
void setStateNeedsLayer(bool state_needs_layer)
unsigned _bitmapresolution
void addPathVector(Geom::PathVector const &pv)
cairo_surface_t * getSurface()
float _mergedOpacity(float source_opacity) const
void popLayer(cairo_operator_t composite=CAIRO_OPERATOR_CLEAR)
void _setFillStyle(SPStyle const *style, Geom::OptRect const &pbox)
Class to hold image data for raster images.
Typed SVG document implementation.
Enum type internal to SPStyle.
Base class for visual SVG elements.
_cairo_pattern cairo_pattern_t
struct _cairo_surface cairo_surface_t
Inkscape::Extension::Extension: Frontend to certain, possibly pluggable, actions.
Contains forward declarations of 2geom types.
Helper class to stream background task notifications as a series of messages.
unsigned parent_has_userspace
whether the parent's ctm should be applied
unsigned need_layer
whether object is masked, clipped, and/or has a non-zero opacity
Geom::Affine item_transform
this item's item->transform, for correct clipping
unsigned merge_opacity
whether fill/stroke opacity can be mul'd with item opacity
unsigned has_filtereffect
SPStyle internal: classes that are internal to SPStyle.