⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Output

Struct Output 

Source
pub struct Output {
Show 14 fields pub id: u32, pub name: String, pub description: String, pub make: String, pub model: String, pub x: i32, pub y: i32, pub physical_width_mm: u32, pub physical_height_mm: u32, pub subpixel: SubpixelLayout, pub transform: OutputTransform, pub scale: u32, pub modes: Vec<OutputMode>, pub enabled: bool,
}
Expand description

A display output (physical monitor or virtual display).

Fields§

§id: u32

Unique output ID

§name: String

Human-readable output name (e.g., “HDMI-A-1”, “eDP-1”)

§description: String

Description of the output (e.g., “Dell U2720Q”)

§make: String

Manufacturer name

§model: String

Model name

§x: i32

Position in global compositor coordinate space

§y: i32§physical_width_mm: u32

Physical width in millimeters (0 = unknown)

§physical_height_mm: u32

Physical height in millimeters (0 = unknown)

§subpixel: SubpixelLayout

Subpixel layout

§transform: OutputTransform

Applied transform (rotation/flip)

§scale: u32

Integer scale factor (1 = normal, 2 = HiDPI)

§modes: Vec<OutputMode>

Supported display modes

§enabled: bool

Whether this output is enabled

Implementations§

Source§

impl Output

Source

pub fn new(id: u32, name: &str) -> Self

Create a new output with default settings.

Source

pub fn new_virtual(id: u32, name: &str, width: u32, height: u32) -> Self

Create a virtual output with a single mode.

Source

pub fn current_mode(&self) -> Option<&OutputMode>

Get the current mode (if any).

Source

pub fn logical_width(&self) -> u32

Get the logical width (after transform and scale).

Source

pub fn logical_height(&self) -> u32

Get the logical height (after transform and scale).

Source

pub fn pixel_width(&self) -> u32

Get the physical pixel width (current mode, no scaling).

Source

pub fn pixel_height(&self) -> u32

Get the physical pixel height (current mode, no scaling).

Source

pub fn dpi(&self) -> (u32, u32)

Calculate DPI from physical dimensions and pixel resolution.

Returns (dpi_x, dpi_y) or (0, 0) if physical dimensions are unknown.

Source

pub fn contains_point(&self, px: i32, py: i32) -> bool

Check if a point (in global compositor coordinates) falls within this output’s logical area.

Source

pub fn bounds(&self) -> (i32, i32, u32, u32)

Get the bounding rectangle (x, y, width, height) in global coords.

Source

pub fn set_current_mode(&mut self, index: usize) -> Result<(), KernelError>

Set the active mode by index. Marks all other modes as non-current.

Auto Trait Implementations§

§

impl Freeze for Output

§

impl RefUnwindSafe for Output

§

impl Send for Output

§

impl Sync for Output

§

impl Unpin for Output

§

impl UnwindSafe for Output

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.