Skip to main content

SmartLedsOutput

Struct SmartLedsOutput 

Source
pub struct SmartLedsOutput<'a, T, Pixbuf> { /* private fields */ }

Implementations§

Source§

impl<'a, T, Pixel, const PIXEL_COUNT: usize> SmartLedsOutput<'a, T, [Pixel; PIXEL_COUNT]>

Source

pub fn new( target: T, pixbuf: &'a mut [Pixel; PIXEL_COUNT], max_mw: Milliwatts, ) -> Self

Source

pub const fn pixbuf(&mut self) -> &mut [Pixel; PIXEL_COUNT]

Source

pub fn set_clip(&mut self, clip: Rectangle<LinearSpace>)

Source

pub fn swap_buffer( &mut self, pixbuf: &'a mut [Pixel; PIXEL_COUNT], ) -> &'a mut [Pixel; PIXEL_COUNT]

Trait Implementations§

Source§

impl<'a, T: SmartLedsWrite + 'a, Pixbuf: AsRef<[T::Color]>> Output<'a, LinearSpace> for SmartLedsOutput<'a, T, Pixbuf>
where Self: Sample<'a, LinearSpace>, T::Color: Debug + AsMilliwatts + Mul<Fract8, Output = T::Color> + Copy + WithGamma,

Source§

type Error = <T as SmartLedsWrite>::Error

Source§

type Controls = PowerControls

Source§

fn commit(&mut self) -> Result<(), Self::Error>

Commits the contents of the underlying pixel buffers to hardware
Source§

fn controls(&mut self) -> Option<&mut Self::Controls>

Source§

impl<'a, T: SmartLedsWriteAsync + 'a, Pixbuf: AsRef<[T::Color]>> OutputAsync<'a, LinearSpace> for SmartLedsOutput<'a, T, Pixbuf>
where Self: Sample<'a, LinearSpace>, T::Color: Debug + AsMilliwatts + Mul<Fract8, Output = T::Color> + Copy + WithGamma,

Source§

type Error = <T as SmartLedsWriteAsync>::Error

Source§

type Controls = PowerControls

Source§

async fn commit_async(&mut self) -> Result<(), Self::Error>

Commits the contents of the underlying pixel buffers to hardware
Source§

fn controls(&mut self) -> Option<&mut Self::Controls>

Source§

impl<'a, T, Color, const PIXEL_COUNT: usize> Sample<'a, LinearSpace> for SmartLedsOutput<'a, T, [Color; PIXEL_COUNT]>
where Color: 'a,

Source§

type Output = Color

The type of pixel this sampler supports
Source§

fn sample( &mut self, rect: &Rectangle<LinearSpace>, ) -> impl Iterator<Item = (Coordinates<LinearSpace>, &'a mut Self::Output)>

Provides a [PixelView] over the given Rectangle selection

Auto Trait Implementations§

§

impl<'a, T, Pixbuf> Freeze for SmartLedsOutput<'a, T, Pixbuf>
where T: Freeze,

§

impl<'a, T, Pixbuf> RefUnwindSafe for SmartLedsOutput<'a, T, Pixbuf>
where T: RefUnwindSafe, Pixbuf: RefUnwindSafe,

§

impl<'a, T, Pixbuf> Send for SmartLedsOutput<'a, T, Pixbuf>
where T: Send, Pixbuf: Send,

§

impl<'a, T, Pixbuf> Sync for SmartLedsOutput<'a, T, Pixbuf>
where T: Sync, Pixbuf: Sync,

§

impl<'a, T, Pixbuf> Unpin for SmartLedsOutput<'a, T, Pixbuf>
where T: Unpin,

§

impl<'a, T, Pixbuf> UnsafeUnpin for SmartLedsOutput<'a, T, Pixbuf>
where T: UnsafeUnpin,

§

impl<'a, T, Pixbuf> !UnwindSafe for SmartLedsOutput<'a, T, Pixbuf>

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, 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> 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.