Skip to main content

VuiConfig

Struct VuiConfig 

Source
pub struct VuiConfig { /* private fields */ }
Expand description

H.264 VUI configuration for signaling color space to decoders.

This struct groups all VUI color-related fields together for convenience. Use VuiConfig::bt709() or similar constructors for common presets.

§Example

use openh264::encoder::{EncoderConfig, VuiConfig};

let config = EncoderConfig::new()
    .vui(VuiConfig::bt709().full_range(true));  // HD BT.709 with full range

Implementations§

Source§

impl VuiConfig

Source

pub const fn new() -> Self

Create a new VuiConfig with default values (BT.709 limited range).

Source

pub const fn bt709() -> Self

BT.709 with limited range (default for HD content).

This is the standard for HD television and most video content.

Source

pub const fn bt709_full() -> Self

BT.709 with full range (for PC/computer graphics content).

Source

pub const fn bt601() -> Self

BT.601 (SMPTE 170M) with limited range (for SD content).

Source

pub const fn srgb() -> Self

sRGB with full range (ideal for desktop/web content).

Uses BT.709 primaries but with sRGB transfer function.

Source

pub const fn bt2020() -> Self

BT.2020 with limited range (for UHD/HDR content).

Source

pub const fn color_primaries(self, value: ColorPrimaries) -> Self

Set the color primaries.

Source

pub const fn transfer_characteristics( self, value: TransferCharacteristics, ) -> Self

Set the transfer characteristics.

Source

pub const fn matrix_coefficients(self, value: MatrixCoefficients) -> Self

Set the matrix coefficients.

Source

pub const fn full_range(self, value: bool) -> Self

Set full range mode.

Trait Implementations§

Source§

impl Clone for VuiConfig

Source§

fn clone(&self) -> VuiConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VuiConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VuiConfig

Source§

fn default() -> VuiConfig

Returns the “default value” for a type. Read more
Source§

impl Hash for VuiConfig

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for VuiConfig

Source§

fn eq(&self, other: &VuiConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for VuiConfig

Source§

impl Eq for VuiConfig

Source§

impl StructuralPartialEq for VuiConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.