Accumulates each primitive's input reach in device pixels, converting lengths with the same helpers and bounds the filter executors use. The executors round each primitive to whole pixels (offsets and morphology radii to the nearest pixel, blur kernels up), so each primitive's reach rounds up to whole pixels before the chain adds them.
More...
#include "donner/svg/renderer/FilterRegionContext.h"
|
| double | length (double value, int axis) const |
| | Device length of a nonnegative primitive length.
|
| Vector2d | footprint (Vector2d axisPixels) const |
| | Device footprint of a reach measured in pixels along each filter axis. Under rotation or skew, the transformed blur path samples along the filter axes, which land on slanted device directions: each device axis gets the absolute linear coefficients times the user-space reach. Primitives that execute on the device raster read along the device axes instead, so the footprint keeps at least the per-axis reach.
|
| Vector2d | offset (double dx, double dy) const |
| | Device extent of a primitive offset.
|
| double | user (double value, int axis) const |
| | User-space value of a primitive length or offset.
|
| Vector2d | localToDevice (Vector2d localPixels) const |
| | Device extent of local raster pixels, mapped through the filter's linear part.
|
| Vector2d | offsetReach (double dx, double dy) const |
| | Reach of an offset: rounded to whole device pixels on the device raster, or rounded to whole local pixels on the local raster and mapped back.
|
| Vector2d | blurReach (double stdDeviationX, double stdDeviationY) const |
| | Reach of a blur: three standard deviations, rounded up to whole pixels on the device raster or on the local raster.
|
|
void | add (const components::filter_primitive::GaussianBlur &blur) |
| | Wrapping edges read the opposite side of the input, which may lie anywhere in the region.
|
|
void | add (const components::filter_primitive::DropShadow &shadow) |
|
void | add (const components::filter_primitive::Offset &value) |
|
void | add (const components::filter_primitive::Morphology &morphology) |
|
void | add (const components::filter_primitive::DisplacementMap &displacement) |
| | The backends disagree on how displacement scales: one applies the scale directly in raster pixels, the other multiplies it by the transform's area scale. Bound both. Both sample bilinearly, reading one pixel past the rounded-down displaced position.
|
|
void | add (const components::filter_primitive::ConvolveMatrix &convolve) |
| | Wrapping edges read the opposite side of the input, which may lie anywhere in the region.
|
|
void | add (const components::filter_primitive::DiffuseLighting &) |
| | Surface normals read the neighboring pixels.
|
|
void | add (const components::filter_primitive::SpecularLighting &) |
| | Surface normals read the neighboring pixels.
|
|
template<typename T> |
| void | add (const T &) |
| | Point-wise primitives read only the input pixel under each output pixel.
|
|
void | addTile (const components::FilterNode *input) |
| | feTile repeats its input's subregion, so the capture must cover that whole rectangle. It is known here only when the input primitive authors its region in user-space units; otherwise the tile may read anywhere in the filter region.
|
|
|
Transform2d | deviceFromFilter |
| | Filter user space to raster pixels.
|
|
Vector2d | scale |
| | Device scale of each filter axis.
|
|
Vector2d | localScale |
| | Scale of the transformed path's local raster.
|
|
Vector2d | bounds |
| | Element bounding box size, or 1 without one.
|
|
bool | objectBounds = false |
| | Whether primitive lengths are bounding-box fractions.
|
|
FilterInputMargin | margin |
| | Accumulated margin.
|
Accumulates each primitive's input reach in device pixels, converting lengths with the same helpers and bounds the filter executors use. The executors round each primitive to whole pixels (offsets and morphology radii to the nearest pixel, blur kernels up), so each primitive's reach rounds up to whole pixels before the chain adds them.
Blur-family graphs under rotation or skew may instead run on the transformed path's local raster, scaled by each filter axis's length, where blurs and offsets round in local pixels before the result maps back to the device. Their reach is the larger of the two.
◆ blurReach()
| Vector2d donner::svg::FilterInputMarginBuilder::blurReach |
( |
double | stdDeviationX, |
|
|
double | stdDeviationY ) const |
|
inline |
Reach of a blur: three standard deviations, rounded up to whole pixels on the device raster or on the local raster.
- Parameters
-
| stdDeviationX | X deviation. |
| stdDeviationY | Y deviation. |
◆ footprint()
| Vector2d donner::svg::FilterInputMarginBuilder::footprint |
( |
Vector2d | axisPixels | ) |
const |
|
inline |
Device footprint of a reach measured in pixels along each filter axis. Under rotation or skew, the transformed blur path samples along the filter axes, which land on slanted device directions: each device axis gets the absolute linear coefficients times the user-space reach. Primitives that execute on the device raster read along the device axes instead, so the footprint keeps at least the per-axis reach.
- Parameters
-
| axisPixels | Reach in pixels along the filter X and Y axes. |
◆ length()
| double donner::svg::FilterInputMarginBuilder::length |
( |
double | value, |
|
|
int | axis ) const |
|
inline |
Device length of a nonnegative primitive length.
- Parameters
-
◆ localToDevice()
| Vector2d donner::svg::FilterInputMarginBuilder::localToDevice |
( |
Vector2d | localPixels | ) |
const |
|
inline |
Device extent of local raster pixels, mapped through the filter's linear part.
- Parameters
-
| localPixels | Signed local raster pixels along each filter axis. |
◆ offset()
| Vector2d donner::svg::FilterInputMarginBuilder::offset |
( |
double | dx, |
|
|
double | dy ) const |
|
inline |
Device extent of a primitive offset.
- Parameters
-
◆ offsetReach()
| Vector2d donner::svg::FilterInputMarginBuilder::offsetReach |
( |
double | dx, |
|
|
double | dy ) const |
|
inline |
Reach of an offset: rounded to whole device pixels on the device raster, or rounded to whole local pixels on the local raster and mapped back.
- Parameters
-
◆ user()
| double donner::svg::FilterInputMarginBuilder::user |
( |
double | value, |
|
|
int | axis ) const |
|
inline |
User-space value of a primitive length or offset.
- Parameters
-
◆ wholePixels()
Round a reach up to whole pixels.
- Parameters
-
The documentation for this struct was generated from the following file: