pub struct Gray8 {
pub v: u8,
pub a: u8,
}Expand description
Grayscale color with u8 components (value + alpha).
Port of C++ gray8T<linear>.
Fields§
§v: u8§a: u8Implementations§
Source§impl Gray8
impl Gray8
pub const BASE_SHIFT: u32 = 8
pub const BASE_SCALE: u32
pub const BASE_MASK: u32
pub const BASE_MSB: u32
pub fn new(v: u32, a: u32) -> Self
pub fn new_opaque(v: u32) -> Self
Sourcepub fn luminance_from_rgba(c: &Rgba) -> u8
pub fn luminance_from_rgba(c: &Rgba) -> u8
Calculate luminance from linear RGB (ITU-R BT.709).
Sourcepub fn luminance_from_rgba8(c: &Rgba8) -> u8
pub fn luminance_from_rgba8(c: &Rgba8) -> u8
Calculate luminance from Rgba8 (ITU-R BT.709 with integer coefficients).
pub fn from_rgba(c: &Rgba) -> Self
pub fn from_rgba8(c: &Rgba8) -> Self
pub fn is_transparent(&self) -> bool
pub fn is_opaque(&self) -> bool
pub fn multiply(a: u8, b: u8) -> u8
pub fn lerp(p: u8, q: u8, a: u8) -> u8
pub fn mult_cover(a: u8, b: CoverType) -> u8
pub fn clear(&mut self) -> &mut Self
pub fn premultiply(&mut self) -> &mut Self
pub fn demultiply(&mut self) -> &mut Self
pub fn gradient(&self, c: &Gray8, k: f64) -> Gray8
pub fn no_color() -> Self
Trait Implementations§
impl Copy for Gray8
impl Eq for Gray8
impl StructuralPartialEq for Gray8
Auto Trait Implementations§
impl Freeze for Gray8
impl RefUnwindSafe for Gray8
impl Send for Gray8
impl Sync for Gray8
impl Unpin for Gray8
impl UnwindSafe for Gray8
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