pub struct ScaleOperation;Expand description
Image scaling operations
Implementations§
Source§impl ScaleOperation
impl ScaleOperation
Sourcepub fn scale(
device: &GpuDevice,
input: &[u8],
src_width: u32,
src_height: u32,
output: &mut [u8],
dst_width: u32,
dst_height: u32,
filter: ScaleFilter,
) -> Result<()>
pub fn scale( device: &GpuDevice, input: &[u8], src_width: u32, src_height: u32, output: &mut [u8], dst_width: u32, dst_height: u32, filter: ScaleFilter, ) -> Result<()>
Scale an image
§Arguments
device- GPU deviceinput- Input image buffer (packed RGBA format)src_width- Source image widthsrc_height- Source image heightoutput- Output image buffer (packed RGBA format)dst_width- Destination image widthdst_height- Destination image heightfilter- Scaling filter type
§Errors
Returns an error if buffer sizes are invalid or if the GPU operation fails.
Sourcepub fn lanczos3_cpu(
input: &[u8],
src_width: u32,
src_height: u32,
output: &mut [u8],
dst_width: u32,
dst_height: u32,
) -> Result<()>
pub fn lanczos3_cpu( input: &[u8], src_width: u32, src_height: u32, output: &mut [u8], dst_width: u32, dst_height: u32, ) -> Result<()>
CPU Lanczos-3 resampling (a = 3, window = 6 taps).
Uses separable 2-pass approach (horizontal then vertical) for efficiency. The sinc-windowed-sinc kernel produces high-quality results with minimal ringing artefacts.
Auto Trait Implementations§
impl Freeze for ScaleOperation
impl RefUnwindSafe for ScaleOperation
impl Send for ScaleOperation
impl Sync for ScaleOperation
impl Unpin for ScaleOperation
impl UnsafeUnpin for ScaleOperation
impl UnwindSafe for ScaleOperation
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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