Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
FilterRegionContext.h File Reference
#include <algorithm>
#include <cmath>
#include <string>
#include <unordered_map>
#include <variant>
#include "donner/base/MathUtils.h"
#include "donner/base/Transform.h"
#include "donner/svg/components/animation/AnimationValueSampler.h"
#include "donner/svg/components/filter/FilterGraph.h"
Include dependency graph for FilterRegionContext.h:

Classes

struct  donner::svg::FilterRegionSample
 Resolved clipping bounds and optional un-clipped animated geometry, in user coordinates. More...
struct  donner::svg::FilterRegionContext
 Per-invocation filter coordinates and subregion history, independent of GPU resources. 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.

Functions

double donner::svg::BoundedPositiveFilterPixels (double value)
 Clamp a finite nonnegative radius to the filter-work bound.
double donner::svg::BoundedSignedFilterPixels (double value)
 Clamp a finite offset to the filter-work bound.
size_t donner::svg::FilterInputSlotCount (const components::FilterNode &node)
 The number of inputs a primitive reads through the filter attribute surface. feComposite, feBlend and feDisplacementMap each take a second input (in2); feMerge is variadic and reads exactly the list it was built with, and every other primitive reads at most one input. The cap of two is deliberate rather than a lower bound: those primitives never sample a third input, so an extra entry a caller appends must not widen the node's subregion either.
components::FilterInput donner::svg::FilterInputOrDefault (const components::FilterNode &node, size_t index)
 The input in slot index, or the default for a slot the graph left empty. A slot the graph never populated is an unspecified in/in2 attribute, and both resolve the same way: to the preceding primitive's result, which is SourceGraphic only when this node is the first primitive in the filter. Falling back to the node's own first input instead would silently composite, blend, or displace a buffer against itself.
double donner::svg::FilterDeviceScaleX (const Transform2d &transform)
 Device scale of the filter X axis.
double donner::svg::FilterDeviceScaleY (const Transform2d &transform, double scaleX)
 Device scale of the filter Y axis.
double donner::svg::FilterLengthInPixels (double value, double bound, double scale, bool objectBounds)
 Resolve an effect length in device pixels.
Vector2d donner::svg::FilterOffsetInPixels (Vector2d offset, Vector2d bounds, bool objectBounds, const Transform2d &transform)
 Resolve a filter offset vector in device coordinates.
std::optional< Transform2d > donner::svg::FiniteFilterInverse (const Transform2d &deviceFromFilter)
 Invert only finite, nonsingular transforms whose inverse remains finite.

Class Documentation

◆ donner::svg::FilterRegionSample

struct donner::svg::FilterRegionSample

Resolved clipping bounds and optional un-clipped animated geometry, in user coordinates.

Class Members
optional< Box2d > animatedRegion Un-clipped region for image placement when sampled.
Box2d bounds Clip region, intersected with the filter region.