pub struct BlurStrength(/* private fields */);Expand description
Blur radius in logical points.
Core resolves this to a physical-pixel radius — the one algorithm-agnostic step. The
GPU application of the resulting parameters (allocating the pyramid textures, binding the
per-pass offset uniforms, the draws) lives in the backend; the GPU-free policy that
produces them — the Gaussian sigma/taps and the dual-Kawase level/half-pixel math — lives in
the crate’s algorithm module (DESIGN §4.2, §15). Reversal noted (glow IMPL §0c): an earlier
version of this paragraph said core “has no notion of levels — that is the wgpu crate’s”.
That held while wgpu was the only backend; the glow backend needs the same level policy, so
it was hoisted to core to keep the two backends from drifting. Core now owns the level math;
only the GPU resources it keys stay backend-specific.
The resolution is exposed as BlurRequest::physical_blur_radius, not a free
strength × scale call: a BlurRequest carries two independent scales (source vs
target), and the blur convolution happens in the source texture’s pixel space, so the
radius must resolve against source_region.scale. Pinning that scale inside the request
makes the wrong one impossible to pass (the same guardrail ResolvedMask::from_target
gives the corner radius).
Non-negative by construction: a negative radius is meaningless, so Self::new clamps to
0 (which the backend reads as “no blur”), keeping the type total.
Implementations§
Source§impl BlurStrength
impl BlurStrength
Trait Implementations§
Source§impl Clone for BlurStrength
impl Clone for BlurStrength
Source§fn clone(&self) -> BlurStrength
fn clone(&self) -> BlurStrength
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BlurStrength
Source§impl Debug for BlurStrength
impl Debug for BlurStrength
Source§impl PartialEq for BlurStrength
impl PartialEq for BlurStrength
Source§fn eq(&self, other: &BlurStrength) -> bool
fn eq(&self, other: &BlurStrength) -> bool
self and other values to be equal, and is used by ==.