QR Code Generator
This crate provides functions to generate QR Code matrices and images in RAW, PNG and SVG formats.
Examples
Encode any data to a QR Code matrix which is Vec<Vec<bool>>
.
use QrCodeEcc;
let result: = to_matrix.unwrap;
println!;
Encode any data to a PNG image stored in a Vec instance.
use QrCodeEcc;
let result: = to_png_to_vec.unwrap;
println!;
Encode any data to a PNG image stored in a file.
use QrCodeEcc;
to_png_to_file.unwrap;
Encode any data to a SVG image stored in a String instance.
use QrCodeEcc;
let result: String = to_svg_to_string.unwrap;
println!;
Encode any data to a SVG image stored in a file.
use QrCodeEcc;
to_svg_to_file.unwrap;
Low-level Usage
Raw Image Data
The to_image
and to_image_buffer
functions can be used, if you want to modify your image.
Segments
Every to_*
function has a corresponding _from_segments
function. You can concatenate segments by using different encoding methods, such as numeric, alphanumeric or binary to reduce the size (level) of your QR code matrix/image.
use ;
let first = "1234567";
let second = "ABCDEFG";
let segments = ;
let result: = to_matrix_from_segments.unwrap;
println!;
More segments optimization apporaches: magiclen/qrcode-segments-optimizer
Crates.io
https://crates.io/crates/qrcode-generator
Documentation
https://docs.rs/qrcode-generator