pub enum ImageScalingAlgorithm {
Auto,
Smooth,
Pixelated,
}Expand description
Defines how images should be scaled when rendered.
Variants§
Auto
The image is scaled using Catmull-Rom interpolation. This is balanced for speed and quality.
Smooth
The image is scaled using Lanczos3 resampling. This provides high-quality scaling but may be slower.
Pixelated
The image is scaled using nearest neighbor interpolation, which is suitable for pixel art or images where sharp edges are desired.
Trait Implementations§
Source§impl Clone for ImageScalingAlgorithm
impl Clone for ImageScalingAlgorithm
Source§fn clone(&self) -> ImageScalingAlgorithm
fn clone(&self) -> ImageScalingAlgorithm
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 ImageScalingAlgorithm
Source§impl Debug for ImageScalingAlgorithm
impl Debug for ImageScalingAlgorithm
Source§impl Default for ImageScalingAlgorithm
impl Default for ImageScalingAlgorithm
Source§fn default() -> ImageScalingAlgorithm
fn default() -> ImageScalingAlgorithm
Returns the “default value” for a type. Read more
Source§impl From<ImageScalingAlgorithm> for FilterType
impl From<ImageScalingAlgorithm> for FilterType
Source§fn from(algorithm: ImageScalingAlgorithm) -> Self
fn from(algorithm: ImageScalingAlgorithm) -> Self
Converts to this type from the input type.
Source§impl<'i> FromCss<'i> for ImageScalingAlgorithm
impl<'i> FromCss<'i> for ImageScalingAlgorithm
Source§const VALID_TOKENS: &'static [CssToken]
const VALID_TOKENS: &'static [CssToken]
Returns the list of valid CSS tokens for this type.
Source§fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
Parses the type from a
Parser instance.Source§fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
Helper function to parse the type from a string.
Source§const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
Message template used when building parse errors for this type.
Source§impl PartialEq for ImageScalingAlgorithm
impl PartialEq for ImageScalingAlgorithm
Source§fn eq(&self, other: &ImageScalingAlgorithm) -> bool
fn eq(&self, other: &ImageScalingAlgorithm) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ImageScalingAlgorithm
Auto Trait Implementations§
impl Freeze for ImageScalingAlgorithm
impl RefUnwindSafe for ImageScalingAlgorithm
impl Send for ImageScalingAlgorithm
impl Sync for ImageScalingAlgorithm
impl Unpin for ImageScalingAlgorithm
impl UnsafeUnpin for ImageScalingAlgorithm
impl UnwindSafe for ImageScalingAlgorithm
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