Expand description
QR Scanner in Rust. Ported from quirc.
§Example
// open the image from disk
let img = image::open("tests/data/Hello+World.png").expect("failed to open image");
// convert to gray scale
let img_gray = img.into_luma8();
// create a decoder
let mut decoder = quircs::Quirc::default();
// identify all qr codes
let codes = decoder.identify(img_gray.width() as usize, img_gray.height() as usize, &img_gray);
for code in codes {
let code = code.expect("failed to extract qr code");
let decoded = code.decode().expect("failed to decode qr code");
println!("qrcode: {}", std::str::from_utf8(&decoded.payload).unwrap());
}
Structs§
- Capstone
- Code
- This structure is used to return information about detected QR codes in the input image.
- Code
Iter - Data
- This structure holds the decoded QR-code data
- Grid
- Point
- Quirc
- Region
- RsParams
- QR-code version information database
- Version
Info
Enums§
- Data
Type - QR-code data types.
- Decode
Error - EccLevel
- QR-code ECC types.
- Eci
- Common character encodings
- Extract
Error
Constants§
Statics§
Functions§
- version
- Obtain the library version string.