pub struct ImageMut<'buf, Layout = &'buf mut Bytes> { /* private fields */ }
Expand description

A writeable reference to an image buffer.

Implementations

Get a reference to those bytes used by the layout.

Get a mutable reference to those bytes used by the layout.

Get a view of this image.

Get a mutable view of this image.

Convert to a view of this image.

Check if a call to ImageMut::with_layout would succeed, without consuming this reference.

Change this view to a different layout.

This returns Some if the layout fits the underlying data, and None otherwise. Use ImageMut::fits to check this property in a separate call. Note that the new layout need not be related to the old layout in any other way.

Decay into a image with less specific layout.

See Image::decay.

Copy the bytes and layout to an owned container.

Get a slice of the individual samples in the layout.

Get a mutable slice of the individual samples in the layout.

View this buffer as a slice of pixels.

This reinterprets the bytes of the buffer. It can be used to view the buffer as any kind of pixel, regardless of its association with the layout. Use it with care.

An alternative way to get a slice of texels when a layout has an inherent texel type is Self::as_slice.

View this buffer as a slice of pixels.

This reinterprets the bytes of the buffer. It can be used to view the buffer as any kind of pixel, regardless of its association with the layout. Use it with care.

An alternative way to get a slice of texels when a layout has an inherent texel type is Self::as_mut_slice.

Turn into a slice of the individual samples in the layout.

This preserves the lifetime with which the layout is borrowed from the underlying image, and the ImageMut need not stay alive.

Turn into a mutable slice of the individual samples in the layout.

This preserves the lifetime with which the layout is borrowed from the underlying image, and the ImageMut need not stay alive.

Retrieve a single texel from a raster image.

Put a single texel to a raster image.

Call a function on each texel of this raster image.

The order of evaluation is not defined although certain layouts may offer more specific guarantees. In general, one can expect that layouts call the function in a cache-efficient manner if they are aware of a better iteration strategy.

Trait Implementations

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

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