#[non_exhaustive]pub struct ResizeOptions {
pub filter: Filter,
pub fit: Fit,
pub without_enlargement: bool,
pub background: [u8; 4],
}Expand description
Options for Resize.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.filter: FilterThe resampling filter. Defaults to Filter::Lanczos3.
fit: FitHow the target box is interpreted.
without_enlargement: boolNever scale up: an image already smaller than the box is left alone.
background: [u8; 4]The RGBA colour Fit::Contain pads with: opaque black by default,
as in sharp. Grey formats take its luma; formats without alpha
ignore its alpha.
Implementations§
Source§impl ResizeOptions
impl ResizeOptions
Sourcepub const fn with_filter(self, filter: Filter) -> ResizeOptions
pub const fn with_filter(self, filter: Filter) -> ResizeOptions
Options with an explicit filter.
Sourcepub const fn with_fit(self, fit: Fit) -> ResizeOptions
pub const fn with_fit(self, fit: Fit) -> ResizeOptions
Options with an explicit fit mode.
Sourcepub const fn with_background(self, rgba: [u8; 4]) -> ResizeOptions
pub const fn with_background(self, rgba: [u8; 4]) -> ResizeOptions
Options with an explicit padding colour for Fit::Contain.
Sourcepub const fn without_enlargement(self, refuse: bool) -> ResizeOptions
pub const fn without_enlargement(self, refuse: bool) -> ResizeOptions
Options that refuse to enlarge.
Trait Implementations§
Source§impl Clone for ResizeOptions
impl Clone for ResizeOptions
Source§fn clone(&self) -> ResizeOptions
fn clone(&self) -> ResizeOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ResizeOptions
Source§impl Debug for ResizeOptions
impl Debug for ResizeOptions
Source§impl Default for ResizeOptions
impl Default for ResizeOptions
Source§fn default() -> ResizeOptions
fn default() -> ResizeOptions
Returns the “default value” for a type. Read more
impl Eq for ResizeOptions
Source§impl Hash for ResizeOptions
impl Hash for ResizeOptions
Source§impl PartialEq for ResizeOptions
impl PartialEq for ResizeOptions
impl StructuralPartialEq for ResizeOptions
Auto Trait Implementations§
impl Freeze for ResizeOptions
impl RefUnwindSafe for ResizeOptions
impl Send for ResizeOptions
impl Sync for ResizeOptions
impl Unpin for ResizeOptions
impl UnsafeUnpin for ResizeOptions
impl UnwindSafe for ResizeOptions
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