pub struct Gray16 {
pub v: u16,
pub a: u16,
}Expand description
Grayscale color with u16 components (value + alpha).
Port of C++ gray16.
Fields§
§v: u16§a: u16Implementations§
Source§impl Gray16
impl Gray16
pub const BASE_SHIFT: u32 = 16
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) -> u16
pub fn luminance_from_rgba(c: &Rgba) -> u16
Calculate luminance from Rgba (ITU-R BT.709).
Sourcepub fn luminance_from_rgba16(c: &Rgba16) -> u16
pub fn luminance_from_rgba16(c: &Rgba16) -> u16
Calculate luminance from Rgba16 (ITU-R BT.709 with integer coefficients).
pub fn from_rgba(c: &Rgba) -> Self
pub fn from_rgba8(c: &Rgba8) -> Self
pub fn from_rgba16(c: &Rgba16) -> Self
pub fn from_gray8(c: &Gray8) -> Self
pub fn is_transparent(&self) -> bool
pub fn is_opaque(&self) -> bool
pub fn multiply(a: u16, b: u16) -> u16
pub fn lerp(p: u16, q: u16, a: u16) -> u16
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: &Gray16, k: f64) -> Gray16
pub fn no_color() -> Self
Trait Implementations§
impl Copy for Gray16
impl Eq for Gray16
impl StructuralPartialEq for Gray16
Auto Trait Implementations§
impl Freeze for Gray16
impl RefUnwindSafe for Gray16
impl Send for Gray16
impl Sync for Gray16
impl Unpin for Gray16
impl UnwindSafe for Gray16
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