Struct ytesrev::image::PngImage

source ·
pub struct PngImage {
    pub width: usize,
    pub height: usize,
    pub data: Vec<u8>,
}
Expand description

A PNG image. Currently only supports RGB and RGBA color types

Fields

width: usize

The width of the image

height: usize

The height of the image

data: Vec<u8>

The data in the image, stored in chunks of 4 per pixel, containing the image in RGBA order

Implementations

Load an image from a specified source.

Load an image and apply a function to each pixel. Mostly used by LatexObj to fix alpha

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
What this object contains
What this object contains, mutably
Draw everything
When the user presses space, the state of the presentation is advanced. This method is what is called. Read more
What state the object is in
Register all content. This is mostly just used by LatexObjs, that need to be registered before loaded. Read more
Load all content
When any event occurs
Tick the object
Retrieve the data in the image
Retrieve the data in the image, mutably
Retrieve the data in the image, consuming the object
Convert the object to a dynamic KnownSize object, as rust doesn’t support calling KnownSize -methods directly on this object Read more
The width of the object
The height of the object

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.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
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.