Skip to main content

bc_mur/
lib.rs

1#![doc(html_root_url = "https://docs.rs/bc-mur/0.1.0")]
2#![warn(rust_2018_idioms)]
3
4//! # bc-mur
5//!
6//! Multipart UR QR code generator — single-frame and animated
7//! fountain-coded QR sequences with optional logo overlay.
8//!
9//! This crate provides:
10//! - Single-frame QR code rendering from raw bytes or UR strings
11//! - Logo overlay with module-aligned compositing
12//! - Animated multipart fountain-coded QR sequences (GIF)
13//! - ProRes 4444 encoding via optional ffmpeg integration
14//! - Frame dump for custom pipelines
15//!
16//! # Example
17//!
18//! ```rust
19//! use bc_mur::{Color, CorrectionLevel, render_qr};
20//!
21//! let img = render_qr(
22//!     b"UR:BYTES/HDCXDWINVEZM",
23//!     CorrectionLevel::Low,
24//!     512,
25//!     Color::BLACK,
26//!     Color::WHITE,
27//!     1,    // quiet zone modules
28//!     None, // no logo
29//! )
30//! .unwrap();
31//! let png_bytes = img.to_png().unwrap();
32//! assert!(!png_bytes.is_empty());
33//! ```
34
35mod animate;
36mod color;
37mod correction;
38mod error;
39mod logo;
40mod prores;
41mod qr_matrix;
42mod render;
43
44pub use animate::{
45    AnimateParams, QrFrame, encode_animated_gif, generate_frames,
46    write_frame_pngs,
47};
48pub use color::Color;
49pub use correction::CorrectionLevel;
50pub use error::{Error, Result};
51pub use logo::{Logo, LogoClearShape};
52pub use prores::encode_prores;
53pub use qr_matrix::{DEFAULT_MAX_MODULES, check_qr_density, qr_module_count};
54pub use render::{RenderedImage, render_qr, render_ur_qr};