[][src]Module qr_code::canvas

The canvas module puts raw bits into the QR code canvas.

use qr_code::types::{Version, EcLevel};
use qr_code::canvas::{Canvas, MaskPattern};

let mut c = Canvas::new(Version::Normal(1), EcLevel::L);
c.draw_all_functional_patterns();
c.draw_data(b"data_here", b"ec_code_here");
c.apply_mask(MaskPattern::Checkerboard);
let bools = c.to_bools();

Structs

Canvas

Canvas is an intermediate helper structure to render error-corrected data into a QR code.

Enums

MaskPattern

The mask patterns. Since QR code and Micro QR code do not use the same pattern number, we name them according to their shape instead of the number.

Module

The color of a module (pixel) in the QR code.

Functions

is_functional

Gets whether the module at the given coordinates represents a functional module.