Struct glm_color::ycbcr::YCbCr
[−]
[src]
pub struct YCbCr { /* fields omitted */ }
The YCbCr color model.
See
Wikipedia page YCbCr.
Example
use glm_color::*; let brown_yuv: YCbCr = ColorSpace::from_rgb(BROWN); assert_eq!(brown_yuv.y(), BROWN.lunimance());
Methods
impl YCbCr
[src]
fn new(y: f32, cb: f32, cr: f32) -> YCbCr
Constructs a YCbCr
value.
Parameter y
is clampped to the range [0, 1], and cb
and cr
are
clampped to the range [-0.5, 0.5].
fn as_vec3(&self) -> &Vec3
Re-interprets a reference of YCbCr
to Vec3
.
fn y(&self) -> f32
Returns the Y` component, which is a value in the range [0, 1].
fn cb(&self) -> f32
Returns theCb
component, which is a value in the range [-0.5, 0.5].
fn cr(&self) -> f32
Returns the Cr` component, which is a value in the range [-0.5, 0.5].
Trait Implementations
impl Copy for YCbCr
[src]
impl Clone for YCbCr
[src]
fn clone(&self) -> YCbCr
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for YCbCr
[src]
fn eq(&self, __arg_0: &YCbCr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &YCbCr) -> bool
This method tests for !=
.
impl Debug for YCbCr
[src]
impl Eq for YCbCr
[src]
impl ApproxEq for YCbCr
[src]
type BaseType = f32
fn is_close_to(&self, other: &YCbCr, max_diff: f32) -> bool
Returns true
if the difference between x
and y
is less than max_diff
. Read more
fn is_approx_eq(&self, rhs: &Self) -> bool
Returns true
if the difference between x
and y
is less than machine epsilon. Read more
impl Rand for YCbCr
[src]
fn rand<R: Rng>(rng: &mut R) -> YCbCr
Generates a random instance of this type using the specified source of randomness. Read more