pub struct Argb {
pub a: u8,
pub r: u8,
pub g: u8,
pub b: u8,
}Expand description
A resolved draw colour: straight (non-premultiplied) RGB plus an alpha.
Hash because a stencil’s ink is part of a rendered image’s cache key
(crate::imagecache::PixmapRequest): four bytes with a derived Eq, so
the derived hash agrees with it by construction.
Fields§
§a: u8Alpha, 0 fully transparent.
r: u8Red.
g: u8Green.
b: u8Blue.
Implementations§
Source§impl Argb
impl Argb
Sourcepub const TRANSPARENT: Self
pub const TRANSPARENT: Self
Fully transparent — also the 0xFFFFFFFF sentinel’s result.
Sourcepub fn is_invisible(self) -> bool
pub fn is_invisible(self) -> bool
Whether anything would be painted. PDFium tests the whole 32-bit word
(if (fill_color || stroke_color)), so a colour of exactly
0x00000000 skips the draw — which is the same predicate.
Sourcepub const fn with_alpha(self, a: u8) -> Self
pub const fn with_alpha(self, a: u8) -> Self
The same colour with a different alpha.
Trait Implementations§
impl Copy for Argb
impl Eq for Argb
impl StructuralPartialEq for Argb
Auto Trait Implementations§
impl Freeze for Argb
impl RefUnwindSafe for Argb
impl Send for Argb
impl Sync for Argb
impl Unpin for Argb
impl UnsafeUnpin for Argb
impl UnwindSafe for Argb
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