pub struct MediaFormat {
pub code: FourCc,
pub resolution: Resolution,
pub color: ColorSpace,
}Expand description
Media format including code and geometry.
§Example
use styx_core::prelude::{ColorSpace, FourCc, MediaFormat, Resolution};
let res = Resolution::new(1920, 1080).unwrap();
let fmt = MediaFormat::new(FourCc::new(*b"RG24"), res, ColorSpace::Srgb);
assert_eq!(fmt.code.to_string(), "RG24");Fields§
§code: FourCcFourCc code describing pixel layout.
resolution: ResolutionResolution of the frame.
color: ColorSpaceColor space hint.
Implementations§
Source§impl MediaFormat
impl MediaFormat
Sourcepub fn new(
code: FourCc,
resolution: Resolution,
color: ColorSpace,
) -> MediaFormat
pub fn new( code: FourCc, resolution: Resolution, color: ColorSpace, ) -> MediaFormat
Build a new format.
Trait Implementations§
Source§impl Clone for MediaFormat
impl Clone for MediaFormat
Source§fn clone(&self) -> MediaFormat
fn clone(&self) -> MediaFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MediaFormat
impl Debug for MediaFormat
Source§impl PartialEq for MediaFormat
impl PartialEq for MediaFormat
impl Copy for MediaFormat
impl Eq for MediaFormat
impl StructuralPartialEq for MediaFormat
Auto Trait Implementations§
impl Freeze for MediaFormat
impl RefUnwindSafe for MediaFormat
impl Send for MediaFormat
impl Sync for MediaFormat
impl Unpin for MediaFormat
impl UnwindSafe for MediaFormat
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§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