Skip to main content

ImageExt

Trait ImageExt 

Source
pub trait ImageExt
where Self: LayoutExt,
{ // Required method fn image_data_mut(&mut self) -> &mut ImageData; // Provided methods fn image_data(self, image_data: ImageData) -> Self { ... } fn sampling_mode(self, sampling_mode: SamplingMode) -> Self { ... } fn aspect_ratio(self, aspect_ratio: AspectRatio) -> Self { ... } fn image_cover(self, image_cover: ImageCover) -> Self { ... } fn snap_to_grid(self, snap_to_grid: bool) -> Self { ... } fn blur(self, blur: f32) -> Self { ... } }
Expand description

Methods for configuring how an image is scaled and sampled.

Required Methods§

Source

fn image_data_mut(&mut self) -> &mut ImageData

Returns a mutable reference to the element’s image data.

Provided Methods§

Source

fn image_data(self, image_data: ImageData) -> Self

Replace all of the element’s image data at once. See ImageData.

Source

fn sampling_mode(self, sampling_mode: SamplingMode) -> Self

Set the filtering used when the image is scaled. See SamplingMode.

Source

fn aspect_ratio(self, aspect_ratio: AspectRatio) -> Self

Set how the image is scaled to fit its bounds. See AspectRatio.

Source

fn image_cover(self, image_cover: ImageCover) -> Self

Set how the image is positioned within its bounds. See ImageCover.

Source

fn snap_to_grid(self, snap_to_grid: bool) -> Self

Snap the image to the pixels grid. Defaults to false, but SvgViewer enables it.

Source

fn blur(self, blur: f32) -> Self

Apply a Gaussian blur of the given radius to the image.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§