Skip to main content

Crate bc_mur

Crate bc_mur 

Source
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§

AnimateParams
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.
RenderedImage
An RGBA pixel buffer with encoding methods.

Enums§

CorrectionLevel
QR error correction level.
Error
LogoClearShape
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.

Type Aliases§

Result