pub enum ImageDataType {
    EncodedFile(Vec<u8>),
    Rgba8 {
        data: Vec<u8>,
        width: u32,
        height: u32,
        hash: [u8; 32],
    },
    AnimRgba8 {
        width: u32,
        height: u32,
        durations: Vec<Duration>,
        frames: Vec<Vec<u8>>,
        hashes: Vec<[u8; 32]>,
    },
}

Variants

EncodedFile(Vec<u8>)

Data is in the native image file format (best for file formats that have animated content)

Rgba8

Fields

data: Vec<u8>
width: u32
height: u32
hash: [u8; 32]

Data is RGBA u8 data

AnimRgba8

Fields

width: u32
height: u32
durations: Vec<Duration>
frames: Vec<Vec<u8>>
hashes: Vec<[u8; 32]>

Data is an animated sequence

Implementations

Divides the animation frame durations by the provided speed_factor, so a factor of 2 will halve the duration.

Panics

if the speed_factor is negative, non-finite or the result overflows the allow Duration range.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.