pub struct PixelInfo {
pub x: u32,
pub y: u32,
pub r: u8,
pub g: u8,
pub b: u8,
pub a: u8,
}Fields§
§x: u32§y: u32§r: u8§g: u8§b: u8§a: u8Implementations§
Source§impl PixelInfo
impl PixelInfo
pub fn to_hex(&self) -> String
pub fn to_css(&self) -> String
pub fn luminance(&self) -> f32
pub fn is_grayscale(&self) -> bool
pub fn color_distance(&self, other: &PixelInfo) -> f32
pub fn is_similar(&self, other: &PixelInfo, threshold: u8) -> bool
pub fn to_ascii(&self) -> char
pub fn print_detailed(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PixelInfo
impl RefUnwindSafe for PixelInfo
impl Send for PixelInfo
impl Sync for PixelInfo
impl Unpin for PixelInfo
impl UnsafeUnpin for PixelInfo
impl UnwindSafe for PixelInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more