#[non_exhaustive]pub enum MaskShape {
Rect {
rect: Rect,
},
RoundedRect {
rect: Rect,
radius: f32,
},
Circle {
center: Vec2,
radius: f32,
},
Ellipse {
center: Vec2,
half_extents: Vec2,
},
}Expand description
Shape of a clip / mask region.
Variants land issue-by-issue:
MaskShape::Rect— AUT-20 rectangle privacy mask.MaskShape::RoundedRect— AUT-31 rounded crop foundation.MaskShape::Circle— AUT-30 webcam circle mask.MaskShape::Ellipse— AUT-34 oval / ellipse mask.
Later issues (AUT-35 freehand path) extend this enum further.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rect
Sharp-corner rectangle in NDC. The renderer treats this as a
RoundedRect with radius = 0 and routes through the same
SDF pipeline.
RoundedRect
Rounded rectangle in NDC. rect is the axis-aligned bounding
box, radius is the corner radius in NDC units (clamped at
render-time to half the smaller side).
Circle
Circle in NDC. The renderer treats this as a RoundedRect
with a square bounding box and a corner radius equal to the
half-extent — the rounded-rect SDF degenerates exactly to the
circle SDF in that case (length(p) - r).
Ellipse
Axis-aligned ellipse in NDC. half_extents is (a, b) of the
implicit equation (x/a)^2 + (y/b)^2 = 1. The renderer uses a
scaled-quadratic pseudo-SDF that’s anisotropic-correct and
cheap (one length, one multiply); not Euclidean distance, but
accurate enough for masking and AA.
Implementations§
Trait Implementations§
impl Copy for MaskShape
impl StructuralPartialEq for MaskShape
Auto Trait Implementations§
impl Freeze for MaskShape
impl RefUnwindSafe for MaskShape
impl Send for MaskShape
impl Sync for MaskShape
impl Unpin for MaskShape
impl UnsafeUnpin for MaskShape
impl UnwindSafe for MaskShape
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more