DesktopDriver

Struct DesktopDriver 

Source
pub struct DesktopDriver<Dim, Layout> { /* private fields */ }
Expand description

Desktop driver for simulating LED layouts in a desktop window.

This struct implements the Driver trait.

§Type Parameters

  • Dim - The dimension marker (Dim1d or Dim2d or Dim3d)
  • Layout - The specific layout type

Trait Implementations§

Source§

impl<Dim, Layout> Driver for DesktopDriver<Dim, Layout>
where Layout: LayoutForDim<Dim>,

Source§

type Error = DesktopError

The error type that may be returned by the driver.
Source§

type Color = LinearSrgb

The color type accepted by the driver.
Source§

type Word = LinearSrgb

The word of the frame buffer.
Source§

fn encode<const PIXEL_COUNT: usize, const FRAME_BUFFER_SIZE: usize, Pixels, Color>( &mut self, pixels: Pixels, _brightness: f32, _correction: ColorCorrection, ) -> Vec<Self::Word, FRAME_BUFFER_SIZE>
where Pixels: IntoIterator<Item = Color>, Self::Color: FromColor<Color>,

Encodes an update frame buffer for the LED hardware. Read more
Source§

fn write<const FRAME_BUFFER_SIZE: usize>( &mut self, frame: Vec<Self::Word, FRAME_BUFFER_SIZE>, brightness: f32, correction: ColorCorrection, ) -> Result<(), Self::Error>

Writes frame buffer to the LED hardware. Read more
Source§

fn show<const PIXEL_COUNT: usize, const FRAME_BUFFER_SIZE: usize, I, C>( &mut self, pixels: I, brightness: f32, correction: ColorCorrection, ) -> Result<(), Self::Error>
where I: IntoIterator<Item = C>, Self::Color: FromColor<C>,

Shows a frame on the LED hardware. Read more
Source§

impl<Dim, Layout> Drop for DesktopDriver<Dim, Layout>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<Dim, Layout> Freeze for DesktopDriver<Dim, Layout>

§

impl<Dim, Layout> RefUnwindSafe for DesktopDriver<Dim, Layout>
where Dim: RefUnwindSafe, Layout: RefUnwindSafe,

§

impl<Dim, Layout> Send for DesktopDriver<Dim, Layout>
where Dim: Send, Layout: Send,

§

impl<Dim, Layout> Sync for DesktopDriver<Dim, Layout>
where Dim: Sync, Layout: Sync,

§

impl<Dim, Layout> Unpin for DesktopDriver<Dim, Layout>
where Dim: Unpin, Layout: Unpin,

§

impl<Dim, Layout> UnwindSafe for DesktopDriver<Dim, Layout>
where Dim: UnwindSafe, Layout: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromColor<T> for T

Source§

fn from_color(color: T) -> T

Converts from the source color type
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, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Converts into the target color type
Source§

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

Source§

type Error = Infallible

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

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

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.