#[non_exhaustive]#[repr(u32)]pub enum Interpolation {
Bilinear = 0,
Nearest = 1,
Bicubic = 2,
Area = 3,
}Expand description
Resampling filter. The code is the one the C EF_INTERPOLATION_*
enumerators use; the string is the edgefirst.json and Python name.
The image crate runs Nearest and
Bilinear (half-pixel centres, two taps per axis at
every scale, matching OpenCV INTER_LINEAR). Bicubic
and Area describe reference pipelines; asking the image
crate for them logs a warning and runs supported.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bilinear = 0
Bilinear (the default).
Nearest = 1
Nearest neighbour.
Bicubic = 2
Bicubic.
Area = 3
Pixel-area averaging.
Implementations§
Source§impl Interpolation
impl Interpolation
Sourcepub const fn code(self) -> u32
pub const fn code(self) -> u32
The shared code for this variant. Identical on every surface.
const, deliberately: a downstream binding that cannot
write Variant = OtherEnum::Variant.code() in a #[pyclass]
discriminant position (PyO3 requires a literal there) can
still pin that literal to this value with a
const _: () = assert!(...) – a build-time check instead
of a hand-synced comment. See PyTensorMemory/PyPixelFormat
in crates/python-common/src/tensor.rs for the consumer.
Sourcepub fn from_code(code: u32) -> Option<Interpolation>
pub fn from_code(code: u32) -> Option<Interpolation>
Reject an unknown code rather than guessing at one.
Sourcepub fn from_str_code(s: &str) -> Option<Interpolation>
pub fn from_str_code(s: &str) -> Option<Interpolation>
Reject an unknown string rather than guessing at one.
Sourcepub fn all() -> &'static [Interpolation]
pub fn all() -> &'static [Interpolation]
Every variant, for exhaustive cross-surface tests.
Source§impl Interpolation
impl Interpolation
Trait Implementations§
Source§impl Clone for Interpolation
impl Clone for Interpolation
Source§fn clone(&self) -> Interpolation
fn clone(&self) -> Interpolation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Interpolation
Source§impl Debug for Interpolation
impl Debug for Interpolation
Source§impl Default for Interpolation
impl Default for Interpolation
Source§fn default() -> Interpolation
fn default() -> Interpolation
Source§impl<'de> Deserialize<'de> for Interpolation
impl<'de> Deserialize<'de> for Interpolation
Source§fn deserialize<D>(
d: D,
) -> Result<Interpolation, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
d: D,
) -> Result<Interpolation, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for Interpolation
Source§impl Hash for Interpolation
impl Hash for Interpolation
Source§impl PartialEq for Interpolation
impl PartialEq for Interpolation
Source§impl Serialize for Interpolation
impl Serialize for Interpolation
Source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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