Struct pix_engine::image::Image[][src]

pub struct Image { /* fields omitted */ }
Expand description

An Image representing a buffer of pixel color values.

Implementations

Constructs an empty RGBA Image with given width and height. Alias for Image::with_rgba.

Constructs an empty RGBA Image with given width and height.

Constructs an empty RGB Image with given width and height.

Constructs an Image from a u8 slice representing RGB/A values.

Constructs an Image from a Color slice representing RGBA values.

Constructs an Image from a Vec representing RGB/A values.

Constructs an Image from a png file.

Returns the Image width.

Returns the Image height.

Returns the Image dimensions as (width, height).

Returns the center position as Point.

Returns the Image pixel data as an iterator of u8.

Returns the Image pixel data as a u8 slice.

Returns the Image pixel data as a mutable u8 slice.

Returns the Image pixel data as a Vec<u8>.

This consumes the Image, so we do not need to copy its contents.

Returns the Image pixel data as an iterator of Colors.

Returns the Image pixel data as a Vec<Color>.

Returns the color value at the given (x, y) position.

Sets the color value at the given (x, y) position.

Update the Image with a u8 slice representing RGB/A values.

Returns the Image pixel format.

Save the Image to a png file.

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

Returns the “default value” for a type. 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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.