Crate rqrr

Crate rqrr 

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

Grid
Wrapper around any grid that can be interpreted as a QR code
MetaData
MetaData for a QR grid
MirroredGrid
Mirrored grid, switching x and y coordinates
Point
A simple point in (some) space
PreparedImage
An black-and-white image that can be mutated on search for QR codes
RawData
The bit stream contained in the QR Code
SimpleGrid
A basic GridImage that can be generated from a given function.
Version
Version of a QR Code which determines its size

Enums§

DeQRError
Possible errors that can happen during decoding

Constants§

MAX_PAYLOAD_SIZE

Traits§

BitGrid
A grid that contains exactly one QR code square.