Enum ril::prelude::ResizeAlgorithm
source · [−]pub enum ResizeAlgorithm {
Nearest,
Box,
Bilinear,
Hamming,
Bicubic,
Mitchell,
Lanczos3,
}Expand description
A filtering algorithm that is used to resize an image.
Variants
Nearest
A simple nearest neighbor algorithm. Although the fastest, this gives the lowest quality resizings.
When upscaling this is good if you want a “pixelated” effect with no aliasing.
Box
A box filter algorithm. Equivalent to the [Nearest] filter if you are upscaling.
Bilinear
A bilinear filter. Calculates output pixel value using linear interpolation on all pixels.
Hamming
While having similar performance as the [Bilinear] filter, this produces a sharper and
usually considered better quality image than the [Bilinear] filter, but only when
downscaling. This may give worse results than bilinear when upscaling.
Bicubic
A Catmull-Rom bicubic filter, which is the most common bicubic filtering algorithm. Just like all cubic filters, it uses cubic interpolation on all pixels to calculate output pixels.
Mitchell
A Mitchell-Netravali bicubic filter. Just like all cubic filters, it uses cubic interpolation on all pixels to calculate output pixels.
Lanczos3
A Lanczos filter with a window of 3. Calculates output pixel value using a high-quality Lanczos filter on all pixels.
Trait Implementations
sourceimpl Clone for FilterType
impl Clone for FilterType
sourcefn clone(&self) -> FilterType
fn clone(&self) -> FilterType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for FilterType
impl Debug for FilterType
sourceimpl Default for FilterType
impl Default for FilterType
sourceimpl From<FilterType> for ResizeAlg
impl From<FilterType> for ResizeAlg
sourcefn from(f: FilterType) -> Self
fn from(f: FilterType) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<FilterType> for FilterType
impl PartialEq<FilterType> for FilterType
impl Copy for FilterType
impl Eq for FilterType
impl StructuralEq for FilterType
impl StructuralPartialEq for FilterType
Auto Trait Implementations
impl RefUnwindSafe for FilterType
impl Send for FilterType
impl Sync for FilterType
impl Unpin for FilterType
impl UnwindSafe for FilterType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more