#[non_exhaustive]pub enum AlphaMode {
Straight,
Premultiplied,
Unknown,
}Expand description
Alpha modes.
The alpha mode defines how the alpha channel should be handled when converting video frames.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Straight
Unassociated alpha.
Premultiplied
Associated alpha.
Unknown
Alpha mode is not specified or unknown
Implementations§
Source§impl AlphaMode
impl AlphaMode
Sourcepub const fn name(&self) -> &'static str
pub const fn name(&self) -> &'static str
Returns the name of the alpha mode as a string.
§Examples
use ff_format::color::AlphaMode;
assert_eq!(AlphaMode::Straight.name(), "straight");
assert_eq!(AlphaMode::Premultiplied.name(), "premultiplied");Sourcepub const fn is_straight(&self) -> bool
pub const fn is_straight(&self) -> bool
Returns true if this is a straight alpha mode.
§Examples
use ff_format::color::AlphaMode;
assert!(AlphaMode::Straight.is_straight());
assert!(!AlphaMode::Premultiplied.is_straight());Sourcepub const fn is_premultiplied(&self) -> bool
pub const fn is_premultiplied(&self) -> bool
Returns true if this is a premultiplied alpha mode.
§Examples
use ff_format::color::AlphaMode;
assert!(AlphaMode::Premultiplied.is_premultiplied());
assert!(!AlphaMode::Straight.is_premultiplied());Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true if the alpha mode is unknown.
§Examples
use ff_format::color::AlphaMode;
assert!(AlphaMode::Unknown.is_unknown());
assert!(!AlphaMode::Straight.is_unknown());Trait Implementations§
impl Copy for AlphaMode
impl Eq for AlphaMode
impl StructuralPartialEq for AlphaMode
Auto Trait Implementations§
impl Freeze for AlphaMode
impl RefUnwindSafe for AlphaMode
impl Send for AlphaMode
impl Sync for AlphaMode
impl Unpin for AlphaMode
impl UnsafeUnpin for AlphaMode
impl UnwindSafe for AlphaMode
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