|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
#include <algorithm>#include <cstddef>#include <cstdint>#include <memory>#include <optional>#include <type_traits>#include <variant>#include <vector>#include "donner/base/Box.h"#include "donner/base/EcsRegistry_fwd.h"#include "donner/base/Length.h"#include "donner/base/RcString.h"#include "donner/css/Color.h"#include "donner/svg/SVGDocumentHandle.h"#include "donner/svg/components/filter/FilterUnits.h"#include "donner/svg/core/ColorInterpolationFilters.h"#include "donner/svg/core/ImageRendering.h"#include "donner/svg/core/PreserveAspectRatio.h"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. | |
| namespace | donner::svg::components |
| Contains the implementation of the Donner ECS,. | |
| namespace | donner::svg::components::filter_primitive |
| Variant holding the parameters for each type of filter primitive. | |
Typedefs | |
| using | donner::svg::components::FilterPrimitive |
| Variant holding any filter primitive type. | |
Enumerations | |
| enum class | donner::svg::components::FilterStandardInput : std::uint8_t { donner::svg::components::SourceGraphic , donner::svg::components::SourceAlpha , donner::svg::components::FillPaint , donner::svg::components::StrokePaint } |
| Standard named inputs available to filter primitives. More... | |
| enum class | donner::svg::components::FilterMemoryModel : std::uint8_t { donner::svg::components::CpuFloatNamedResults , donner::svg::components::GpuAllNodes } |
| Intermediate-retention behavior used to estimate backend memory before filter execution. More... | |
Functions | |
| std::uint64_t | donner::svg::components::FilterPrimitivePayloadBytes (const FilterPrimitive &primitive) |
| Dynamic numeric storage retained by one primitive payload. | |
| bool | donner::svg::components::FilterGraphExecutionCost (const FilterGraph &graph, std::uint64_t pixelCount, FilterMemoryModel memoryModel, std::uint64_t &workUnitsOut, std::uint64_t &intermediateBytesOut) |
| Estimate a filter graph's aggregate execution cost for a pixel surface. | |
| bool | donner::svg::components::FilterGraphFitsExecutionBudget (const FilterGraph &graph, std::uint64_t pixelCount, FilterMemoryModel memoryModel) |
| Return whether one filter graph fits the execution budget for a pixel surface. | |
Variables | |
| constexpr double | donner::svg::components::kMaximumFilterOffset = 4096.0 |
| Maximum accepted user-space filter offset magnitude. | |
| constexpr double | donner::svg::components::kMaximumFilterStdDeviation = 256.0 |
| Maximum accepted user-space blur standard deviation. | |
| constexpr double | donner::svg::components::kMaximumFilterMorphologyRadius = 256.0 |
| Maximum accepted user-space morphology radius. | |
| constexpr int | donner::svg::components::kMaximumFilterPixelOffset = 4096 |
| Maximum filter offset after conversion to device pixels. | |
| constexpr int | donner::svg::components::kMaximumFilterPixelRadius = 256 |
| Maximum blur standard deviation or morphology radius after conversion to device pixels. | |
| constexpr std::uint64_t | donner::svg::components::kMaximumFilterMorphologyPassesPerAxis = 9 |
| Geode decomposes morphology into shader passes whose per-axis radius is at most 31. | |
| constexpr std::uint64_t | donner::svg::components::kMaximumFilterMorphologyWorkMultiplier |
| constexpr std::uint64_t | donner::svg::components::kMaximumFilterMorphologyRetainedBuffers |
| constexpr int | donner::svg::components::kMaximumFilterSurfaceDimension = 4096 |
| Maximum dimension of a filter-specific intermediate surface. | |
| constexpr std::size_t | donner::svg::components::kMaximumFilterSurfacePixels = 12 * 1024 * 1024 |
| Maximum pixel area of a filter-specific intermediate surface. | |
| constexpr std::size_t | donner::svg::components::kMaximumFilterGraphNodes = 32 |
| Maximum number of primitives retained in one computed filter graph. | |
| constexpr std::size_t | donner::svg::components::kMaximumFilterMergeInputs = 16 |
| Maximum number of inputs composited by one feMerge primitive. | |
| constexpr std::size_t | donner::svg::components::kMaximumFilterTableValues = 1024 |
| Maximum number of samples accepted for one feComponentTransfer channel table. | |
| constexpr std::size_t | donner::svg::components::kMaximumFilterColorMatrixValues = 20 |
| Maximum numeric payload accepted for feColorMatrix (the 5-by-4 matrix form). | |
| constexpr int | donner::svg::components::kMaximumFilterConvolveOrder = 64 |
| Maximum convolve order on either axis and aggregate kernel payload. | |
| constexpr std::size_t | donner::svg::components::kMaximumFilterKernelValues |
| constexpr std::uint64_t | donner::svg::components::kMaximumFilterWorkUnits = 256ULL * 1024 * 1024 |
| Maximum aggregate pixel operations accepted for one filter execution. | |
| constexpr std::uint64_t | donner::svg::components::kMaximumFilterFrameWorkUnits = 512ULL * 1024 * 1024 |
| Maximum aggregate pixel operations accepted across one rendered frame. | |
| constexpr std::uint64_t | donner::svg::components::kMaximumFilterIntermediateBytes = 256ULL * 1024 * 1024 |
| Maximum estimated bytes retained by filter intermediates during one execution. | |
| constexpr std::uint64_t | donner::svg::components::kMaximumFilterFrameBytes = 256ULL * 1024 * 1024 |
| Maximum filter memory reserved across one frame, including RGBA capture surfaces. | |
| constexpr double | donner::svg::components::kMaximumFilterTurbulenceFrequency = 1024.0 |
| Maximum accepted feTurbulence base-frequency magnitude. | |
| constexpr double | donner::svg::components::kMaximumFilterTurbulenceSeed = 2147483646.0 |
| Maximum accepted feTurbulence seed magnitude (Park-Miller modulus minus one). | |
| constexpr int | donner::svg::components::kMaximumFilterTurbulenceOctaves = 16 |
| Maximum accepted feTurbulence octave count. | |
| struct donner::svg::components::FilterInput::Previous |
The input is the output of the immediately preceding primitive (or SourceGraphic for the first primitive).
| struct donner::svg::components::FilterInput::Named |
The input is a named result from a prior primitive's result attribute.
| Class Members | ||
|---|---|---|
| RcString | name | The result name to reference. |
| struct donner::svg::components::filter_primitive::Flood |
| struct donner::svg::components::filter_primitive::Offset |
| struct donner::svg::components::filter_primitive::Merge |
Parameters for feMerge. Children are represented as additional inputs on the FilterNode.
| struct donner::svg::components::filter_primitive::DropShadow |
Parameters for feDropShadow.
| Class Members | ||
|---|---|---|
| double | dx = 2.0 | Horizontal offset. |
| double | dy = 2.0 | Vertical offset. |
| Color | floodColor {css::RGBA(0, 0, 0, 0xFF)} | Shadow color (default: black). |
| double | floodOpacity = 1.0 | Shadow opacity (default: 1). |
| double | stdDeviationX = 2.0 | Blur standard deviation X. |
| double | stdDeviationY = 2.0 | Blur standard deviation Y. |
| struct donner::svg::components::filter_primitive::ComponentTransfer::Func |
A single channel's transfer function.
| Class Members | ||
|---|---|---|
| double | amplitude = 1.0 | Amplitude (for gamma). |
| double | exponent = 1.0 | Exponent (for gamma). |
| double | intercept = 0.0 | Intercept (for linear). |
| double | offset = 0.0 | Offset (for gamma). |
| double | slope = 1.0 | Slope (for linear). |
| vector< double > | tableValues | Table values (for table/discrete). |
| FuncType | type = FuncType::Identity | Function type. |
| struct donner::svg::components::filter_primitive::Tile |
Parameters for feTile.
| struct donner::svg::components::filter_primitive::DiffuseLighting |
Parameters for feDiffuseLighting.
| Class Members | ||
|---|---|---|
| double | diffuseConstant = 1.0 | Diffuse reflection constant. |
| optional< LightSource > | light | Light source (from child element). |
| Color | lightingColor {css::RGBA(0xFF, 0xFF, 0xFF, 0xFF)} | Light color (default: white). |
| double | surfaceScale = 1.0 | Height of surface. |
| struct donner::svg::components::filter_primitive::SpecularLighting |
Parameters for feSpecularLighting.
| Class Members | ||
|---|---|---|
| optional< LightSource > | light | Light source (from child element). |
| Color | lightingColor {css::RGBA(0xFF, 0xFF, 0xFF, 0xFF)} | Light color (default: white). |
| double | specularConstant = 1.0 | Specular reflection constant. |
| double | specularExponent = 1.0 | Specular exponent (1..128). |
| double | surfaceScale = 1.0 | Height of surface. |
| struct donner::svg::components::FilterNode |
A single node in the filter graph, representing one filter primitive.
Nodes are executed in document order. Each node reads from its inputs (which may be standard inputs like SourceGraphic, or outputs of prior nodes), applies its primitive operation, and writes to an output buffer.
| Class Members | ||
|---|---|---|
| optional< ColorInterpolationFilters > | colorInterpolationFilters | Per-primitive color-interpolation-filters. When set, overrides the graph-level default. |
| optional< Lengthd > | height | Primitive subregion height. |
| vector< FilterInput > | inputs | Input(s) to this primitive. A slot this list leaves unpopulated resolves exactly like an unspecified in/in2 attribute: to the previous primitive's result, and to SourceGraphic only when the node is the first primitive in the graph. A Composite, Blend, or DisplacementMap node built with a single input therefore reads the previous result as its second input, never the source graphic. |
| FilterPrimitive | primitive | The filter primitive operation. |
| optional< RcString > | result | Named output (for result attribute). |
| optional< Lengthd > | width | Primitive subregion width. |
| optional< Lengthd > | x | Primitive subregion X. |
| optional< Lengthd > | y | Primitive subregion Y. |
| struct donner::svg::components::FilterExecutionBudget::Reservation |
Successful preflight reservation made before allocating a filter capture surface.
| Class Members | ||
|---|---|---|
| bool | active = false | |
| uint64_t | captureBytes = 0 | |
| FilterMemoryModel | memoryModel = FilterMemoryModel::CpuFloatNamedResults | |