pub struct Paint { /* private fields */ }Expand description
A colour prepared for drawing.
Premultiplication happens once here rather than once per pixel. Constructing a
Paint is the only division-by-255 in a fill.
Implementations§
Source§impl Paint
impl Paint
Sourcepub const fn premultiplied(self) -> u32
pub const fn premultiplied(self) -> u32
The premultiplied 0xAARRGGBB word.
Sourcepub const fn is_opaque(self) -> bool
pub const fn is_opaque(self) -> bool
Returns true if drawing can skip the read-modify-write and just store.
Sourcepub const fn is_invisible(self) -> bool
pub const fn is_invisible(self) -> bool
Returns true if drawing would change nothing.
Trait Implementations§
impl Copy for Paint
impl Eq for Paint
impl StructuralPartialEq for Paint
Auto Trait Implementations§
impl Freeze for Paint
impl RefUnwindSafe for Paint
impl Send for Paint
impl Sync for Paint
impl Unpin for Paint
impl UnsafeUnpin for Paint
impl UnwindSafe for Paint
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