pub struct Modifier(pub u64);Expand description
A DRM format modifier.
The default is Modifier::LINEAR, matching the C++ Modifier whose
member initializer is DRM_FORMAT_MOD_LINEAR.
Tuple Fields§
§0: u64Implementations§
Source§impl Modifier
impl Modifier
Sourcepub const fn family(self) -> ModifierFamily
pub const fn family(self) -> ModifierFamily
Which family this modifier belongs to.
use drmkit_fmt::{Modifier, ModifierFamily, sand128_col_height};
// A producer's SAND128 with a baked-in column height.
let produced = sand128_col_height(1080);
assert!(matches!(produced.family(), ModifierFamily::BroadcomSand { code: 4 }));
// The base a plane advertises.
assert_eq!(produced.family().base(), Some(sand128_col_height(0)));
// Everything else matches only itself.
assert_eq!(Modifier::LINEAR.family(), ModifierFamily::Exact);
assert_eq!(Modifier::LINEAR.family().base(), None);Source§impl Modifier
impl Modifier
Sourcepub const INVALID: Self
pub const INVALID: Self
The legacy “implementation-defined layout” sentinel
(DRM_FORMAT_MOD_INVALID).
Treated as interchangeable with Modifier::LINEAR for eligibility,
mirroring the pre-FormatTable supports_format_modifier semantics.
Sourcepub const fn vendor(self) -> u8
pub const fn vendor(self) -> u8
The vendor field (top 8 bits), as fourcc_mod_get_vendor reports it.
Sourcepub const fn is_linear(self) -> bool
pub const fn is_linear(self) -> bool
Whether this is Modifier::LINEAR.
Sourcepub const fn is_invalid(self) -> bool
pub const fn is_invalid(self) -> bool
Whether this is the Modifier::INVALID sentinel.
Trait Implementations§
impl Copy for Modifier
impl Eq for Modifier
Source§impl Ord for Modifier
impl Ord for Modifier
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Modifier
impl PartialOrd for Modifier
impl StructuralPartialEq for Modifier
Auto Trait Implementations§
impl Freeze for Modifier
impl RefUnwindSafe for Modifier
impl Send for Modifier
impl Sync for Modifier
impl Unpin for Modifier
impl UnsafeUnpin for Modifier
impl UnwindSafe for Modifier
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