Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions peniko/src/blurred_rounded_rect.rs
Original file line number Diff line number Diff line change
@@ -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<Srgb>,
/// The radius of the rounded rectangle's corners.
pub radius: f32,
/// The standard deviation of the blur effect.
pub std_dev: f32,
}
2 changes: 2 additions & 0 deletions peniko/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#![no_std]

mod blend;
mod blurred_rounded_rect;
mod brush;
mod gradient;
mod image;
Expand All @@ -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,
Expand Down
Loading