API reference

aster_blueprint::effects

Pre-1.0: signatures are not frozen. Generated from rustdoc JSON of the compiled crate; rustdoc JSON format version 60. Only public items are listed.

Typed visual-effect kernels over the existing aster-ui vector and effect facilities.

Nothing here rasterizes. Shape and stroke kernels build ONE existing Recorder::vector command (VectorGeometry + VectorStroke, painted by the renderer's admitted vector workspace). Shadow, glow, inner-shadow and radial-gradient kernels build a cold EffectGraph, prepare it once at an explicit preparation scale and carry the resulting EffectDrawing as ONE Recorder::effect command. All of them yield an ordinary Arc<Recording> (ValueType::Drawing), so they flow through the existing retained / material-layer / renderer-admission paths unchanged.

Two honest consequences, both enforced by the renderer and not hidden here:

  • vector drawings need Renderer::enable_vectors (see [recommended_vector_limits]); without it the renderer refuses them;
  • effect drawings are baked at scale (default 1) and FastSrgb; the renderer refuses to paint them into an Output with another scale or colour processing.

Every parameter is validated before anything is built; a refusal is the exact aster_ui::Error (InvalidGeometry for non-finite, negative or empty values, Capacity for blur/ink bounds beyond the limits below).

Structs

structaster_blueprint::effects::Dash

pub struct Dash { /* see fields */ }

Optional dash pattern: dash == 0 is solid; otherwise both must be > 0.

Public fields

fieldtype
dashf64
gapf64

Methods

  • const SOLID: Dash
  • fn new(dash: f64, gap: f64) -> Result<Self, Error>

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::effects::DropShadow

pub struct DropShadow { /* see fields */ }

Parameters of [drop_shadow]. The shadow is the silhouette of the (0, 0, width, height) rounded rect, grown by spread (negative shrinks), moved by offset, blurred by Gaussian sigma and tinted color.

Public fields

fieldtype
widthf64
heightf64
radiusf64
offset[f64; 2]
sigmaf64
spreadf64
coloraster_ui::Srgb8
scalef64
knockoutboolRemove the shadow where the (unmoved, ungrown) shape itself is, like a CSS box-shadow: a translucent body shows no shadow through it. false keeps the full blurred silhouette (the pre-1.x behaviour). Catalog default: on.

Trait implementations: Clone, Copy, Debug

structaster_blueprint::effects::Glow

pub struct Glow { /* see fields */ }

Parameters of [glow]: a centered, offset-free halo of the rounded rect grown by spread, blurred by sigma, tinted color, scaled by intensity in 0..=1.

Public fields

fieldtype
widthf64
heightf64
radiusf64
sigmaf64
spreadf64
coloraster_ui::Srgb8
intensityf64
scalef64
knockoutboolGlow only outside the shape (alpha knock-out of the unmoved, ungrown shape); false lets it bleed through the body. Catalog default: on.

Trait implementations: Clone, Copy, Debug

structaster_blueprint::effects::InnerShadow

pub struct InnerShadow { /* see fields */ }

Parameters of [inner_shadow]: the blurred, offset complement of the shape, kept only inside the shape.

Public fields

fieldtype
widthf64
heightf64
radiusf64
offset[f64; 2]
sigmaf64
coloraster_ui::Srgb8
scalef64

Trait implementations: Clone, Copy, Debug

structaster_blueprint::effects::Port

pub struct Port { /* see fields */ }

One declared input of an effect kernel.

Public fields

fieldtype
name&'static str
value_typemodel::ValueType
defaultOption<f64>A scalar/length default, when the port is optional.

Trait implementations: Clone, Copy, Debug

structaster_blueprint::effects::ShadowPair

pub struct ShadowPair { /* see fields */ }

Parameters of [shadow_pair]: the two shadows of a soft (neumorphic) surface.

Public fields

fieldtype
widthf64
heightf64
radiusf64
offset[f64; 2]The offset of the dark shadow (down-right); the light one is its mirror.
sigmaf64Sigma of both shadows (logical px).
lightaster_ui::Srgb8The light shadow (up-left).
darkaster_ui::Srgb8The dark shadow (down-right).
scalef64

Trait implementations: Clone, Copy, Debug

Enums

enumaster_blueprint::effects::EffectKind

pub enum EffectKind { Ellipse, Circle, Stroke, StrokeEllipse, DropShadow, Glow, InnerShadow, RadialGradient }

The effect kernels. Names and ports are the single source of truth for both the catalog definitions and the runtime signature check.

Methods

  • const ALL: [EffectKind; 8]
  • fn name(self) -> &'static str
  • fn from_name(name: &str) -> Option<Self>
  • fn inputs(self) -> &'static [Port]
  • fn evaluate(self, args: &[RuntimeValue]) -> Result<Recording, Error> — Evaluate against already type-admitted inputs (declared port order). A shape mismatch is Error::InvalidGeometry, never a fixup.

Variants

  • Ellipse
  • Circle
  • Stroke
  • StrokeEllipse
  • DropShadow
  • Glow
  • InnerShadow
  • RadialGradient

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

Functions

fnaster_blueprint::effects::alignment

pub fn alignment(text: &str) -> Result<aster_ui::VectorStrokeAlignment, aster_ui::Error>

"inside", "center" or "outside"; anything else is refused.

fnaster_blueprint::effects::circle

pub fn circle(radius: f64, color: aster_ui::Srgb8) -> Result<aster_ui::Recording, aster_ui::Error>

A filled circle of radius in (0, 0, 2r, 2r). Vector route.

fnaster_blueprint::effects::drop_shadow

pub fn drop_shadow(p: &DropShadow) -> Result<aster_ui::Recording, aster_ui::Error>

Effect route. With knockout the shadow is confined to the outside of the shape; without it the whole silhouette is drawn. Put it in the Outside layer so the shape paints over it.

fnaster_blueprint::effects::ellipse

pub fn ellipse(width: f64, height: f64, color: aster_ui::Srgb8) -> Result<aster_ui::Recording, aster_ui::Error>

A filled ellipse inscribed in (0, 0, width, height). Vector route.

fnaster_blueprint::effects::explain

pub fn explain(error: &aster_ui::Error) -> String

Agent-readable explanation of an aster_ui::Error raised by an effect, vector or render call: WHAT failed and HOW to fix it. aster_ui::Error's own Display is just its variant name; use this (or UiError, which calls it) when reporting.

fnaster_blueprint::effects::faded_glow

pub fn faded_glow(base: std::sync::Arc<aster_ui::Recording>, g: &Glow, amount: f64) -> Result<aster_ui::Recording, aster_ui::Error>

A [glow] drawing faded by amount in 0..=1: base (what [glow] made of g) scaled by an opacity pass, with no new blur. A glow whose intensity animates (a focus ring fading in) bakes its blur once and pays this for each frame of the fade. The result is a function of base and amount only; it is within a few levels of baking [glow] at intensity g.intensity * amount (the opacity is applied after the blur is quantized).

fnaster_blueprint::effects::glow

pub fn glow(p: &Glow) -> Result<aster_ui::Recording, aster_ui::Error>

Effect route. Ink extends ceil(3 * sigma * scale) device pixels beyond the grown shape; the shape itself is not drawn.

fnaster_blueprint::effects::inner_shadow

pub fn inner_shadow(p: &InnerShadow) -> Result<aster_ui::Recording, aster_ui::Error>

Effect route. Ink is confined to the shape silhouette (an alpha mask), but the drawing's declared ink bounds are the padded working area.

fnaster_blueprint::effects::radial_gradient

pub fn radial_gradient(width: f64, height: f64, radius: f64, center_color: aster_ui::Srgb8, edge_color: aster_ui::Srgb8, scale: f64) -> Result<aster_ui::Recording, aster_ui::Error>

A rounded rect filled with a radial gradient from center_color at its center to edge_color at the inscribed radius min(width, height) / 2 minus half a device pixel, so the outermost pixel centres on the box-edge midpoints are exactly edge_color (clamped beyond: corners and the long axis of a non-square box are flat edge_color, no step at the box edge). Effect route; aster-ui Paint has no radial variant, so this is a Drawing, not a Paint.

fnaster_blueprint::effects::recommended_vector_limits

pub fn recommended_vector_limits() -> aster_ui::VectorLimits

A vector admission that fits every vector kernel of this module at the extents of the gallery/tests. A caller with larger shapes passes its own VectorLimits to Renderer::enable_vectors; the renderer, not this crate, decides.

fnaster_blueprint::effects::shadow_pair

pub fn shadow_pair(p: &ShadowPair) -> Result<aster_ui::Recording, aster_ui::Error>

The two shadows of a soft surface in one drawing: a light one up-left and a dark one down-right, both blurred by sigma and confined to the outside of the shape (the shape paints over them, so the surface reads as extruded).

The light shadow is the mirror of the dark one, so the pair always balances: the surface looks lit from the top-left and shadowed at the bottom-right.

fnaster_blueprint::effects::stroke_ellipse

pub fn stroke_ellipse(width: f64, height: f64, stroke_width: f64, align: aster_ui::VectorStrokeAlignment, color: aster_ui::Srgb8, dash: Dash) -> Result<aster_ui::Recording, aster_ui::Error>

A stroked ellipse outline inscribed in (0, 0, width, height).

fnaster_blueprint::effects::stroke_rounded_rect

pub fn stroke_rounded_rect(width: f64, height: f64, radius: f64, stroke_width: f64, align: aster_ui::VectorStrokeAlignment, color: aster_ui::Srgb8, dash: Dash) -> Result<aster_ui::Recording, aster_ui::Error>

A stroked rounded-rect outline of the (0, 0, width, height) box. The alignment is relative to that outline: inside stays within the box, outside grows beyond it, center straddles it. Vector route.

Constants

constaster_blueprint::effects::EFFECT_LIMITS

pub const EFFECT_LIMITS: aster_ui::effects::EffectLimits

Effect admission used by every effect kernel. These bound ONE band of the evaluation (aster-ui bands the effect plane in rows when the whole plane would exceed them, byte-identical to the unbanded result): at most 4M source pixels and 6M f32x4 working pixels (96 MiB) at a time. The whole drawing is bounded by 16M pixels and the 64 MiB output, so a header-wide shadow at 2x or 3x is admitted; only the drawing itself must fit.

constaster_blueprint::effects::MAX_BLUR_RADIUS

pub const MAX_BLUR_RADIUS: usize

Largest blur radius in device pixels (ceil(3 * sigma * scale)); this is aster-ui's own EffectLimits::max_blur_radius ceiling.

constaster_blueprint::effects::MAX_EXTENT

pub const MAX_EXTENT: f64

Largest shape extent (logical) an effect kernel accepts.

constaster_blueprint::effects::MAX_SCALE

pub const MAX_SCALE: f64

Largest preparation scale an effect kernel accepts.