Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
RendererInterface.h File Reference
#include <cstddef>
#include <optional>
#include <span>
#include <vector>
#include "donner/base/Box.h"
#include "donner/base/RcString.h"
#include "donner/base/RelativeLengthMetrics.h"
#include "donner/base/SmallVector.h"
#include "donner/base/Transform.h"
#include "donner/css/Color.h"
#include "donner/svg/components/RenderingInstanceComponent.h"
#include "donner/svg/components/filter/FilterEffect.h"
#include "donner/svg/components/text/ComputedTextComponent.h"
#include "donner/svg/core/FillRule.h"
#include "donner/svg/core/PathSpline.h"
#include "donner/svg/core/Stroke.h"
#include "donner/svg/resources/ImageResource.h"
Include dependency graph for RendererInterface.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::svg::RenderViewport
 Describes the viewport for a render pass. More...
struct  donner::svg::RendererBitmap
 CPU-readable bitmap produced by a renderer snapshot. More...
struct  donner::svg::PathShape
 Represents a resolved path along with its fill rule, transform, and layer index for boolean ops. More...
struct  donner::svg::StrokeParams
 Stroke configuration used for path and primitive drawing. More...
struct  donner::svg::PaintParams
 Paint state derived from resolved style for the current node. More...
struct  donner::svg::ResolvedClip
 Clip stack entry combining rectangles, paths, and optional masks. More...
struct  donner::svg::ImageParams
 Parameters describing how an image should be drawn. More...
struct  donner::svg::TextParams
 Parameters describing how text is drawn and outlined. More...
class  donner::svg::RendererInterface
 Backend-agnostic rendering interface consumed by the traversal driver. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::svg
 Donner SVG library, which can load, manipulate and render SVG files.

Class Documentation

◆ donner::svg::RenderViewport

struct donner::svg::RenderViewport

Describes the viewport for a render pass.

Collaboration diagram for donner::svg::RenderViewport:
[legend]
Class Members
double devicePixelRatio = 1.0 Device pixel ratio used to map logical coordinates to device pixels.
Vector2d size = Vector2d::Zero() Logical size in CSS/SVG units after layout.

◆ donner::svg::PathShape

struct donner::svg::PathShape

Represents a resolved path along with its fill rule, transform, and layer index for boolean ops.

Collaboration diagram for donner::svg::PathShape:
[legend]
Class Members
Transformd entityFromParent Transform from clip path child to the clip path's coordinate system.
FillRule fillRule = FillRule::NonZero
int layer = 0 Layer index for boolean combination: paths on the same layer are unioned, layers are intersected.
PathSpline path

◆ donner::svg::StrokeParams

struct donner::svg::StrokeParams

Stroke configuration used for path and primitive drawing.

Collaboration diagram for donner::svg::StrokeParams:
[legend]
Class Members
vector< double > dashArray Dash pattern lengths alternating on/off segments.
double dashOffset = 0.0 Dash phase offset.
StrokeLinecap lineCap = StrokeLinecap::Butt
StrokeLinejoin lineJoin = StrokeLinejoin::Miter
double miterLimit = 4.0 Maximum miter ratio before converting to bevel.
double pathLength = 0.0 SVG pathLength attribute value; 0 means unused. When non-zero, dash arrays and offsets are scaled by the ratio of the actual path length to this value.
double strokeWidth = 0.0 Stroke width in user units.

◆ donner::svg::PaintParams

struct donner::svg::PaintParams

Paint state derived from resolved style for the current node.

Collaboration diagram for donner::svg::PaintParams:
[legend]
Class Members
Color currentColor = css::Color(css::RGBA()) CurrentColor value for paint server resolution.
ResolvedPaintServer fill = PaintServer::None{}
double fillOpacity = 1.0
double opacity = 1.0 Multiplicative opacity applied to all drawing.
ResolvedPaintServer stroke = PaintServer::None{}
double strokeOpacity = 1.0
StrokeParams strokeParams
Boxd viewBox View box used for unit resolution and gradient coordinate conversion.

◆ donner::svg::ImageParams

struct donner::svg::ImageParams

Parameters describing how an image should be drawn.

Collaboration diagram for donner::svg::ImageParams:
[legend]
Class Members
bool imageRenderingPixelated = false Whether to favor nearest-neighbor sampling for pixelated rendering.
double opacity = 1.0
Boxd targetRect Destination rectangle in device-independent units.

◆ donner::svg::TextParams

struct donner::svg::TextParams

Parameters describing how text is drawn and outlined.

Collaboration diagram for donner::svg::TextParams:
[legend]
Class Members
Color fillColor = css::Color(css::RGBA())
SmallVector< RcString, 1 > fontFamilies
FontMetrics fontMetrics
Lengthd fontSize
double opacity = 1.0
Color strokeColor = css::Color(css::RGBA())
StrokeParams strokeParams
Boxd viewBox