pub struct Resizer { /* private fields */ }Expand description
Methods of this structure used to resize images.
Implementations§
Source§impl Resizer
impl Resizer
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an instance of Resizer.
By default, an instance of Resizer is created with the best CPU
extensions provided by your CPU.
You can change this by using the method Resizer::set_cpu_extensions.
Sourcepub fn resize<'o>(
&mut self,
src_image: &impl IntoImageView,
dst_image: &mut impl IntoImageViewMut,
options: impl Into<Option<&'o ResizeOptions>>,
) -> Result<(), ResizeError>
pub fn resize<'o>( &mut self, src_image: &impl IntoImageView, dst_image: &mut impl IntoImageViewMut, options: impl Into<Option<&'o ResizeOptions>>, ) -> Result<(), ResizeError>
Resize the source image to the size of the destination image and save the result to the latter’s pixel buffer.
Sourcepub fn resize_typed<'o, P: PixelTrait>(
&mut self,
src_view: &impl ImageView<Pixel = P>,
dst_view: &mut impl ImageViewMut<Pixel = P>,
options: impl Into<Option<&'o ResizeOptions>>,
) -> Result<(), ResizeError>
pub fn resize_typed<'o, P: PixelTrait>( &mut self, src_view: &impl ImageView<Pixel = P>, dst_view: &mut impl ImageViewMut<Pixel = P>, options: impl Into<Option<&'o ResizeOptions>>, ) -> Result<(), ResizeError>
Resize the source image to the size of the destination image and save the result to the latter’s pixel buffer.
Sourcepub fn size_of_internal_buffers(&self) -> usize
pub fn size_of_internal_buffers(&self) -> usize
Returns the size of internal buffers used to store the results of intermediate resizing steps.
Sourcepub fn reset_internal_buffers(&mut self)
pub fn reset_internal_buffers(&mut self)
Deallocates the internal buffers used to store the results of intermediate resizing steps.
pub fn cpu_extensions(&self) -> CpuExtensions
Sourcepub unsafe fn set_cpu_extensions(&mut self, extensions: CpuExtensions)
pub unsafe fn set_cpu_extensions(&mut self, extensions: CpuExtensions)
§Safety
This is unsafe because this method allows you to set a CPU extension that is not supported by your CPU.