#[repr(C)]pub struct Xyb {
pub x: f32,
pub y: f32,
pub b: f32,
}Expand description
XYB is a color space that was designed for use with the JPEG XL Image Coding System.
It is an LMS-based color model inspired by the human visual system, facilitating perceptually uniform quantization. It uses a gamma of 3 for computationally efficient decoding.
Fields§
§x: f32§y: f32§b: f32Implementations§
source§impl Xyb
impl Xyb
pub fn new(x: f32, y: f32, b: f32) -> Xyb
sourcepub fn from_rgb(rgb: Rgb<u8>, transfer_function: TransferFunction) -> Xyb
pub fn from_rgb(rgb: Rgb<u8>, transfer_function: TransferFunction) -> Xyb
Converts Rgb to Xyb using provided TransferFunction
sourcepub fn to_rgb(&self, transfer_function: TransferFunction) -> Rgb<u8>
pub fn to_rgb(&self, transfer_function: TransferFunction) -> Rgb<u8>
Converts Xyb to Rgb using provided TransferFunction
Trait Implementations§
source§impl AddAssign<f32> for Xyb
impl AddAssign<f32> for Xyb
source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
Performs the
+= operation. Read moresource§impl AddAssign for Xyb
impl AddAssign for Xyb
source§fn add_assign(&mut self, rhs: Xyb)
fn add_assign(&mut self, rhs: Xyb)
Performs the
+= operation. Read moresource§impl DivAssign<f32> for Xyb
impl DivAssign<f32> for Xyb
source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moresource§impl DivAssign for Xyb
impl DivAssign for Xyb
source§fn div_assign(&mut self, rhs: Xyb)
fn div_assign(&mut self, rhs: Xyb)
Performs the
/= operation. Read moresource§impl EuclideanDistance for Xyb
impl EuclideanDistance for Xyb
fn euclidean_distance(&self, other: Self) -> f32
source§impl MulAssign<f32> for Xyb
impl MulAssign<f32> for Xyb
source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moresource§impl MulAssign for Xyb
impl MulAssign for Xyb
source§fn mul_assign(&mut self, rhs: Xyb)
fn mul_assign(&mut self, rhs: Xyb)
Performs the
*= operation. Read moresource§impl PartialOrd for Xyb
impl PartialOrd for Xyb
source§impl SubAssign<f32> for Xyb
impl SubAssign<f32> for Xyb
source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
Performs the
-= operation. Read moresource§impl SubAssign for Xyb
impl SubAssign for Xyb
source§fn sub_assign(&mut self, rhs: Xyb)
fn sub_assign(&mut self, rhs: Xyb)
Performs the
-= operation. Read moresource§impl TaxicabDistance for Xyb
impl TaxicabDistance for Xyb
fn taxicab_distance(&self, other: Self) -> f32
impl Copy for Xyb
impl StructuralPartialEq for Xyb
Auto Trait Implementations§
impl Freeze for Xyb
impl RefUnwindSafe for Xyb
impl Send for Xyb
impl Sync for Xyb
impl Unpin for Xyb
impl UnwindSafe for Xyb
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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