#[repr(u8)]pub enum ColorRange {
Limited = 0,
Full = 1,
}Expand description
Sample value range (CICP VideoFullRangeFlag; AV1 color_range).
Besides signalling the range in a colr / AV1 header, this is the range selector for the
RGB ↔ YCbCr conversions in crate::ycbcr — so one type carries the choice end to end.
Deliberately exhaustive (unlike the code-point enums): the flag is a spec-complete single bit, so consumers can match it exhaustively forever.
Variants§
Limited = 0
Studio / limited range (e.g. luma 16–235 for 8-bit). (Flag 0.)
Full = 1
Full range (0–255 for 8-bit). (Flag 1.)
Implementations§
Source§impl ColorRange
impl ColorRange
Sourcepub fn from_flag(flag: u8) -> Option<ColorRange>
pub fn from_flag(flag: u8) -> Option<ColorRange>
The ColorRange for flag (0 or 1), or None for any other value. The inverse of
ColorRange::flag.
Trait Implementations§
Source§impl Clone for ColorRange
impl Clone for ColorRange
Source§fn clone(&self) -> ColorRange
fn clone(&self) -> ColorRange
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ColorRange
Source§impl Debug for ColorRange
impl Debug for ColorRange
impl Eq for ColorRange
Source§impl Hash for ColorRange
impl Hash for ColorRange
Source§impl PartialEq for ColorRange
impl PartialEq for ColorRange
impl StructuralPartialEq for ColorRange
Auto Trait Implementations§
impl Freeze for ColorRange
impl RefUnwindSafe for ColorRange
impl Send for ColorRange
impl Sync for ColorRange
impl Unpin for ColorRange
impl UnsafeUnpin for ColorRange
impl UnwindSafe for ColorRange
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