pub struct ImageOptions {
pub image_size: f64,
pub hide_background_dots: bool,
pub margin: u32,
pub cross_origin: Option<String>,
pub save_as_blob: bool,
}Expand description
Options for embedding an image/logo in the QR code.
Fields§
§image_size: f64Size of the image relative to the QR code (0.0 to 1.0).
hide_background_dots: boolWhether to hide dots behind the image.
margin: u32Margin around the image in modules.
cross_origin: Option<String>Cross-origin setting for loading images (browser context).
save_as_blob: boolWhether to save the image as a data URL in SVG.
Implementations§
Source§impl ImageOptions
impl ImageOptions
Sourcepub fn with_image_size(self, size: f64) -> Self
pub fn with_image_size(self, size: f64) -> Self
Set the image size ratio.
Sourcepub fn with_hide_background_dots(self, hide: bool) -> Self
pub fn with_hide_background_dots(self, hide: bool) -> Self
Set whether to hide background dots.
Sourcepub fn with_margin(self, margin: u32) -> Self
pub fn with_margin(self, margin: u32) -> Self
Set the margin around the image.
Sourcepub fn with_cross_origin(self, cross_origin: impl Into<String>) -> Self
pub fn with_cross_origin(self, cross_origin: impl Into<String>) -> Self
Set cross-origin setting.
Sourcepub fn with_save_as_blob(self, save: bool) -> Self
pub fn with_save_as_blob(self, save: bool) -> Self
Set whether to save as blob/data URL.
Trait Implementations§
Source§impl Clone for ImageOptions
impl Clone for ImageOptions
Source§fn clone(&self) -> ImageOptions
fn clone(&self) -> ImageOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageOptions
impl Debug for ImageOptions
Source§impl Default for ImageOptions
impl Default for ImageOptions
Source§impl PartialEq for ImageOptions
impl PartialEq for ImageOptions
impl StructuralPartialEq for ImageOptions
Auto Trait Implementations§
impl Freeze for ImageOptions
impl RefUnwindSafe for ImageOptions
impl Send for ImageOptions
impl Sync for ImageOptions
impl Unpin for ImageOptions
impl UnsafeUnpin for ImageOptions
impl UnwindSafe for ImageOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.