pub struct DropShadow {
pub dx: f32,
pub dy: f32,
pub color: AlphaColor<Srgb>,
pub std_deviation: f32,
pub edge_mode: EdgeMode,
pub composite_original: bool,
pub n_decimations: usize,
pub kernel: [f32; 13],
pub kernel_size: u8,
}Expand description
A drop shadow filter.
Fields§
§dx: f32The x-offset of the shadow.
dy: f32The y-offset of the shadow.
color: AlphaColor<Srgb>The color of the shadow.
std_deviation: f32Standard deviation for the blur (for reference/debugging).
edge_mode: EdgeModeEdge mode for blur sampling.
composite_original: boolWhether to composite the original input over the colored shadow.
n_decimations: usizeNumber of 2x2 decimation levels to use (0 means direct convolution).
kernel: [f32; 13]Pre-computed Gaussian kernel weights for the reduced blur.
Only the first kernel_size elements are valid.
kernel_size: u8Actual length of the kernel (kernel is padded to MAX_KERNEL_SIZE).
Implementations§
Source§impl DropShadow
impl DropShadow
Sourcepub fn new(
dx: f32,
dy: f32,
std_deviation: f32,
edge_mode: EdgeMode,
color: AlphaColor<Srgb>,
) -> Self
pub fn new( dx: f32, dy: f32, std_deviation: f32, edge_mode: EdgeMode, color: AlphaColor<Srgb>, ) -> Self
Create a new drop shadow filter with the specified parameters.
This precomputes the blur decimation plan and kernel for optimal performance.
Sourcepub fn new_shadow_only(
dx: f32,
dy: f32,
std_deviation: f32,
edge_mode: EdgeMode,
color: AlphaColor<Srgb>,
) -> Self
pub fn new_shadow_only( dx: f32, dy: f32, std_deviation: f32, edge_mode: EdgeMode, color: AlphaColor<Srgb>, ) -> Self
Create a new shadow-only drop shadow with the specified parameters.
fn new_impl( dx: f32, dy: f32, std_deviation: f32, edge_mode: EdgeMode, color: AlphaColor<Srgb>, composite_original: bool, ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DropShadow
impl RefUnwindSafe for DropShadow
impl Send for DropShadow
impl Sync for DropShadow
impl Unpin for DropShadow
impl UnsafeUnpin for DropShadow
impl UnwindSafe for DropShadow
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
Mutably borrows from an owned value. Read more