Struct rog_anime::AnimeImage[][src]

pub struct AnimeImage {
    pub scale: Vec2,
    pub angle: f32,
    pub translation: Vec2,
    pub bright: f32,
    // some fields omitted
}

Container of Led, each of which specifies a position within the image The main use of this is to position and sample colours for the final image to show on AniMe

Fields

scale: Vec2angle: f32

Angle in radians

translation: Vec2

Position of the image ont he display

bright: f32

Brightness of final image, 0.0 = off, 1.0 = full

Implementations

impl AnimeImage[src]

pub fn generate() -> Vec<Option<Led>>[src]

Really only used to generate the output for including as a full const in LED_IMAGE_POSITIONS

pub fn update(&mut self)[src]

Called after setting new angle, position, or scale to refresh the image samples, the result can then been transformed to the appropriate data for displaying

pub fn from_png(
    path: &Path,
    scale: f32,
    angle: f32,
    translation: Vec2,
    bright: f32
) -> Result<Self, AnimeError>
[src]

Generate the base image from inputs. The result can be displayed as is or updated via scale, position, or angle then displayed again after update().

Trait Implementations

impl From<&'_ AnimeImage> for AnimeDataBuffer[src]

fn from(leds: &AnimeImage) -> Self[src]

Do conversion from the nested Vec in AniMeMatrix to the two required packets suitable for sending over USB

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.