diff --git a/peniko/src/blurred_rounded_rect.rs b/peniko/src/blurred_rounded_rect.rs new file mode 100644 index 0000000..b7eba77 --- /dev/null +++ b/peniko/src/blurred_rounded_rect.rs @@ -0,0 +1,20 @@ +// Copyright 2026 the Peniko Authors +// SPDX-License-Identifier: Apache-2.0 OR MIT + +use crate::color::{AlphaColor, Srgb}; +use crate::kurbo::Rect; + +/// A blurred, rounded rectangle. +/// +/// May be used in renderer APIs, as a fast path to render shadows for rounded rectangles. +#[derive(Debug)] +pub struct BlurredRoundedRect { + /// The base rectangle to use for the blur effect. + pub rect: Rect, + /// The color of the blurred rectangle. + pub color: AlphaColor, + /// The radius of the rounded rectangle's corners. + pub radius: f32, + /// The standard deviation of the blur effect. + pub std_dev: f32, +} diff --git a/peniko/src/lib.rs b/peniko/src/lib.rs index 8ab6458..c4c3461 100644 --- a/peniko/src/lib.rs +++ b/peniko/src/lib.rs @@ -25,6 +25,7 @@ #![no_std] mod blend; +mod blurred_rounded_rect; mod brush; mod gradient; mod image; @@ -43,6 +44,7 @@ pub use kurbo; pub use linebender_resource_handle::{self, Blob, FontData, WeakBlob}; pub use blend::{BlendMode, Compose, Mix}; +pub use blurred_rounded_rect::BlurredRoundedRect; pub use brush::{Brush, BrushRef, Extend}; pub use gradient::{ ColorStop, ColorStops, ColorStopsSource, Gradient, GradientKind, InterpolationAlphaSpace,