#[non_exhaustive]pub enum Interpolation {
Nearest,
Bilinear,
}Expand description
How convert() resamples when it resizes.
Every backend honours it: the CPU backend through its resizer, the
OpenGL backend through its texture filtering and NV shader choice, and
G2D, which has a fixed hardware filter, by declining resizing converts
under Interpolation::Nearest so another backend runs them. Converts
that do not resize read each source pixel exactly in either mode.
Override at runtime with EDGEFIRST_INTERPOLATION=nearest|bilinear,
which takes precedence over ImageProcessorConfig::interpolation and
ImageProcessor::set_interpolation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Nearest
Nearest-neighbour: each output pixel copies one source pixel. The fastest mode, at the cost of aliasing that lowers detection accuracy on resized inputs.
Bilinear
Bilinear with half-pixel centres (default): two taps per axis at every
scale on both the CPU and GL backends, matching OpenCV INTER_LINEAR,
the preprocessing most detectors and segmenters are trained with. It
does not widen its kernel when downscaling, so it smooths less than
PIL’s bilinear below 1×.
Trait Implementations§
Source§impl Clone for Interpolation
impl Clone for Interpolation
impl Copy for Interpolation
Source§impl Debug for Interpolation
impl Debug for Interpolation
Source§impl Default for Interpolation
impl Default for Interpolation
impl Eq for Interpolation
Source§impl PartialEq for Interpolation
impl PartialEq for Interpolation
impl StructuralPartialEq for Interpolation
Auto Trait Implementations§
impl Freeze for Interpolation
impl RefUnwindSafe for Interpolation
impl Send for Interpolation
impl Sync for Interpolation
impl Unpin for Interpolation
impl UnsafeUnpin for Interpolation
impl UnwindSafe for Interpolation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more