pub struct Logo {
pub pixels: Vec<u8>,
pub width: u32,
pub height: u32,
pub fraction: f64,
pub clear_border: usize,
pub clear_shape: LogoClearShape,
}Expand description
A pre-rendered logo for compositing onto QR codes.
Fields§
§pixels: Vec<u8>RGBA pixels, row-major.
width: u32§height: u32§fraction: f64Fraction of QR width to occupy (0.01–0.99, default 0.25).
clear_border: usizeNumber of clear-border modules around the logo (0–5, default 1).
clear_shape: LogoClearShapeShape of the cleared center area.
Implementations§
Source§impl Logo
impl Logo
Sourcepub fn from_svg(
svg_data: &[u8],
fraction: f64,
clear_border: usize,
clear_shape: LogoClearShape,
) -> Result<Self>
pub fn from_svg( svg_data: &[u8], fraction: f64, clear_border: usize, clear_shape: LogoClearShape, ) -> Result<Self>
Create a logo from SVG data, rendered at 512×512 via resvg (pure Rust, no system deps).
Sourcepub fn from_rgba(
pixels: Vec<u8>,
width: u32,
height: u32,
fraction: f64,
clear_border: usize,
clear_shape: LogoClearShape,
) -> Result<Self>
pub fn from_rgba( pixels: Vec<u8>, width: u32, height: u32, fraction: f64, clear_border: usize, clear_shape: LogoClearShape, ) -> Result<Self>
Create a logo from raw RGBA pixels.
Sourcepub fn from_image_bytes(
data: &[u8],
fraction: f64,
clear_border: usize,
clear_shape: LogoClearShape,
) -> Result<Self>
pub fn from_image_bytes( data: &[u8], fraction: f64, clear_border: usize, clear_shape: LogoClearShape, ) -> Result<Self>
Create a logo from PNG or JPEG image bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logo
impl RefUnwindSafe for Logo
impl Send for Logo
impl Sync for Logo
impl Unpin for Logo
impl UnsafeUnpin for Logo
impl UnwindSafe for Logo
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