Expand description
Find and read QR-Codes
This crates exports functions and types that can be used to search for QR-Codes in images and decode them.
§Usage
The most basic usage is shown below:
use image;
// Load on image to search, convert it to grayscale
let img = image::open("tests/data/github.gif")?.to_luma8();
// Prepare for detection
let mut img = rqrr::PreparedImage::prepare(img);
// Search for grids, without decoding
let grids = img.detect_grids();
assert_eq!(grids.len(), 1);
// Decode the grid
let (meta, content) = grids[0].decode()?;
assert_eq!(meta.ecc_level, 0);
assert_eq!(content, "https://github.com/WanzenBug/rqrr");
If you have some other form of picture storage, you can use
PreparedImage::prepare_from_*
. This allows
you to define your own source for images.
Structs§
- Wrapper around any grid that can be interpreted as a QR code
- MetaData for a QR grid
- A simple point in (some) space
- An black-and-white image that can be mutated on search for QR codes
- A basic GridImage that can be generated from a given function.
- Version of a QR Code which determines its size
Enums§
- Possible errors that can happen during decoding
Traits§
- A grid that contains exactly one QR code square.