Skip to main content

DisplayParams

Struct DisplayParams 

Source
pub struct DisplayParams {
    pub src_rect: Rect,
    pub src_rect_fixed: Option<FixedRect>,
    pub dst_rect: Rect,
    pub rotation: u64,
    pub alpha: Option<u16>,
    pub zpos: Option<u64>,
    pub color_primaries: Option<ColorPrimaries>,
    pub source_eotf: Option<TransferFunction>,
    pub color_encoding: Option<ColorEncoding>,
    pub color_range: Option<ColorRange>,
}
Expand description

How a layer should be displayed.

Fields§

§src_rect: Rect

Region of the buffer to show.

A zero width or height means “the buffer’s full extent” — see lower_layer, where that resolution happens.

§src_rect_fixed: Option<FixedRect>

The source crop at sub-pixel precision.

When set it takes precedence over src_rect and is written to SRC_X/Y/W/H as given; a zero width or height still means the buffer’s full extent. The composition fallback, which samples whole pixels, rounds it. None: src_rect applies.

§dst_rect: Rect

Region of the CRTC to show it on.

x/y are signed: a plane may extend off-screen.

§rotation: u64

Rotate and reflect bits, as a DRM_MODE_ROTATE_* / DRM_MODE_REFLECT_* mask. Zero means no rotation, and nothing is written.

§alpha: Option<u16>

Per-plane alpha, if the caller set one.

§zpos: Option<u64>

Stacking position, if the caller set one.

Left unset deliberately by most callers — see lower_layer for why writing a default here rather than leaving it alone is actively harmful.

§color_primaries: Option<ColorPrimaries>

The container colorimetry this layer’s content is in.

Feeds the scene’s choice of connector Colorspace – the widest-gamut layer wins – and seeds the mastering primaries when the frame is HDR. None means the producer did not say, and the scene leaves the connector property alone rather than guessing.

§source_eotf: Option<TransferFunction>

The transfer function the content is encoded with.

None is the SDR transfer. When any layer in a frame reports PQ or HLG the scene declares HDR on the connector.

§color_encoding: Option<ColorEncoding>

The YCbCr-to-RGB matrix this layer’s pixels were encoded with: the plane’s COLOR_ENCODING.

None asks for BT.709. Only YUV formats are converted, so an RGB layer is unaffected either way; the scene still writes the value, to displace whatever the previous client left on the plane. A plane without the encoding asked for gets BT.709, or BT.601 where that is all it has.

§color_range: Option<ColorRange>

Whether this layer’s YCbCr is limited or full range: the plane’s COLOR_RANGE. None asks for limited, which most camera and broadcast video is.

Implementations§

Source§

impl DisplayParams

Source

pub fn ycbcr(&self) -> Ycbcr

The YCbCr interpretation this layer asks its plane for, defaults applied.

Trait Implementations§

Source§

impl Clone for DisplayParams

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for DisplayParams

Source§

impl Debug for DisplayParams

Source§

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

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

impl Default for DisplayParams

Source§

fn default() -> Self

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

impl Eq for DisplayParams

Source§

impl PartialEq for DisplayParams

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DisplayParams

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.