ResizeAlgorithm

Enumin image_optimizerfastly 0.13.1View source
pub enum ResizeAlgorithm {
Nearest,
Bilinear,
Bicubic,
Lanczos2,
Lanczos3,
}

Enables control over the resizing filter used to generate a new image with a higher or lower number of pixels.

Variants

Nearest

Uses the value of nearby translated pixel values.

Bilinear

Uses an average of a 2x2 environment of pixels.

Bicubic

Uses an average of a 4x4 environment of pixels, weighing the innermost pixels higher.

Lanczos2

Uses the Lanczos filter to increase the ability to detect edges and linear features within an image and uses sinc resampling to provide the best possible reconstruction.

Lanczos3

Lanczos3 uses a better approximation of the sinc resampling function.

Trait implementations

impl Clone for ResizeAlgorithm

fn clone(&self) -> Self

Parameters

self: &Self

Returns

Self

impl Debug for ResizeAlgorithm

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Parameters

self: &Self
f: &mut $crate::fmt::Formatter

Returns

$crate::fmt::Result

impl Serialize for ResizeAlgorithm

serialize

View source
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where
__S: Serializer,

Parameters

self: &Self
__serializer: __S

Returns

_serde::__private228::Result<__S::Ok, __S::Error>

Auto trait implementations

Blanket implementations