Expand description
§bc-mur
Multipart UR QR code generator — single-frame and animated fountain-coded QR sequences with optional logo overlay.
This crate provides:
- Single-frame QR code rendering from raw bytes or UR strings
- Logo overlay with module-aligned compositing
- Animated multipart fountain-coded QR sequences (GIF)
- ProRes 4444 encoding via optional ffmpeg integration
- Frame dump for custom pipelines
§Example
use bc_mur::{Color, CorrectionLevel, render_qr};
let img = render_qr(
b"UR:BYTES/HDCXDWINVEZM",
CorrectionLevel::Low,
512,
Color::BLACK,
Color::WHITE,
1, // quiet zone modules
None, // no logo
)
.unwrap();
let png_bytes = img.to_png().unwrap();
assert!(!png_bytes.is_empty());Structs§
- Animate
Params - Parameters for multipart animated QR generation.
- Color
- RGBA color with 8-bit channels.
- Logo
- A pre-rendered logo for compositing onto QR codes.
- QrFrame
- A single frame of a multipart QR animation.
- Rendered
Image - An RGBA pixel buffer with encoding methods.
Enums§
- Correction
Level - QR error correction level.
- Error
- Logo
Clear Shape - Shape used to clear the center area behind the logo.
Constants§
- DEFAULT_
MAX_ MODULES - Default maximum QR module count for reliable phone scanning. Corresponds to QR version 25 (117×117 modules).
Functions§
- check_
qr_ density - Check that a module count is within a density limit.
- encode_
animated_ gif - Encode frames into an animated GIF.
- encode_
prores - Encode frames to ProRes 4444 via ffmpeg subprocess.
- generate_
frames - Generate all frames for a multipart UR animation.
- qr_
module_ count - Get the QR module count for a message without rendering.
- render_
qr - Render a single-frame QR code from raw bytes.
- render_
ur_ qr - Render a single-frame QR code from a UR string.
- write_
frame_ pngs - Write frames as numbered PNG files.