#[repr(C)]pub struct Brush {
pub color: ColorU,
pub radius: f32,
pub hardness: f32,
pub flow: f32,
pub spacing: f32,
}Expand description
A soft round brush for the painting API.
The same parameters drive the CPU
rasterizer (RawImage::paint_dot) and the GPU brush shader, so a stroke
looks identical whether it lands on a RawImage or a Texture.
Fields§
§color: ColorUBrush color (its alpha scales the dab opacity together with flow).
radius: f32Brush radius in pixels.
hardness: f32Edge hardness, 0.0 (fully feathered) .. 1.0 (hard edge). Opaque out
to hardness * radius, then a smooth falloff to zero at the edge.
flow: f32Per-dab opacity multiplier, 0.0..1.0. Values < 1 let overlapping dabs
build up smoothly (the “metaball”-like blend).
spacing: f32Spacing between stamped dabs along a stroke, as a fraction of radius
(e.g. 0.25 = a dab every quarter-radius). Smaller = smoother + slower.
Implementations§
Trait Implementations§
impl Copy for Brush
impl StructuralPartialEq for Brush
Auto Trait Implementations§
impl Freeze for Brush
impl RefUnwindSafe for Brush
impl Send for Brush
impl Sync for Brush
impl Unpin for Brush
impl UnsafeUnpin for Brush
impl UnwindSafe for Brush
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