pub struct LanczosResampler { /* private fields */ }Expand description
Lanczos resampler with configurable lobe count
Implementations§
Source§impl LanczosResampler
impl LanczosResampler
Sourcepub const fn new(lobes: usize) -> Self
pub const fn new(lobes: usize) -> Self
Creates a new Lanczos resampler with specified lobe count
§Arguments
lobes- Number of lobes (2 = faster, 3 = higher quality)
Common values:
- 2: Lanczos2 - faster, still good quality
- 3: Lanczos3 - standard, excellent quality (default)
Sourcepub fn resample(
&self,
src: &RasterBuffer,
dst_width: u64,
dst_height: u64,
) -> Result<RasterBuffer>
pub fn resample( &self, src: &RasterBuffer, dst_width: u64, dst_height: u64, ) -> Result<RasterBuffer>
Resamples a raster buffer using Lanczos interpolation
Out-of-range source samples needed by the kernel window at the
image border are handled via EdgeMode::Clamp. Use
LanczosResampler::resample_with_edge_mode to select a different
edge-handling strategy.
§Errors
Returns an error if dimensions are invalid
Sourcepub fn resample_with_edge_mode(
&self,
src: &RasterBuffer,
dst_width: u64,
dst_height: u64,
edge_mode: EdgeMode,
) -> Result<RasterBuffer>
pub fn resample_with_edge_mode( &self, src: &RasterBuffer, dst_width: u64, dst_height: u64, edge_mode: EdgeMode, ) -> Result<RasterBuffer>
Resamples with edge handling
This variant allows specifying how to handle source samples that the
kernel window would otherwise read from outside [0, width) x [0, height) near the image border.
§Arguments
src- Source bufferdst_width- Destination widthdst_height- Destination heightedge_mode- How to handle edge pixels
§Errors
Returns an error if parameters are invalid
Sourcepub fn resample_separable(
&self,
src: &RasterBuffer,
dst_width: u64,
dst_height: u64,
) -> Result<RasterBuffer>
pub fn resample_separable( &self, src: &RasterBuffer, dst_width: u64, dst_height: u64, ) -> Result<RasterBuffer>
Separable Lanczos resampling (optimized 2-pass)
This performs resampling in two passes (horizontal then vertical) which is more cache-friendly and can be faster for large kernels.
§Errors
Returns an error if parameters are invalid
Trait Implementations§
Source§impl Clone for LanczosResampler
impl Clone for LanczosResampler
Source§fn clone(&self) -> LanczosResampler
fn clone(&self) -> LanczosResampler
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 LanczosResampler
Source§impl Debug for LanczosResampler
impl Debug for LanczosResampler
Auto Trait Implementations§
impl Freeze for LanczosResampler
impl RefUnwindSafe for LanczosResampler
impl Send for LanczosResampler
impl Sync for LanczosResampler
impl Unpin for LanczosResampler
impl UnsafeUnpin for LanczosResampler
impl UnwindSafe for LanczosResampler
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
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