pub struct PaddingIn { /* private fields */ }Expand description
A numeric field whose value decides how much canvas padding the graph needs — a blur’s sigma, a morphology radius, a warp amplitude.
Padding is fixed before evaluation starts, so the build has to know an
upper bound for these. A literal or a $param with a declared max
carries one (In::static_bound); an @node port does not, and used
to be rejected outright — which left no way to drive a blur from a
math chain, since a computed value cannot be a param.
So the bound becomes something the style can state on its own, as a
literal <field>-max sibling. Padding is computed from that, and the
value the port produces is clamped to it at render time: the canvas
cannot grow mid-render, so a larger value would read past the margin
and clamp the tile’s edge pixels instead. Clamping is reported once
per node — quietly weakening a filter the style asked for is worth a
line in the log, but not one per tile.
Implementations§
Source§impl PaddingIn
impl PaddingIn
Sourcepub fn read(
r: &mut InReader<'_, '_>,
fields: &Map<String, Value>,
field: &'static str,
) -> Result<Self, FactoryError>
pub fn read( r: &mut InReader<'_, '_>, fields: &Map<String, Value>, field: &'static str, ) -> Result<Self, FactoryError>
Read a required padding-determining field.
Sourcepub fn read_or(
r: &mut InReader<'_, '_>,
fields: &Map<String, Value>,
field: &'static str,
default: f64,
) -> Result<Self, FactoryError>
pub fn read_or( r: &mut InReader<'_, '_>, fields: &Map<String, Value>, field: &'static str, default: f64, ) -> Result<Self, FactoryError>
Read an optional padding-determining field with a default.
Sourcepub fn from_value(
value: In<f64>,
fields: &Map<String, Value>,
field: &'static str,
) -> Result<Self, FactoryError>
pub fn from_value( value: In<f64>, fields: &Map<String, Value>, field: &'static str, ) -> Result<Self, FactoryError>
Pair an already-read In with its bound — for fields whose value
comes from a fallback chain (amp-px seeding amp-x-px).
Sourcepub fn get(
&self,
ctx: &EvalCtx<'_>,
inputs: &[Option<PortValue>],
) -> Result<f64, EvalError>
pub fn get( &self, ctx: &EvalCtx<'_>, inputs: &[Option<PortValue>], ) -> Result<f64, EvalError>
The value for this render, clamped to PaddingIn::bound.