[−][src]Struct av_data::pixel::Chromaton
Single colorspace component definition.
Defines how the components of a colorspace are subsampled and where and how they are stored.
Fields
h_ss: u8Horizontal subsampling in power of two
(e.g. 0 = no subsampling, 1 = only every second value is stored).
v_ss: u8Vertial subsampling in power of two
(e.g. 0 = no subsampling, 1 = only every second value is stored).
packed: boolTells if a component is packed.
depth: u8Bit depth of a component.
shift: u8Shift for packed components.
comp_offs: u8Component offset for byte-packed components.
next_elem: u8The distance to the next packed element in bytes.
Implementations
impl Chromaton[src]
pub const fn new(
h_ss: u8,
v_ss: u8,
packed: bool,
depth: u8,
shift: u8,
comp_offs: u8,
next_elem: u8
) -> Self[src]
h_ss: u8,
v_ss: u8,
packed: bool,
depth: u8,
shift: u8,
comp_offs: u8,
next_elem: u8
) -> Self
Constructs a new Chromaton instance.
pub const fn yuv8(h_ss: u8, v_ss: u8, comp_offs: u8) -> Chromaton[src]
Constructs a specific Chromaton instance for yuv8.
pub const fn yuvhb(h_ss: u8, v_ss: u8, depth: u8, comp_offs: u8) -> Chromaton[src]
Constructs a specific Chromaton instance for yuvhb.
pub const fn packrgb(
depth: u8,
shift: u8,
comp_offs: u8,
next_elem: u8
) -> Chromaton[src]
depth: u8,
shift: u8,
comp_offs: u8,
next_elem: u8
) -> Chromaton
Constructs a specific Chromaton instance for packrgb.
pub const fn pal8(comp_offs: u8) -> Chromaton[src]
Constructs a specific Chromaton instance for pal8.
pub fn get_subsampling(self) -> (u8, u8)[src]
Returns the subsampling of a component.
pub fn is_packed(self) -> bool[src]
Tells whether a component is packed.
pub fn get_depth(self) -> u8[src]
Returns the bit depth of a component.
pub fn get_shift(self) -> u8[src]
Returns the bit shift of a packed component.
pub fn get_offset(self) -> u8[src]
Returns the byte offset of a packed component.
pub fn get_step(self) -> u8[src]
Returns the byte offset to the next element of a packed component.
pub fn get_width(self, width: usize) -> usize[src]
Calculates the width for a component from general image width.
pub fn get_height(self, height: usize) -> usize[src]
Calculates the height for a component from general image height.
pub fn get_linesize(self, width: usize, alignment: usize) -> usize[src]
Calculates the minimal stride for a component from general image width.
pub fn get_data_size(self, width: usize, height: usize, align: usize) -> usize[src]
Calculates the required image size in pixels for a component from general image width.
Trait Implementations
impl Clone for Chromaton[src]
impl Copy for Chromaton[src]
impl Debug for Chromaton[src]
impl Display for Chromaton[src]
impl PartialEq<Chromaton> for Chromaton[src]
impl StructuralPartialEq for Chromaton[src]
Auto Trait Implementations
impl RefUnwindSafe for Chromaton[src]
impl Send for Chromaton[src]
impl Sync for Chromaton[src]
impl Unpin for Chromaton[src]
impl UnwindSafe for Chromaton[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,