pub struct EncodeSpec {
pub format: ImageFormat,
pub quality: Option<f64>,
pub fit: Option<Size>,
}Expand description
What Toolkit::encode_image should produce (docs/images.md).
A struct rather than three positional arguments, per docs/api-style.md: the call site reads
EncodeSpec { format: ImageFormat::Jpeg, quality: Some(0.8), ..Default::default() }.
Fields§
§format: ImageFormat§quality: Option<f64>Lossy quality in 0.0..=1.0. None takes the platform’s default; a lossless format
ignores it.
fit: Option<Size>Scale the longest side down to fit this box first (aspect preserved). None encodes at
the image’s own size.
Trait Implementations§
Source§impl Clone for EncodeSpec
impl Clone for EncodeSpec
Source§fn clone(&self) -> EncodeSpec
fn clone(&self) -> EncodeSpec
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 EncodeSpec
Source§impl Debug for EncodeSpec
impl Debug for EncodeSpec
Source§impl Default for EncodeSpec
impl Default for EncodeSpec
Source§impl PartialEq for EncodeSpec
impl PartialEq for EncodeSpec
impl StructuralPartialEq for EncodeSpec
Auto Trait Implementations§
impl Freeze for EncodeSpec
impl RefUnwindSafe for EncodeSpec
impl Send for EncodeSpec
impl Sync for EncodeSpec
impl Unpin for EncodeSpec
impl UnsafeUnpin for EncodeSpec
impl UnwindSafe for EncodeSpec
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