pub enum SizeHint {
Scale(OrderedFloat<f32>),
Width(u32),
Height(u32),
Size {
width: u32,
height: u32,
maintain_aspect_ratio: bool,
},
}
Expand description
Given as a hint for image loading requests.
Used mostly for rendering SVG:s to a good size.
The SizeHint
determines at what resolution the image should be rasterized.
Variants§
Scale(OrderedFloat<f32>)
Scale original size by some factor, keeping the original aspect ratio.
The original size of the image is usually its texel resolution, but for an SVG it’s the point size of the SVG.
For instance, setting Scale(2.0)
will rasterize SVG:s to twice their original size,
which is useful for high-DPI displays.
Width(u32)
Scale to exactly this pixel width, keeping the original aspect ratio.
Height(u32)
Scale to exactly this pixel height, keeping the original aspect ratio.
Size
Scale to this pixel size.
Implementations§
Trait Implementations§
Source§impl Ord for SizeHint
impl Ord for SizeHint
Source§impl PartialOrd for SizeHint
impl PartialOrd for SizeHint
impl Copy for SizeHint
impl Eq for SizeHint
impl StructuralPartialEq for SizeHint
Auto Trait Implementations§
impl Freeze for SizeHint
impl RefUnwindSafe for SizeHint
impl Send for SizeHint
impl Sync for SizeHint
impl Unpin for SizeHint
impl UnwindSafe for SizeHint
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