pub struct CanvasLayout { /* private fields */ }
Expand description

The layout of a full frame, with all planes and color.

Implementations

Construct a full frame from a single plane.

Create from a list of planes, and the texel they describe when merged.

Create a buffer layout given the layout of a simple, strided matrix.

Create a buffer layout from a texel and dimensions.

This is a simplification of with_row_layout which itself is a simplified new.

Get the texel represented by the canvas as a whole.

For non-planar images this is exactly the same as the texel of the first place. Otherwise, it is a merged representation.

Get the color space used by the image.

Returns the index of a texel in a slice of planar image data.

Returns a matrix descriptor that can store all bytes.

Note: for the moment, all layouts are row-wise matrices. This will be relaxed in the future to also permit the construction from planar image layouts. In this case, the method will return a descriptor that does not equal this layout. Instead, an image buffer shaped like the returned descriptor can be used to re-arrange all bytes into a simple matrix form.

Returns the width of the underlying image in pixels.

Returns the height of the underlying image in pixels.

Returns the memory usage as a u64.

Returns the memory usage as a usize.

Set the color of the layout, if compatible with the texel.

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

Converts to this type from the input type.

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

This method tests for !=.

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 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.