Skip to main content

Crate incular_rendering

Crate incular_rendering 

Source
Expand description

Renderer-neutral scene, canvas, display-list, and compositor primitives.

Structs§

Annotation
A type-erased application annotation carried by an annotated compositing region. The value remains strongly typed at the API boundary: consumers query it with LayerTree::find_annotation and receive only values of the requested concrete type. Native platform adapters can therefore project their own typed metadata without making the renderer depend on a platform crate.
Border
Canvas
ColorFilter
A renderer-independent 4x5 color matrix. Matrix inputs and outputs are straight (unpremultiplied) RGBA in the normalized 0..=1 range. The GPU backend converts its retained premultiplied texture to straight color, applies this matrix, clamps the result, and premultiplies it again.
CompositorDiagnostics
CornerRadii
Per-corner radii in logical pixels, ordered clockwise from the top left.
Decoration
DisplayList
DropShadowEffect
Renderer-neutral arbitrary-subtree shadow description. The source is isolated first, then its alpha is blurred and colorized by the compositor.
EffectChain
FlattenedAnnotation
Annotation placement captured by the most recent layer flatten. A None bounds value represents sized: false, which participates at every point in the scene subject to ancestor clipping.
FlattenedPicture
A picture placement observed while flattening. All rectangles here are in logical coordinates; this is intentionally useful for CPU-side scene tests and diagnostics without involving a surface or DPI scale factor.
FollowerLayer
Retained configuration of a layer that tracks a LayerLink leader.
GaussianBlur
Renderer-neutral separable Gaussian blur description. Sigma is expressed in logical pixels; a backend converts it to physical pixels at render time. Negative and non-finite values are normalized to zero at this boundary so every backend observes the same effect semantics.
GlyphPosition
A positioned glyph produced by a text shaper. It is intentionally not a character: a glyph can represent multiple Unicode scalars or none.
GlyphRun
Compact, contiguous shaped glyph data shared by display-list commands.
GradientId
Stable identity for immutable normalized gradient stop data.
GradientStop
GradientStops
LayerAnchor
Normalized anchor used by leader/follower layers. (-1, -1) is the top-left corner, (0, 0) the center, and (1, 1) the bottom-right.
LayerId
Opaque retained compositor identity. It uses the core generational arena so an ID for a removed layer can never select a later, unrelated layer.
LayerLink
Shared identity used to resolve a composited target and any number of followers across otherwise unrelated retained subtrees.
LayerTree
Renderer-independent retained layer arena. Picture display lists are owned once and scene flattening only emits a transient linear command stream. This deliberately has no GPU resources or offscreen textures.
LinearGradient
Paint
A renderer-neutral paint description.
Path
PathBuilder
PathId
Stable identity for immutable path geometry. It deliberately does not encode paint, placement, or transforms.
PublisherIdentity
Opaque publication owner minted per leader layer. A link may be shared across layer trees whose arena indices overlap, so a tree-local LayerId cannot name the publisher; instead each leader layer owns one allocation whose identity is inseparable from the owner’s lifetime. Compare only with same_owner, never by detached address.
RRect
RadialGradient
Shadow
Canonical single-shadow value used by text and other paint-producing domains. Subsystems should use this type instead of defining a parallel color/offset/blur tuple.
Stroke
SurfacePartitionId
Renderer-neutral identity for a detachable composition subtree.
SweepGradient

Enums§

BlendMode
A blend operation defined over premultiplied linear RGBA values. The GPU compositor uses the same equations as blend_premultiplied.
Brush
Effect
Ordered single-input effect descriptions. Drop shadows remain a separate layer because they intentionally produce both a shadow and the original source output.
FillRule
FilterQuality
Image filtering policy matching Flutter’s public quality vocabulary.
ImageSampling
Renderer-neutral raster filtering policy. Ordinary UI images default to linear sampling; pixel art can opt into nearest-neighbour sampling.
LayerKind
LineCap
LineJoin
PaintCommand
PaintStyle
Whether a Paint covers the interior or the outline of a path.

Functions§

blend_premultiplied
Reference blend implementation for premultiplied normalized RGBA. It is public so tests and alternate backends can verify their shader formulas.
blur_bounds
Expands source bounds by the finite Gaussian support in logical pixels.
blur_margin
Conservative logical blur margin for the finite 3-sigma cutoff.
drop_shadow_bounds
Bounds of a shadow plus the original source. The union is deliberately conservative and works for positive, negative, and fractional offsets.
gaussian_kernel_weights
A normalized, symmetric one-dimensional Gaussian kernel represented in order [-radius, ..., 0, ..., +radius]. The cutoff is exactly three physical sigma, and sigma zero is the identity kernel.
linear_gradient_t
Pad-spread linear parameter in local logical coordinates. A zero-length axis deterministically chooses the last stop (t = 1).
normalize_opacity
Canonical opacity representation shared by widgets, retained layers, and GPU lowering. Non-finite values become transparent and finite values are clamped to the physically meaningful range.
normalize_sigma
Canonical sigma normalization used by painting, widgets, and GPU lowering. Non-finite values follow the existing “invalid numeric input is transparent/zero” policy.
premultiplied_shadow_sample
Premultiplied shadow color for one blurred alpha sample. This helper is shared by deterministic CPU tests and documents the exact GPU equation.
radial_gradient_t
Pad-spread radial parameter in local logical coordinates. A non-positive radius deterministically chooses the last stop (t = 1).
resolve_follower_target
World-space point where a follower’s anchor must land, resolved entirely in leader space. The compositor and the widget tree share this half of the projection; each side then inverts it into its own retained frame (layer world vs. render parent), which is why the callers still differ.
sample_gradient_stops
Samples normalized stops using pad spread and premultiplied-linear color interpolation. At a duplicate offset the last duplicate wins, allowing a hard transition without division by zero.
sweep_gradient_t

Type Aliases§

ColorMatrix
Compatibility spelling for callers that model a 4×5 filter as a color matrix. The alias keeps one canonical representation and one set of straight/premultiplied semantics.
Shader
A renderer-neutral shader value.