pub struct Rgba16 {
pub r: u16,
pub g: u16,
pub b: u16,
pub a: u16,
}Expand description
RGBA color with u16 components.
Port of C++ rgba16.
Fields§
§r: u16§g: u16§b: u16§a: u16Implementations§
Source§impl Rgba16
impl Rgba16
pub const BASE_SHIFT: u32 = 16
pub const BASE_SCALE: u32
pub const BASE_MASK: u32
pub const BASE_MSB: u32
pub fn new(r: u32, g: u32, b: u32, a: u32) -> Self
pub fn new_opaque(r: u32, g: u32, b: u32) -> Self
Sourcepub fn from_rgba8(c: &Rgba8) -> Self
pub fn from_rgba8(c: &Rgba8) -> Self
Convert from Rgba8 (u8) by expanding 8-bit to 16-bit.
pub fn to_rgba(&self) -> Rgba
pub fn to_rgba8(&self) -> Rgba8
pub fn is_transparent(&self) -> bool
pub fn is_opaque(&self) -> bool
pub fn invert(x: u16) -> u16
Sourcepub fn mult_cover(a: u16, b: CoverType) -> u16
pub fn mult_cover(a: u16, b: CoverType) -> u16
Multiply a color component by a cover (8-bit).
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: &Rgba16, k: f64) -> Rgba16
pub fn no_color() -> Self
pub fn from_wavelength(wl: f64, gamma: f64) -> Self
Trait Implementations§
impl Copy for Rgba16
impl Eq for Rgba16
impl StructuralPartialEq for Rgba16
Auto Trait Implementations§
impl Freeze for Rgba16
impl RefUnwindSafe for Rgba16
impl Send for Rgba16
impl Sync for Rgba16
impl Unpin for Rgba16
impl UnwindSafe for Rgba16
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