pub struct IsolatedEffects {
pub opacity: f32,
pub blur_radius_px: f32,
pub backdrop_blur_radius_px: f32,
pub blend_mode: BlendMode,
}Expand description
Post-effects applied to an isolated offscreen pass before compositing.
Values are stored without clamping. Render backends decide how to handle
opacity outside 0.0..=1.0, non-finite values, and blur radii larger than
their resource limits. Self::is_noop uses an opacity tolerance of 0.001
and treats non-positive blur radii as disabled.
§Examples
use ailloli_ui_runtime::{BlendMode, IsolatedEffects};
let effects = IsolatedEffects::default();
assert_eq!(effects.opacity, 1.0);
assert_eq!(effects.blend_mode, BlendMode::Normal);
assert!(effects.is_noop());Fields§
§opacity: f32Group opacity multiplier (1.0 = opaque group).
blur_radius_px: f32Gaussian-ish blur radius in physical pixels (0.0 = disabled) on layer content.
backdrop_blur_radius_px: f32Blur of content already rendered behind this layer (backdrop filter backdrop).
blend_mode: BlendModeBlend operation used when recombining the isolated pass.
Implementations§
Source§impl IsolatedEffects
Provides the operations defined for IsolatedEffects.
impl IsolatedEffects
Provides the operations defined for IsolatedEffects.
Sourcepub fn is_noop(&self) -> bool
pub fn is_noop(&self) -> bool
No offscreen pass required: render in the main single pass.
This returns true exactly when opacity is at least 0.999, both blur
radii are at most zero, and blend mode is BlendMode::Normal. Thus
opacity above one and negative blur values are still considered no-op;
NaN in any numeric field forces false through ordered comparisons.
§Examples
use ailloli_ui_runtime::IsolatedEffects;
let mut effects = IsolatedEffects::default();
effects.opacity = 0.998;
assert!(!effects.is_noop());
effects.opacity = 1.0;
effects.blur_radius_px = -1.0;
assert!(effects.is_noop());Sourcepub fn needs_offscreen(&self) -> bool
pub fn needs_offscreen(&self) -> bool
Whether this layer must be rendered to an offscreen target.
This is exactly the negation of Self::is_noop; it does not check
backend support or allocate a target.
§Examples
use ailloli_ui_runtime::{BlendMode, IsolatedEffects};
let effects = IsolatedEffects { blend_mode: BlendMode::Multiply, ..IsolatedEffects::default() };
assert!(effects.needs_offscreen());Trait Implementations§
Source§impl Clone for IsolatedEffects
impl Clone for IsolatedEffects
Source§fn clone(&self) -> IsolatedEffects
fn clone(&self) -> IsolatedEffects
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IsolatedEffects
impl Debug for IsolatedEffects
Source§impl Default for IsolatedEffects
Implements the Default contract for IsolatedEffects.
impl Default for IsolatedEffects
Implements the Default contract for IsolatedEffects.
Source§impl PartialEq for IsolatedEffects
impl PartialEq for IsolatedEffects
impl Copy for IsolatedEffects
impl StructuralPartialEq for IsolatedEffects
Auto Trait Implementations§
impl Freeze for IsolatedEffects
impl RefUnwindSafe for IsolatedEffects
impl Send for IsolatedEffects
impl Sync for IsolatedEffects
impl Unpin for IsolatedEffects
impl UnwindSafe for IsolatedEffects
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.