|
|
Donner 0.5.1
Embeddable browser-grade SVG2 engine
|
Donner SVG library, which can load, manipulate and render SVG files. More...
Namespaces | |
| namespace | parser |
| Parsers for the SVG XML format, SVGParser, as well as individual parsers for SVG components, such as PathParser and TransformParser. | |
| namespace | components |
| Contains the implementation of the Donner ECS,. | |
Classes | |
| struct | FilterEffect |
| Filter effect container, which can contain a reference to another filter effect, or a CSS filter function (such as blur(), grayscale(), etc). More... | |
| class | CssTransform |
| Compared to an SVG transform, CSS transforms have additional features, such as the ability to add units to the translate() function, such as translate(1em 30px). More... | |
| struct | Event |
| A DOM event object, carrying information about a user interaction. More... | |
| struct | ListenerHandle |
| Handle for removing an event listener. Returned by addEventListener. More... | |
| struct | GradientStop |
| Values for a gradient stop, https://www.w3.org/TR/SVG2/pservers.html#StopElement. More... | |
| struct | MarkerOrient |
| Represents the orientation of a marker. More... | |
| class | PreserveAspectRatio |
| Handles SVG's preserveAspectRatio attribute. More... | |
| class | StrokeDasharray |
| The parsed result of the 'stroke-dasharray' property, see: https://www.w3.org/TR/SVG2/painting.html#StrokeDasharrayProperty. More... | |
| struct | TransformOrigin |
| Represents the transform-origin property value. More... | |
| class | DonnerController |
| Provides hit-testing and spatial queries for an SVG document. More... | |
| struct | RecursionGuard |
| Helper to guard against recursion when evaluating references. More... | |
| struct | ResolvedReference |
| Represents a resolved reference to an SVG entity. More... | |
| struct | Reference |
| Represents a reference to an SVG entity by its href, typically created from a url(#id) string. More... | |
| struct | PaintServer |
| Represents a paint server, which can be a solid color, a reference to another element, or a special value like "none" or "context-fill". More... | |
| struct | Property |
| Holds a CSS property, which has a name and value, and integrates with inheritance to allow cascading values using the CSS model with specificity. More... | |
| class | PropertyRegistry |
| Holds CSS properties for a single element. More... | |
| struct | RenderingInstanceView |
| A view containing a list of components::RenderingInstanceComponent which can be iterated over. More... | |
| class | Renderer |
| Backend-agnostic renderer that resolves to the active build backend (Skia or tiny-skia). More... | |
| class | RendererDriver |
| Backend-agnostic renderer driver that prepares documents for rendering and emits drawing commands through a RendererInterface implementation. More... | |
| struct | FrameTimings |
| Per-frame performance instrumentation for RendererGeode. More... | |
| class | RendererGeode |
| Geode rendering backend — GPU-native via WebGPU + the Slug algorithm. More... | |
| class | RendererImageIO |
| Utility class for saving images to disk. More... | |
| struct | RenderViewport |
| Describes the viewport for a render pass. More... | |
| struct | RendererBitmap |
| CPU-readable bitmap produced by a renderer snapshot. More... | |
| struct | PathShape |
| Represents a resolved path along with its fill rule, transform, and layer index for boolean ops. More... | |
| struct | PaintParams |
| Paint state derived from resolved style for the current node. More... | |
| struct | ResolvedClip |
| Clip stack entry combining rectangles, paths, and optional masks. More... | |
| struct | ImageParams |
| Parameters describing how an image should be drawn. More... | |
| struct | TextParams |
| Parameters describing how text is drawn and outlined. More... | |
| class | RendererInterface |
| Backend-agnostic rendering interface consumed by RendererDriver during document traversal. More... | |
| class | RendererTinySkia |
| Rendering backend using tiny-skia-cpp. More... | |
| class | RendererUtils |
| Utility functions for the renderer. More... | |
| struct | ResolvedGradientData |
| Fully resolved gradient payload that can cross non-SVG package boundaries. More... | |
| struct | StrokeParams |
| Stroke configuration used for path and primitive drawing. More... | |
| struct | TerminalCapabilities |
| Terminal detection results derived from environment probing. More... | |
| struct | TerminalSize |
| Terminal size in columns and rows. More... | |
| struct | TerminalCellSize |
| Terminal cell size in pixels. More... | |
| struct | TerminalImageViewerConfig |
| Rendering configuration for terminal output. More... | |
| struct | TerminalImageView |
| Image view describing an RGBA buffer. More... | |
| struct | QuarterBlock |
| Per-cell subpixel sampling for quarter-pixel mode. More... | |
| struct | HalfBlock |
| Per-cell subpixel sampling for half-pixel mode. More... | |
| struct | TerminalCell |
| Aggregated subpixel data for a terminal cell. More... | |
| struct | TerminalImage |
| Sampled representation of an image prepared for terminal rendering. More... | |
| class | TerminalImageViewer |
| Terminal image sampler for quarter- and half-pixel block glyphs. More... | |
| class | FontLoader |
| Helper to load a font from a URI, using a ResourceLoaderInterface to fetch the raw data and then parsing it as a WOFF file. More... | |
| class | FontHandle |
| Opaque handle to a loaded font, used to reference fonts in the FontManager. More... | |
| class | FontManager |
| Manages font loading, caching, and lookup for text rendering. More... | |
| struct | FontMetadata |
| Metadata extracted from a raw OpenType/TrueType font file. More... | |
| struct | SvgImageContent |
| Contains raw SVG document bytes, returned by ImageLoader when the referenced resource is an SVG image (image/svg+xml). More... | |
| class | ImageLoader |
| Utility class for loading images from a URI. More... | |
| struct | ImageResource |
| Contains a decoded image resource in RGBA format. More... | |
| class | NullResourceLoader |
| A resource loader that does not load any resources and always returns an error. More... | |
| class | ResourceLoaderInterface |
| Interface for loading external resources, such as images. More... | |
| class | SandboxedFileResourceLoader |
| A resource loader that loads files from a sandboxed directory. More... | |
| class | UrlLoader |
| Utility class for loading a URI or decoding a data URL. More... | |
| class | SVGCircleElement |
| DOM object for a "<circle>" element. More... | |
| class | SVGClipPathElement |
| DOM object for a "<clipPath>" element. More... | |
| class | SVGDefsElement |
| DOM object for a "<defs>" element. More... | |
| class | SVGDocument |
| Represents a parsed SVG document containing a tree of SVGElement nodes. More... | |
| class | SVGElement |
| Represents a single SVG element (e.g., <rect>, <circle>, <g>, <text>, etc.) within an SVGDocument. More... | |
| class | SVGEllipseElement |
| DOM object for a "<ellipse>" element. More... | |
| class | SVGFEBlendElement |
| DOM object for a "<feBlend>" element. More... | |
| class | SVGFEColorMatrixElement |
| DOM object for a "<feColorMatrix>" element. More... | |
| class | SVGFEComponentTransferElement |
| DOM object for a "<feComponentTransfer>" element. More... | |
| class | SVGFECompositeElement |
| DOM object for a "<feComposite>" element. More... | |
| class | SVGFEConvolveMatrixElement |
| DOM object for a "<feConvolveMatrix>" element. More... | |
| class | SVGFEDiffuseLightingElement |
| DOM object for a "<feDiffuseLighting>" element. More... | |
| class | SVGFEDisplacementMapElement |
| DOM object for a "<feDisplacementMap>" element. More... | |
| class | SVGFEDistantLightElement |
| DOM object for a "<feDistantLight>" element. More... | |
| class | SVGFEDropShadowElement |
| DOM object for a "<feDropShadow>" element. More... | |
| class | SVGFEFloodElement |
| DOM object for a "<feFlood>" element. More... | |
| class | SVGFEFuncAElement |
| DOM object for a "<feFuncA>" element. More... | |
| class | SVGFEFuncBElement |
| DOM object for a "<feFuncB>" element. More... | |
| class | SVGFEFuncGElement |
| DOM object for a "<feFuncG>" element. More... | |
| class | SVGFEFuncRElement |
| DOM object for a "<feFuncR>" element. More... | |
| class | SVGFEGaussianBlurElement |
| DOM object for a "<feGaussianBlur>" element. More... | |
| class | SVGFEImageElement |
| DOM object for a "<feImage>" element. More... | |
| class | SVGFEMergeElement |
| DOM object for a "<feMerge>" element. More... | |
| class | SVGFEMergeNodeElement |
| DOM object for a "<feMergeNode>" element. More... | |
| class | SVGFEMorphologyElement |
| DOM object for a "<feMorphology>" element. More... | |
| class | SVGFEOffsetElement |
| DOM object for a "<feOffset>" element. More... | |
| class | SVGFEPointLightElement |
| DOM object for a "<fePointLight>" element. More... | |
| class | SVGFESpecularLightingElement |
| DOM object for a "<feSpecularLighting>" element. More... | |
| class | SVGFESpotLightElement |
| DOM object for a "<feSpotLight>" element. More... | |
| class | SVGFETileElement |
| DOM object for a "<feTile>" element. More... | |
| class | SVGFETurbulenceElement |
| DOM object for a "<feTurbulence>" element. More... | |
| class | SVGFilterElement |
| DOM object for a "<filter>" element. More... | |
| class | SVGFilterPrimitiveStandardAttributes |
| Handles standard attributes for filter primitives, which are children of the "<filter>" element. More... | |
| class | SVGGElement |
| DOM object for a "<g>" element. More... | |
| class | SVGGeometryElement |
| Base class for all Elements: Basic Shapes. More... | |
| class | SVGGradientElement |
| Base class for SVG gradient elements, such as SVGLinearGradientElement and SVGRadialGradientElement. More... | |
| class | SVGGraphicsElement |
| Base class for elements which render or impact the rendering tree, such as "<path>" and "<g>". More... | |
| class | SVGImageElement |
| DOM object for a "<image>" element. More... | |
| class | SVGLinearGradientElement |
| DOM object for a "<linearGradient>" element. More... | |
| class | SVGLineElement |
| DOM object for a "<line>" element. More... | |
| class | SVGMarkerElement |
| DOM object for a "<marker>" element, which is used to define graphical objects that can be used repeatedly along a path, such as arrowheads or other markers on paths. More... | |
| class | SVGMaskElement |
| Represents the "<mask>" element in SVG, which is used to define a mask for graphical elements. More... | |
| class | SVGPathElement |
| DOM object for a "<path>" element. More... | |
| class | SVGPatternElement |
| DOM object for a "<pattern>" element. More... | |
| class | SVGPolygonElement |
| DOM object for a "<polygon>" element. More... | |
| class | SVGPolylineElement |
| DOM object for a "<polyline>" element. More... | |
| class | SVGRadialGradientElement |
| DOM object for a "<radialGradient>" element. More... | |
| class | SVGRectElement |
| DOM object for the "<rect>" element. More... | |
| class | SVGStopElement |
| DOM object for a "<stop>" element. More... | |
| class | SVGStyleElement |
| DOM object for a "<style>" element, which contains a CSS stylesheet. More... | |
| class | SVGSVGElement |
| DOM object for a "<svg>" element. More... | |
| class | SVGSymbolElement |
| DOM object for a "<symbol>" element, which defines a graphical template that can be instantiated using a "<use>" element. More... | |
| class | SVGTextContentElement |
| Base class for elements that support rendering child text content. More... | |
| class | SVGTextElement |
| DOM object for a "<text>" element. More... | |
| class | SVGTextPathElement |
| DOM object for a "<textPath>" element. More... | |
| class | SVGTextPositioningElement |
| Base class for elements that support per-glyph positioning attributes (x, y, dx, dy, rotate) on top of the basic text content interface. More... | |
| class | SVGTSpanElement |
| DOM object for a "<tspan>" element. More... | |
| class | SVGUnknownElement |
| DOM object for an unknown SVG element. More... | |
| class | SVGUseElement |
| DOM object for a "<use>" element. More... | |
| struct | FontVMetrics |
| Font vertical metrics in font design units (unscaled). More... | |
| struct | UnderlineMetrics |
| Line decoration positioning metrics in font design units. More... | |
| struct | SubSuperMetrics |
| Sub/superscript Y offsets from the OS/2 table, in font design units. More... | |
| class | TextBackend |
| Abstract font backend for text rendering operations. More... | |
| class | TextBackendFull |
| HarfBuzz + FreeType font backend. More... | |
| class | TextBackendSimple |
| stb_truetype-based font backend. More... | |
| class | TextEngine |
| Shared SVG text engine. More... | |
| struct | TextLayoutParams |
| Layout-only parameters consumed by TextEngine. More... | |
| struct | TextGlyph |
| A single positioned glyph in a laid-out text run. More... | |
| struct | TextRun |
| A run of positioned glyphs sharing the same font. More... | |
| struct | SampledImageInfo |
| Sampled image dimensions and scaling for coordinate mapping. More... | |
Typedefs | |
| using | AllSVGElements |
| A type list of all SVG element types, used by donner::svg::parser::AttributeParser and donner::svg::parser::SVGParser. | |
| using | EventCallback = std::function<void(Event&)> |
| Callback type for event listeners. | |
| template<typename T> | |
| using | GetInitialFn = std::optional<T> (*)() |
| Callback function to get the initial value of a property. | |
| using | SVGDocumentHandle = std::shared_ptr<Registry> |
| Shared internal document state used by SVGDocument's by-value facade. | |
Enumerations | |
| enum class | FilterUnits : std::uint8_t { UserSpaceOnUse , ObjectBoundingBox , Default = ObjectBoundingBox } |
| Values for the "filterUnits" attribute which defines the coordinate system for attributes x, y, width, height. More... | |
| enum class | PrimitiveUnits : std::uint8_t { UserSpaceOnUse , ObjectBoundingBox , Default = UserSpaceOnUse } |
| Values for the "primitiveUnits" attribute which specifies the coordinate system for the various length values within the filter primitives and for the attributes that define the filter primitive subregion. More... | |
| enum class | ClipPathUnits : uint8_t { UserSpaceOnUse , ObjectBoundingBox , Default = UserSpaceOnUse } |
| Values for the "clipPathUnits" attribute, https://drafts.fxtf.org/css-masking-1/#element-attrdef-clippath-clippathunits. More... | |
| enum class | ClipRule : uint8_t { NonZero , EvenOdd } |
| The parsed result of the clip-rule property, see: https://drafts.fxtf.org/css-masking-1/#propdef-clip-rule. More... | |
| enum class | ColorInterpolationFilters : std::uint8_t { SRGB , LinearRGB , Default = LinearRGB } |
| Values for the "color-interpolation-filters" property which specifies the color space for filter operations. More... | |
| enum class | CursorType : uint8_t { Auto , Default , None , Pointer , Crosshair , Move , Text , Wait , Help , NotAllowed , Grab , Grabbing , NResize , EResize , SResize , WResize , NEResize , NWResize , SEResize , SWResize , ColResize , RowResize , ZoomIn , ZoomOut } |
| CSS cursor types, defining which cursor the user agent should display. More... | |
| enum class | Display : uint8_t { Inline , Block , ListItem , InlineBlock , Table , InlineTable , TableRowGroup , TableHeaderGroup , TableFooterGroup , TableRow , TableColumnGroup , TableColumn , TableCell , TableCaption , None } |
| The parsed result of the CSS 'display' property, see https://www.w3.org/TR/CSS2/visuren.html#propdef-display. More... | |
| enum class | DominantBaseline : uint8_t { Auto , TextBottom , Alphabetic , Ideographic , Middle , Central , Mathematical , Hanging , TextTop } |
| The parsed result of the dominant-baseline property. More... | |
| enum class | EventType : uint8_t { Click , DblClick , MouseDown , MouseUp , MouseMove , MouseEnter , MouseLeave , MouseOver , MouseOut , Wheel } |
| Types of DOM events that can be dispatched through the SVG event system. More... | |
| enum class | FontStretch : uint8_t { UltraCondensed = 1 , ExtraCondensed = 2 , Condensed = 3 , SemiCondensed = 4 , Normal = 5 , SemiExpanded = 6 , Expanded = 7 , ExtraExpanded = 8 , UltraExpanded = 9 } |
| The parsed result of the font-stretch property. More... | |
| enum class | FontStyle : uint8_t { Normal , Italic , Oblique } |
| The parsed result of the font-style property. More... | |
| enum class | FontVariant : uint8_t { Normal , SmallCaps } |
| The parsed result of the font-variant shorthand property (SVG 1.1 subset). More... | |
| enum class | GradientUnits : uint8_t { UserSpaceOnUse , ObjectBoundingBox , Default = ObjectBoundingBox } |
| Values for the "gradientUnits" attribute, https://www.w3.org/TR/SVG2/pservers.html#LinearGradientElementGradientUnitsAttribute and https://www.w3.org/TR/SVG2/pservers.html#RadialGradientElementGradientUnitsAttribute. More... | |
| enum class | GradientSpreadMethod : uint8_t { Pad , Reflect , Repeat , Default = Pad } |
| Values for the gradient "spreadMethod" attribute, https://www.w3.org/TR/SVG2/pservers.html#LinearGradientElementSpreadMethodAttribute and https://www.w3.org/TR/SVG2/pservers.html#RadialGradientElementSpreadMethodAttribute. More... | |
| enum class | ImageRendering : uint8_t { Auto , OptimizeSpeed , OptimizeQuality , CrispEdges , Pixelated , Smooth } |
| CSS image-rendering property values. More... | |
| enum class | Isolation : uint8_t { Auto , Isolate } |
| CSS isolation property values. More... | |
| enum class | LengthAdjust : uint8_t { Spacing , SpacingAndGlyphs , Default = Spacing } |
| Values for the "lengthAdjust" attribute, https://www.w3.org/TR/SVG2/text.html#TextElementLengthAdjustAttribute. More... | |
| enum class | MarkerUnits : uint8_t { StrokeWidth , UserSpaceOnUse , Default = StrokeWidth } |
| Values for the "markerUnits" attribute, https://www.w3.org/TR/SVG2/painting.html#MarkerUnitsAttribute. More... | |
| enum class | MaskUnits : uint8_t { UserSpaceOnUse , ObjectBoundingBox , Default = ObjectBoundingBox } |
| Values for the "maskUnits" attribute, https://drafts.fxtf.org/css-masking-1/#element-attrdef-mask-maskunits. More... | |
| enum class | MaskContentUnits : uint8_t { UserSpaceOnUse , ObjectBoundingBox , Default = UserSpaceOnUse } |
| Values for the "maskContentUnits" attribute, https://drafts.fxtf.org/css-masking-1/#element-attrdef-mask-maskcontentunits. More... | |
| enum class | MixBlendMode : uint8_t { Normal , Multiply , Screen , Overlay , Darken , Lighten , ColorDodge , ColorBurn , HardLight , SoftLight , Difference , Exclusion , Hue , Saturation , Color , Luminosity } |
| CSS mix-blend-mode property values for compositing blend modes. More... | |
| enum class | Overflow : uint8_t { Visible , Hidden , Scroll , Auto } |
| The parsed result of the CSS 'overflow' property, see https://www.w3.org/TR/CSS2/visufx.html#overflow and https://www.w3.org/TR/SVG2/render.html#OverflowAndClipProperties. More... | |
| enum class | PatternUnits : uint8_t { UserSpaceOnUse , ObjectBoundingBox , Default = ObjectBoundingBox } |
| PatternUnits controls the coordinate system of the x/y/width/height attributes: More... | |
| enum class | PatternContentUnits : uint8_t { UserSpaceOnUse , ObjectBoundingBox , Default = UserSpaceOnUse } |
| PatternContentUnits controls the coordinate system of the children of the pattern: More... | |
| enum class | PointerEvents : uint8_t { None , BoundingBox , VisiblePainted , VisibleFill , VisibleStroke , Visible , Painted , Fill , Stroke , All } |
| Values for the 'pointer-events' property, which defines how mouse events interact with an element. More... | |
| enum class | ProcessingMode : uint8_t { DynamicInteractive , SecureAnimated , SecureStatic } |
| SVG document processing mode, per SVG2 §2.7.1. More... | |
| enum class | StrokeLinecap : uint8_t { Butt , Round , Square } |
| The parsed result of the 'stroke-linecap' property, see: https://www.w3.org/TR/SVG2/painting.html#StrokeLinecapProperty. More... | |
| enum class | StrokeLinejoin : uint8_t { Miter , MiterClip , Round , Bevel , Arcs } |
| The parsed result of the 'stroke-linejoin' property, see: https://www.w3.org/TR/SVG2/painting.html#StrokeLinejoinProperty. More... | |
| enum class | TextAnchor : uint8_t { Start , Middle , End } |
| The parsed result of the text-anchor property. More... | |
| enum class | TextDecoration : uint8_t { None = 0 , Underline = 1 << 0 , Overline = 1 << 1 , LineThrough = 1 << 2 } |
| Bitmask for the text-decoration property line types. More... | |
| enum class | Visibility : uint8_t { Visible , Hidden , Collapse } |
| The parsed result of the 'visibility' property, see: https://www.w3.org/TR/CSS2/visufx.html#propdef-visibility. More... | |
| enum class | WritingMode : uint8_t { HorizontalTb , VerticalRl , VerticalLr } |
| CSS writing-mode property values, controlling the direction of text flow. More... | |
| enum class | ElementType : uint8_t { Circle , ClipPath , Defs , Ellipse , FeBlend , FeColorMatrix , FeComponentTransfer , FeComposite , FeConvolveMatrix , FeDiffuseLighting , FeDisplacementMap , FeDistantLight , FeDropShadow , FeFlood , FeFuncA , FeFuncB , FeFuncG , FeFuncR , FeGaussianBlur , FeImage , FeMerge , FeMergeNode , FeMorphology , FeOffset , FePointLight , FeSpecularLighting , FeSpotLight , FeTile , FeTurbulence , Filter , G , Image , Line , LinearGradient , Marker , Mask , Path , Pattern , Polygon , Polyline , RadialGradient , Rect , Stop , Style , SVG , Symbol , Text , TextPath , TSpan , Unknown , Use } |
| SVG element types, corresponds to each XML element name, such as "<circle>", "<svg>", "<rect>", etc. More... | |
| enum class | PropertyCascade { None , Inherit , PaintInherit } |
| Defines how this property cascades between the parent and child elements. More... | |
| enum class | PropertyState { NotSet = 0 , Set = 1 , Inherit = 2 , ExplicitInitial = 3 , ExplicitUnset = 4 } |
| The current property state, which can be either set, not set, or a specific CSS keyword such as "inherit", "initial", or "unset". More... | |
| enum class | PropertyInheritOptions { All , NoPaint } |
| Options to control how inheritance is performed, to either inherit everything or conditionally disable inheritance of paint servers. More... | |
| enum class | AlphaType : uint8_t { Premultiplied , Unpremultiplied } |
| Alpha channel interpretation for pixel data. More... | |
| enum class | TerminalPixelMode { kQuarterPixel , kHalfPixel } |
| Pixel granularity for terminal rendering. | |
| enum class | ResourceLoaderError : uint8_t { NotFound , SandboxViolation } |
| Error codes for resource loading. More... | |
| enum class | UrlLoaderError : uint8_t { NotFound , UnsupportedFormat , InvalidDataUrl , DataCorrupt } |
| Enum of possible errors that can occur when loading an image. More... | |
| enum class | FillRule |
| The parsed result of the 'fill-rule' property, see: https://www.w3.org/TR/SVG2/painting.html#FillRuleProperty. | |
Functions | |
| std::ostream & | operator<< (std::ostream &os, const std::vector< FilterEffect > &filters) |
| Ostream output operator for a vector of filter effects. | |
| std::ostream & | operator<< (std::ostream &os, ClipPathUnits units) |
| Ostream output operator for ClipPathUnits enum, outputs the enum name with prefix, e.g. ClipPathUnits::UserSpaceOnUse. | |
| std::ostream & | operator<< (std::ostream &os, const ClipRule &clipRule) |
| Output stream operator for ClipRule enum. | |
| std::ostream & | operator<< (std::ostream &os, ColorInterpolationFilters cif) |
| Ostream output operator for ColorInterpolationFilters. | |
| std::ostream & | operator<< (std::ostream &os, CursorType value) |
| Output stream operator for CursorType, outputs the CSS string representation. | |
| std::ostream & | operator<< (std::ostream &os, Display value) |
| Ostream output operator for Display enum, outputs the CSS value. | |
| std::ostream & | operator<< (std::ostream &os, DominantBaseline value) |
| Ostream output operator for DominantBaseline enum, outputs the CSS value. | |
| std::ostream & | operator<< (std::ostream &os, EventType type) |
| Output stream operator for EventType. | |
| bool | eventBubbles (EventType type) |
| Returns true if the event type bubbles up the DOM tree. | |
| std::ostream & | operator<< (std::ostream &os, FontStretch value) |
| Ostream output operator for FontStretch enum, outputs the CSS value. | |
| std::ostream & | operator<< (std::ostream &os, FontStyle value) |
| Ostream output operator for FontStyle enum, outputs the CSS value. | |
| std::ostream & | operator<< (std::ostream &os, FontVariant value) |
| Ostream output operator for FontVariant enum, outputs the CSS value. | |
| std::ostream & | operator<< (std::ostream &os, ImageRendering value) |
| ostream output operator for ImageRendering. | |
| std::ostream & | operator<< (std::ostream &os, Isolation value) |
| ostream output operator for Isolation. | |
| std::ostream & | operator<< (std::ostream &os, LengthAdjust units) |
| Ostream output operator for LengthAdjust enum, outputs the enum name with prefix, e.g. LengthAdjust::Spacing. | |
| std::ostream & | operator<< (std::ostream &os, MarkerUnits units) |
| Ostream output operator for MarkerUnits enum, outputs the enum name with prefix, e.g. MarkerUnits::UserSpaceOnUse. | |
| std::ostream & | operator<< (std::ostream &os, MaskUnits units) |
| Ostream output operator for MaskUnits enum, outputs the enum name with prefix, e.g. MaskUnits::UserSpaceOnUse. | |
| std::ostream & | operator<< (std::ostream &os, MaskContentUnits units) |
| Ostream output operator for MaskContentUnits enum, outputs the enum name with prefix, e.g. MaskContentUnits::UserSpaceOnUse. | |
| std::ostream & | operator<< (std::ostream &os, MixBlendMode value) |
| ostream output operator for MixBlendMode. | |
| std::ostream & | operator<< (std::ostream &os, Overflow value) |
| Ostream output operator for Overflow enum, outputs the CSS value. | |
| std::ostream & | operator<< (std::ostream &os, PointerEvents value) |
| Output stream operator for PointerEvents, outputs the CSS string representation for this enum, e.g. "none", "bounding-box", etc. | |
| std::ostream & | operator<< (std::ostream &os, PreserveAspectRatio::Align value) |
| Outputs Align value to stream (e.g., "Align::XMidYMid"). | |
| std::ostream & | operator<< (std::ostream &os, PreserveAspectRatio::MeetOrSlice value) |
| Outputs MeetOrSlice value to stream (e.g., "MeetOrSlice::Meet"). | |
| std::ostream & | operator<< (std::ostream &os, StrokeLinecap value) |
| Ostream output operator for StrokeLinecap enum, outputs the CSS value. | |
| std::ostream & | operator<< (std::ostream &os, StrokeLinejoin value) |
| Ostream output operator for StrokeLinejoin enum, outputs the CSS value. | |
| std::ostream & | operator<< (std::ostream &os, TextAnchor value) |
| Ostream output operator for TextAnchor enum, outputs the CSS value. | |
| constexpr TextDecoration | operator| (TextDecoration a, TextDecoration b) |
| Bitwise OR for combining TextDecoration values. | |
| constexpr TextDecoration | operator& (TextDecoration a, TextDecoration b) |
| Bitwise AND for testing TextDecoration flags. | |
| constexpr TextDecoration & | operator|= (TextDecoration &a, TextDecoration b) |
| Bitwise OR assignment. | |
| constexpr bool | hasFlag (TextDecoration value, TextDecoration flags) |
Returns true if any of the flags in flags are set in value. | |
| std::ostream & | operator<< (std::ostream &os, TextDecoration value) |
| Ostream output operator for TextDecoration bitmask, outputs CSS values. | |
| std::ostream & | operator<< (std::ostream &os, const TransformOrigin &origin) |
| Ostream output operator. | |
| std::ostream & | operator<< (std::ostream &os, Visibility value) |
| Ostream output operator for Visibility enum, outputs the CSS value. | |
| bool | isVertical (WritingMode mode) |
| Returns true if the writing mode is vertical (VerticalRl or VerticalLr). | |
| std::ostream & | operator<< (std::ostream &os, WritingMode value) |
| ostream output operator for WritingMode, outputs the CSS3 value name. | |
| std::ostream & | operator<< (std::ostream &os, ElementType type) |
| Ostream output operator for ElementType, outputs the element name. | |
| template<typename ReturnType, typename FnT> | |
| ReturnType | ToConstexpr (ElementType type, FnT fn) |
| Converts a ElementType runtime value to a compile-time value, allowing conditional behavior for different element types with constexpr. | |
| template<typename T, PropertyCascade kCascade> | |
| std::ostream & | operator<< (std::ostream &os, const Property< T, kCascade > &property) |
| Ostream output operator, which outputs the current property value, how it was set (e.g. | |
| std::tuple< Lengthd, double > | CalculateRadiusMaybeAuto (const Property< Lengthd > &property, const Property< Lengthd > &fallbackProperty, const Box2d &viewBox, const FontMetrics &fontMetrics) |
| Calculates the the radius for elements with rx and ry radius, in pixels, taking into account the "auto" identifier and handling negative values. | |
| void | ApplyFilterGraphToPixmap (tiny_skia::Pixmap &pixmap, const components::FilterGraph &filterGraph, const Transform2d &deviceFromFilter, const std::optional< Box2d > &filterRegion, bool clipSourceToFilterRegion=false, const tiny_skia::Pixmap *fillPaintInput=nullptr, const tiny_skia::Pixmap *strokePaintInput=nullptr) |
| Applies a Donner filter graph to a premultiplied RGBA pixmap in place. | |
| void | ClipFilterOutputToRegion (tiny_skia::Pixmap &pixmap, const std::optional< Box2d > &filterRegion, const Transform2d &deviceFromFilter) |
| Clears pixels outside the transformed filter region. | |
| std::vector< std::uint8_t > | PremultiplyRgba (std::span< const std::uint8_t > rgbaPixels) |
| Convert tightly-packed straight-alpha RGBA8 to premultiplied RGBA8. | |
| void | UnpremultiplyRgbaInPlace (std::vector< std::uint8_t > &rgba) |
| Convert tightly-packed premultiplied RGBA8 to straight-alpha RGBA8, in place. Fully-opaque pixels (alpha == 255) are unchanged; fully-transparent pixels (alpha == 0) become (0, 0, 0, 0). | |
| std::vector< std::uint8_t > | UnpremultiplyRgba (std::span< const std::uint8_t > rgbaPixels) |
| Non-mutating variant of UnpremultiplyRgbaInPlace that allocates. Prefer the in-place form on hot paths; use this when the caller needs to preserve the input. | |
| std::optional< ResolvedGradientData > | FlattenResolvedGradient (const components::ResolvedPaintServer &paint) |
| Flatten a resolved paint server if it points at a materialized linear or radial gradient. | |
| components::ResolvedPaintServer | MaterializeResolvedGradient (Registry ®istry, const ResolvedGradientData &gradient) |
| Materialize a resolved gradient payload into a fresh ECS paint server entity. | |
| std::optional< FontMetadata > | ParseFontMetadata (std::span< const uint8_t > data) |
| Parse CSS-relevant metadata from a raw OpenType/TrueType font file. | |
| std::string_view | ToString (UrlLoaderError err) |
| Converts a UrlLoaderError to a human-readable string. | |
| std::ostream & | operator<< (std::ostream &os, UrlLoaderError err) |
| Ostream operator for UrlLoaderError. | |
| uint32_t | ReadBe32 (const uint8_t *p) |
Read a 32-bit big-endian unsigned integer from p. | |
| uint16_t | ReadUnitsPerEm (std::span< const uint8_t > data) |
| Check if raw font data has a valid 'head' table and read unitsPerEm. Returns 0 if missing. | |
| bool | HasOutlineTables (std::span< const uint8_t > data) |
| Returns true if the raw font has a scalable outline table. | |
| int | RunDonnerSvgTool (int argc, char *argv[], std::ostream &out, std::ostream &err) |
| Run the donner-svg command line tool. | |
| std::string | BuildCssSelectorPath (const SVGElement &element) |
| Build a CSS-like selector path for an element. | |
| void | CompositeAABBRect (RendererBitmap &bitmap, const Box2d &bounds, const SampledImageInfo &imageInfo) |
| Draw a 1-sub-pixel blue AABB outline directly into the bitmap, aligned to the terminal sub-pixel grid. | |
Variables | |
| constexpr std::string_view | kUserAgentStylesheet |
| The user agent stylesheet to be used by default on all SVG documents. | |
| constexpr auto | kSVGElementNames = detail::extractTagNames(AllSVGElements{}) |
| Compile-time array of all known SVG element tag names (e.g. "rect", "circle", "path"). Derived from AllSVGElements and each element class's static Tag constant. | |
| constexpr std::array< std::string_view, 70 > | kSVGPresentationAttributeNames |
| Compile-time array of all known SVG presentation attributes and geometry attributes. Each entry is an attribute name string (e.g. "fill", "stroke", "transform"). | |
Donner SVG library, which can load, manipulate and render SVG files.
Loading SVG files can be done using donner::svg::parser::SVGParser
The resulting SVGDocument can be used to traverse the SVG file:
The SVG file can be rendered using donner::svg::Renderer
For hit-testing and spatial queries, use donner::svg::DonnerController.
| struct donner::svg::GradientStop |
Values for a gradient stop, https://www.w3.org/TR/SVG2/pservers.html#StopElement.
This is used on "<stop>" elements.
| Class Members | ||
|---|---|---|
| Color | color {css::RGBA(0, 0, 0, 0xFF)} | Color of the gradient stop. |
| float | offset = 0.0 | Offset of the gradient stop, in the range [0, 1]. |
| float | opacity = 1.0f | Opacity of the gradient stop, in the range [0, 1]. |
| struct donner::svg::TransformOrigin |
| struct donner::svg::FrameTimings |
Per-frame performance instrumentation for RendererGeode.
Returned by RendererGeode::lastFrameTimings(). Each field reports the cost of the most recent beginFrame→endFrame window. Counters are the durable CI signal; the GPU-timestamp fields are advisory and require enableTimestamps(true) + driver support (see GeodeDevice).
See docs/design_docs/0030-geode_performance.md for the target ceilings each optimization milestone drives these toward.
| struct donner::svg::RenderViewport |
Describes the viewport for a render pass.
| 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. |
| struct donner::svg::PathShape |
Represents a resolved path along with its fill rule, transform, and layer index for boolean ops.
| Class Members | ||
|---|---|---|
| FillRule | fillRule = FillRule::NonZero | |
| int | layer = 0 | Layer index for boolean combination: paths on the same layer are unioned, layers are intersected. |
| Transform2d | parentFromEntity | Transform from clip path child to the clip path's coordinate system. |
| Path | path | |
| EntityHandle | sourceEntity | Source entity this path was derived from. Set by the driver at the drawPath call site (RendererDriver::traverseRange). Backends that cache per-entity state key off this (see GeodePathCacheComponent). A null EntityHandle (the default) means "no associated entity" — non-driver callers (overlay drawing, test harnesses) leave it null and backends fall back to the un-cached path. |
| struct donner::svg::PaintParams |
Paint state derived from resolved style for the current node.
| 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 | |
| Box2d | viewBox | View box used for unit resolution and gradient coordinate conversion. |
| struct donner::svg::ImageParams |
Parameters describing how an image should be drawn.
| Class Members | ||
|---|---|---|
| bool | imageRenderingPixelated = false | Whether to favor nearest-neighbor sampling for pixelated rendering. |
| double | opacity = 1.0 | |
| Box2d | targetRect | Destination rectangle in device-independent units. |
| struct donner::svg::TextParams |
Parameters describing how text is drawn and outlined.
| Class Members | ||
|---|---|---|
| DominantBaseline | dominantBaseline = DominantBaseline::Auto | |
| Color | fillColor = css::Color(css::RGBA()) | |
| span< const FontFace > | fontFaces | @font-face declarations for custom font resolution. |
| SmallVector< RcString, 1 > | fontFamilies | |
| FontMetrics | fontMetrics | |
| Lengthd | fontSize | |
| LengthAdjust | lengthAdjust = LengthAdjust::Default | |
| double | letterSpacingPx = 0.0 | Extra spacing added after each character (CSS letter-spacing). 0 = normal. |
| double | opacity = 1.0 | |
| Color | strokeColor = css::Color(css::RGBA()) | |
| StrokeParams | strokeParams | |
| TextAnchor | textAnchor = TextAnchor::Start | |
| TextDecoration | textDecoration = TextDecoration::None | |
| optional< Lengthd > | textLength | If set, stretches or compresses text to fill the given length. |
| entity | textRootEntity = entt::null | Entity of the text root element, for cached layout lookup. entt::null if unknown. |
| Box2d | viewBox | |
| double | wordSpacingPx = 0.0 | Extra spacing added after each word/space character (CSS word-spacing). 0 = normal. |
| WritingMode | writingMode = WritingMode::HorizontalTb | CSS writing-mode for this text element. Controls horizontal vs vertical text flow. |
| struct donner::svg::StrokeParams |
Stroke configuration used for path and primitive drawing.
| 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. |
| struct donner::svg::TerminalCapabilities |
| struct donner::svg::TerminalSize |
| struct donner::svg::TerminalCellSize |
| struct donner::svg::TerminalImageViewerConfig |
Rendering configuration for terminal output.
| Class Members | ||
|---|---|---|
| bool | autoScale = false | Automatically calculate scale based on terminal size. When true, the scale parameter is ignored and calculated dynamically. |
| bool | enableITermInlineImages = false | Use iTerm2 inline image protocol (supported by iTerm2, VSCode, WezTerm, and others). |
| string | imageName | Optional name for the image. When using iTerm inline images, this will be included in the protocol metadata. For text mode, this can be used as a caption. |
| int | maxTerminalHeight = 80 | Maximum terminal height to target when auto-scaling (rows). |
| int | maxTerminalWidth = 200 | Maximum terminal width to target when auto-scaling (columns). |
| TerminalPixelMode | pixelMode = TerminalPixelMode::kQuarterPixel | Pixel granularity. |
| double | scale = 0.67 | Overall scale factor for image size. Only used when autoScale=false. |
| bool | useTrueColor = true | Emit 24-bit ANSI sequences when true, fallback to 256-color when false. |
| double | verticalScaleFactor = 0.5 | Vertical scaling factor to compensate for terminal character aspect ratio (typically ~2:1 height/width). Default 0.5 accounts for typical terminal fonts. |
| struct donner::svg::TerminalImageView |
Image view describing an RGBA buffer.
| struct donner::svg::QuarterBlock |
Per-cell subpixel sampling for quarter-pixel mode.
| Class Members | ||
|---|---|---|
| RGBA | bottomLeft | |
| RGBA | bottomRight | |
| RGBA | topLeft | |
| RGBA | topRight | |
| struct donner::svg::HalfBlock |
Per-cell subpixel sampling for half-pixel mode.
| Class Members | ||
|---|---|---|
| RGBA | lower | |
| RGBA | upper | |
| struct donner::svg::TerminalCell |
Aggregated subpixel data for a terminal cell.
| Class Members | ||
|---|---|---|
| HalfBlock | half | |
| TerminalPixelMode | mode | |
| QuarterBlock | quarter | |
| struct donner::svg::FontMetadata |
Metadata extracted from a raw OpenType/TrueType font file.
| struct donner::svg::SvgImageContent |
Contains raw SVG document bytes, returned by ImageLoader when the referenced resource is an SVG image (image/svg+xml).
This must be parsed into an SVGDocument separately.
| Class Members | ||
|---|---|---|
| vector< uint8_t > | data | Raw SVG document bytes (XML text). |
| struct donner::svg::ImageResource |
Contains a decoded image resource in RGBA format.
| Class Members | ||
|---|---|---|
| vector< uint8_t > | data | Pixel data in RGBA format. |
| int | height | Height of the image, in pixels. |
| int | width | Width of the image, in pixels. |
| struct donner::svg::FontVMetrics |
| struct donner::svg::UnderlineMetrics |
| struct donner::svg::SubSuperMetrics |
| struct donner::svg::TextLayoutParams |
Layout-only parameters consumed by TextEngine.
| Class Members | ||
|---|---|---|
| DominantBaseline | dominantBaseline = DominantBaseline::Auto | |
| SmallVector< RcString, 1 > | fontFamilies | |
| FontMetrics | fontMetrics | |
| Lengthd | fontSize | |
| LengthAdjust | lengthAdjust = LengthAdjust::Default | |
| double | letterSpacingPx = 0.0 | |
| TextAnchor | textAnchor = TextAnchor::Start | |
| optional< Lengthd > | textLength | |
| Box2d | viewBox | |
| double | wordSpacingPx = 0.0 | |
| WritingMode | writingMode = WritingMode::HorizontalTb | |
| struct donner::svg::TextGlyph |
A single positioned glyph in a laid-out text run.
Produced by both TextLayout (simple backend) and TextShaper (full backend).
| struct donner::svg::TextRun |
A run of positioned glyphs sharing the same font.
| Class Members | ||
|---|---|---|
| FontHandle | font | Font handle for this run. |
| vector< TextGlyph > | glyphs | Positioned glyphs. |
| bool | onPath = false | True if glyphs are positioned along a textPath. |
| struct donner::svg::SampledImageInfo |
Sampled image dimensions and scaling for coordinate mapping.
| using donner::svg::GetInitialFn = std::optional<T> (*)() |
Callback function to get the initial value of a property.
The function returns a std::optional to allow for properties that have no initial value.
|
strong |
|
strong |
Values for the "clipPathUnits" attribute, https://drafts.fxtf.org/css-masking-1/#element-attrdef-clippath-clippathunits.
This is used on the "<clipPath>" element, and defines the coordinate system for the contents of the clip path.
|
strong |
The parsed result of the clip-rule property, see: https://drafts.fxtf.org/css-masking-1/#propdef-clip-rule.
|
strong |
|
strong |
CSS cursor types, defining which cursor the user agent should display.
|
strong |
The parsed result of the CSS 'display' property, see https://www.w3.org/TR/CSS2/visuren.html#propdef-display.
Note that in SVG2, there are only two distinct behaviors, 'none', and everything else rendered as normal, see https://www.w3.org/TR/SVG2/render.html#VisibilityControl
Elements that have any other display value than none are rendered as normal.
| Enumerator | |
|---|---|
| Inline | [DEFAULT] "inline": Causes an element to generate one or more inline boxes. |
| Block | "block": Causes an element to generate a block box. |
| ListItem | "list-item": Causes an element to act as a list item. |
| InlineBlock | "inline-block": Causes an element to generate an inline-level block container. |
| Table | "table": Specifies that an element defines a block-level table, see https://www.w3.org/TR/CSS2/tables.html#table-display. |
| InlineTable | "inline-table": Specifies that an element defines a inline-level table, see https://www.w3.org/TR/CSS2/tables.html#table-display. |
| TableRowGroup | "table-row-group": Specifies that an element groups one or more rows. |
| TableHeaderGroup | "table-header-group": Like 'table-row-group', but for visual formatting, the row group is always displayed before all other rows and row groups and after any top captions. |
| TableFooterGroup | "table-footer-group": Like 'table-row-group', but for visual formatting, the row group is always displayed after all other rows and row groups and before any bottom captions. |
| TableRow | "table-row": Specifies that an element is a row of cells. |
| TableColumnGroup | "table-column-group": Specifies that an element groups one or more columns. |
| TableColumn | "table-column": Specifies that an element is a column of cells. |
| TableCell | "table-cell": Specifies that an element represents a table cell. |
| TableCaption | "table-caption": Specifies a caption for the table. |
| None | "none": The element is not rendered. |
|
strong |
The parsed result of the dominant-baseline property.
Determines which baseline of the font is used to align the text.
|
strong |
SVG element types, corresponds to each XML element name, such as "<circle>", "<svg>", "<rect>", etc.
| Enumerator | |
|---|---|
| Circle | |
| ClipPath | |
| Defs | |
| Ellipse | |
| FeBlend | |
| FeColorMatrix | |
| FeComponentTransfer | |
| FeComposite | |
| FeConvolveMatrix | |
| FeDiffuseLighting | |
| FeDisplacementMap | |
| FeDistantLight | |
| FeDropShadow | |
| FeFlood | |
| FeFuncA | |
| FeFuncB | |
| FeFuncG | |
| FeFuncR | |
| FeGaussianBlur | |
| FeImage | |
| FeMerge | |
| FeMergeNode | |
| FeMorphology | |
| FeOffset | |
| FePointLight | |
| FeSpecularLighting | |
| FeSpotLight | |
| FeTile | |
| FeTurbulence | |
| Filter | |
| G | |
| Image | |
| Line | |
| LinearGradient | |
| Marker | |
| Mask | |
| Path | |
| Pattern | |
| Polygon | |
| Polyline | |
| RadialGradient | |
| Rect | |
| Stop | "<stop>", for gradient stops. |
| Style | |
| SVG | "<svg>", SVG root element. |
| Symbol | |
| Text | |
| TextPath | |
| TSpan | |
| Unknown | For unknown elements. |
| Use | |
|
strong |
Types of DOM events that can be dispatched through the SVG event system.
|
strong |
Values for the "filterUnits" attribute which defines the coordinate system for attributes x, y, width, height.
This is used on "<filter>" element.
|
strong |
The parsed result of the font-stretch property.
Values are ordered from narrowest to widest to allow relative keyword resolution.
|
strong |
|
strong |
|
strong |
Values for the gradient "spreadMethod" attribute, https://www.w3.org/TR/SVG2/pservers.html#LinearGradientElementSpreadMethodAttribute and https://www.w3.org/TR/SVG2/pservers.html#RadialGradientElementSpreadMethodAttribute.
Specifies what happens at the start or end of a gradient, when the gradient coordinates are inside the bounds of the referencing element.
This is used on "<linearGradient>" and "<radialGradient>" elements.
|
strong |
Values for the "gradientUnits" attribute, https://www.w3.org/TR/SVG2/pservers.html#LinearGradientElementGradientUnitsAttribute and https://www.w3.org/TR/SVG2/pservers.html#RadialGradientElementGradientUnitsAttribute.
This is used on "<linearGradient>" and "<radialGradient>" elements.
|
strong |
CSS image-rendering property values.
Controls the sampling filter used when a raster image is scaled.
|
strong |
|
strong |
Values for the "lengthAdjust" attribute, https://www.w3.org/TR/SVG2/text.html#TextElementLengthAdjustAttribute.
This is used on the "<text>" and "<tspan>" elements, and controls how the text is stretched, either by adding spacing between glyphs or also by stretching the glyphs themselves.
|
strong |
Values for the "markerUnits" attribute, https://www.w3.org/TR/SVG2/painting.html#MarkerUnitsAttribute.
This is used on the "<marker>" element, and defines the coordinate system for markerWidth, markerHeight, and the contents of the marker.
|
strong |
Values for the "maskContentUnits" attribute, https://drafts.fxtf.org/css-masking-1/#element-attrdef-mask-maskcontentunits.
This is used on the "<mask>" element, and defines the coordinate system for the contents of the mask.
|
strong |
Values for the "maskUnits" attribute, https://drafts.fxtf.org/css-masking-1/#element-attrdef-mask-maskunits.
This is used on the "<mask>" element, and defines the coordinate system for the x, y, width, and height attributes of the mask.
|
strong |
CSS mix-blend-mode property values for compositing blend modes.
Maps to tiny_skia::BlendMode values at the renderer level.
|
strong |
The parsed result of the CSS 'overflow' property, see https://www.w3.org/TR/CSS2/visufx.html#overflow and https://www.w3.org/TR/SVG2/render.html#OverflowAndClipProperties.
The 'overflow' property specifies whether to clip content, render scrollbars, or display content outside the element's box.
In SVG, the 'overflow' property applies to container elements and determines how to handle content that exceeds the bounds of the viewport.
|
strong |
PatternContentUnits controls the coordinate system of the children of the pattern:
With userSpaceOnUse, as the shape size changes, padding will be added between tiles. With objectBoundingBox, the tiles will be stretched to fill the shape.
| Enumerator | |
|---|---|
| UserSpaceOnUse | The children of the pattern are specified in the current user space where the pattern is referenced. |
| ObjectBoundingBox | The children of the pattern are specified as percentages of the object bounding box, where 0.0 is the left and 1.0 is the right, and similarly for the y axis. |
| Default | The default value, PatternContentUnits::UserSpaceOnUse. |
|
strong |
PatternUnits controls the coordinate system of the x/y/width/height attributes:
See also: PatternContentUnits
For example, both of these patterns appear the same when applied to a 50x50 shape, but the objectBoundingBox one changes based on the shape the pattern is applied to:
See also: PatternUnits
| Enumerator | |
|---|---|
| UserSpaceOnUse | The pattern's x/y/width/height attributes are specified in the current user space where the pattern is referenced. |
| ObjectBoundingBox | The pattern's x/y/width/height attributes are specified as percentages of the object bounding. |
| Default | The default value, PatternUnits::ObjectBoundingBox. |
|
strong |
Values for the 'pointer-events' property, which defines how mouse events interact with an element.
|
strong |
Values for the "primitiveUnits" attribute which specifies the coordinate system for the various length values within the filter primitives and for the attributes that define the filter primitive subregion.
This is used on "<filter>" element.
| Enumerator | |
|---|---|
| UserSpaceOnUse | If primitiveUnits is equal to userSpaceOnUse, any length values within the filter definitions represent values in the current local coordinate system in place at the time when the "<filter>" element is referenced (i.e., the user coordinate system for the element referencing the filter element via a filter property). |
| ObjectBoundingBox | If primitiveUnits is equal to objectBoundingBox, then any length values within the filter definitions represent fractions or percentages of the bounding box on the referencing element (see object bounding box units). Note that if only one number was specified in a <number-optional-number> value this number is expanded out before the primitiveUnits computation takes place. |
| Default | The default value for the "primitiveUnits" attribute, which is userSpaceOnUse. |
|
strong |
SVG document processing mode, per SVG2 §2.7.1.
Controls which features are available when processing a document. Sub-documents referenced by <image> are loaded in SecureStatic or SecureAnimated mode to prevent external resource loading and script execution.
|
strong |
Defines how this property cascades between the parent and child elements.
| Enumerator | |
|---|---|
| None | Property does not inherit. |
| Inherit | Property inherits unconditionally. |
| PaintInherit | Property inherits unless the child is instantiated as a paint server. This is handled as a special case to prevent recursion for "<pattern>". |
|
strong |
Options to control how inheritance is performed, to either inherit everything or conditionally disable inheritance of paint servers.
| Enumerator | |
|---|---|
| All | Inherit everything (default). |
| NoPaint | Inherit everything except paint servers, for "<pattern>" elements. |
|
strong |
The current property state, which can be either set, not set, or a specific CSS keyword such as "inherit", "initial", or "unset".
|
strong |
|
strong |
The parsed result of the 'stroke-linecap' property, see: https://www.w3.org/TR/SVG2/painting.html#StrokeLinecapProperty.
|
strong |
The parsed result of the 'stroke-linejoin' property, see: https://www.w3.org/TR/SVG2/painting.html#StrokeLinejoinProperty.
|
strong |
|
strong |
Bitmask for the text-decoration property line types.
Values can be combined: Underline | Overline represents both an underline and overline. The CSS text-decoration shorthand parses space-separated values into this bitmask.
| Enumerator | |
|---|---|
| None | [DEFAULT] No text decoration. |
| Underline | Draw a line below the text. |
| Overline | Draw a line above the text. |
| LineThrough | Draw a line through the middle of the text. |
|
strong |
Enum of possible errors that can occur when loading an image.
|
strong |
The parsed result of the 'visibility' property, see: https://www.w3.org/TR/CSS2/visufx.html#propdef-visibility.
This determines whether the element is visible or hidden, and whether it affects layout.
| Enumerator | |
|---|---|
| Visible | [DEFAULT] Visible is the default value. |
| Hidden | Hidden elements are invisible, but still affect layout. |
| Collapse | Collapsed elements are invisible, and do not affect layout. |
|
strong |
CSS writing-mode property values, controlling the direction of text flow.
SVG1 values (lr-tb, rl-tb, tb-rl, etc.) are mapped to these CSS3 equivalents during parsing.
| Enumerator | |
|---|---|
| HorizontalTb | [DEFAULT] Left-to-right, top-to-bottom (horizontal text). |
| VerticalRl | Top-to-bottom, right-to-left (vertical CJK style). |
| VerticalLr | Top-to-bottom, left-to-right. |
| void donner::svg::ApplyFilterGraphToPixmap | ( | tiny_skia::Pixmap & | pixmap, |
| const components::FilterGraph & | filterGraph, | ||
| const Transform2d & | deviceFromFilter, | ||
| const std::optional< Box2d > & | filterRegion, | ||
| bool | clipSourceToFilterRegion = false, | ||
| const tiny_skia::Pixmap * | fillPaintInput = nullptr, | ||
| const tiny_skia::Pixmap * | strokePaintInput = nullptr ) |
Applies a Donner filter graph to a premultiplied RGBA pixmap in place.
| pixmap | Premultiplied RGBA pixmap containing SourceGraphic on entry. |
| filterGraph | Filter graph to execute. |
| deviceFromFilter | Transform from filter local coordinates to device coordinates. |
| filterRegion | Optional filter region in filter local coordinates. |
| clipSourceToFilterRegion | If true, clip pixmap's contents to filterRegion before running the filter graph. |
| fillPaintInput | Optional FillPaint input pixmap, or nullptr if unused. |
| strokePaintInput | Optional StrokePaint input pixmap, or nullptr if unused. |
| std::string donner::svg::BuildCssSelectorPath | ( | const SVGElement & | element | ) |
Build a CSS-like selector path for an element.
| element | Element to describe. |
| std::tuple< Lengthd, double > donner::svg::CalculateRadiusMaybeAuto | ( | const Property< Lengthd > & | property, |
| const Property< Lengthd > & | fallbackProperty, | ||
| const Box2d & | viewBox, | ||
| const FontMetrics & | fontMetrics ) |
Calculates the the radius for elements with rx and ry radius, in pixels, taking into account the "auto" identifier and handling negative values.
This is used for "<rect>" or "<ellipse>".
| property | The property to compute, the storage for either rx or ry. |
| fallbackProperty | The other property to use if the first one is "auto". |
| viewBox | The viewBox to use for computing the length. |
| fontMetrics | The font metrics to use for computing the length. |
| void donner::svg::ClipFilterOutputToRegion | ( | tiny_skia::Pixmap & | pixmap, |
| const std::optional< Box2d > & | filterRegion, | ||
| const Transform2d & | deviceFromFilter ) |
Clears pixels outside the transformed filter region.
| pixmap | Premultiplied RGBA pixmap to modify in place. |
| filterRegion | Optional filter region in filter local coordinates. |
| deviceFromFilter | Transform from filter local coordinates to device coordinates. |
| void donner::svg::CompositeAABBRect | ( | RendererBitmap & | bitmap, |
| const Box2d & | bounds, | ||
| const SampledImageInfo & | imageInfo ) |
Draw a 1-sub-pixel blue AABB outline directly into the bitmap, aligned to the terminal sub-pixel grid.
| bitmap | Bitmap to draw into (modified in-place). |
| bounds | AABB in image coordinates. |
| imageInfo | Terminal sampling info for sub-pixel alignment. |
|
nodiscard |
Flatten a resolved paint server if it points at a materialized linear or radial gradient.
| paint | The resolved paint server to inspect. |
| components::ResolvedPaintServer donner::svg::MaterializeResolvedGradient | ( | Registry & | registry, |
| const ResolvedGradientData & | gradient ) |
Materialize a resolved gradient payload into a fresh ECS paint server entity.
| registry | Registry that will own the temporary paint server entity. |
| gradient | Gradient payload to materialize. |
|
inline |
| std::ostream & donner::svg::operator<< | ( | std::ostream & | os, |
| const Property< T, kCascade > & | property ) |
Ostream output operator, which outputs the current property value, how it was set (e.g.
directly set or inherited, see PropertyState), and the property's specificity.
Example output:
| os | Output stream to write to. |
| property | Property to output. |
| std::optional< FontMetadata > donner::svg::ParseFontMetadata | ( | std::span< const uint8_t > | data | ) |
Parse CSS-relevant metadata from a raw OpenType/TrueType font file.
| data | Raw font bytes. |
|
nodiscard |
Convert tightly-packed straight-alpha RGBA8 to premultiplied RGBA8.
| rgbaPixels | Straight-alpha RGBA bytes (size must be a multiple of 4). |
| int donner::svg::RunDonnerSvgTool | ( | int | argc, |
| char * | argv[], | ||
| std::ostream & | out, | ||
| std::ostream & | err ) |
Run the donner-svg command line tool.
| argc | Number of command line arguments. |
| argv | Command line arguments. |
| out | Output stream for normal user-facing output. |
| err | Output stream for errors. |
| ReturnType donner::svg::ToConstexpr | ( | ElementType | type, |
| FnT | fn ) |
Converts a ElementType runtime value to a compile-time value, allowing conditional behavior for different element types with constexpr.
Takes the runtime value and invokes a function with std::integral_constant<ElementType> as a parameter.
Example 1:
Example 2:
| ReturnType | Return type of the function. |
| FnT | Function type, with signature ReturnType(std::integral_constant<ElementType>). |
| type | Runtime element type. |
| fn | Function to call with the compile-time element type, with signature ReturnType(std::integral_constant<ElementType>). |
|
nodiscard |
Non-mutating variant of UnpremultiplyRgbaInPlace that allocates. Prefer the in-place form on hot paths; use this when the caller needs to preserve the input.
| rgbaPixels | Premultiplied RGBA bytes (size must be a multiple of 4). |
| void donner::svg::UnpremultiplyRgbaInPlace | ( | std::vector< std::uint8_t > & | rgba | ) |
Convert tightly-packed premultiplied RGBA8 to straight-alpha RGBA8, in place. Fully-opaque pixels (alpha == 255) are unchanged; fully-transparent pixels (alpha == 0) become (0, 0, 0, 0).
| rgba | Premultiplied RGBA bytes (size must be a multiple of 4). |
|
constexpr |
The user agent stylesheet to be used by default on all SVG documents.