Skip to main content

Animatable

Trait Animatable 

Source
pub trait Animatable: Copy {
    const LANES: usize;

    // Required methods
    fn to_lanes(self) -> Lanes;
    fn from_lanes(lanes: Lanes) -> Self;
}
Expand description

A value that animates lane by lane. Each lane moves independently along the same curve.

Required Associated Constants§

Source

const LANES: usize

How many lanes the value uses (at most MAX_LANES; more are ignored).

Required Methods§

Source

fn to_lanes(self) -> Lanes

The value as lanes.

Source

fn from_lanes(lanes: Lanes) -> Self

The value from lanes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Animatable for [f32; 2]

Source§

const LANES: usize = 2

Source§

fn to_lanes(self) -> Lanes

Source§

fn from_lanes([x, y, .._]: Lanes) -> Self

Source§

impl Animatable for [f32; 3]

Source§

const LANES: usize = 3

Source§

fn to_lanes(self) -> Lanes

Source§

fn from_lanes([x, y, z, _]: Lanes) -> Self

Source§

impl Animatable for [f32; 4]

Source§

const LANES: usize = 4

Source§

fn to_lanes(self) -> Lanes

Source§

fn from_lanes(lanes: Lanes) -> Self

Source§

impl Animatable for f32

Source§

const LANES: usize = 1

Source§

fn to_lanes(self) -> Lanes

Source§

fn from_lanes([x, .._]: Lanes) -> Self

Implementors§

Source§

impl Animatable for Edges

Source§

const LANES: usize = 4

Source§

impl Animatable for Oklab

Source§

const LANES: usize = 4

Source§

impl Animatable for Rgba

An Rgba animates in premultiplied OKLab, so a fade to transparent does not darken and a colour change does not pass through grey. Samples are clamped into gamut.

Source§

const LANES: usize = 4