pub struct Canvas { /* fields omitted */ }
Canvas
is an intermediate helper structure to render error-corrected data
into a QR code.
Constructs a new canvas big enough for a QR code of the given version.
Obtains a module at the given coordinates. For convenience, negative
coordinates will wrap around.
Obtains a mutable module at the given coordinates. For convenience,
negative coordinates will wrap around.
Sets the color of a functional module at the given coordinates. For
convenience, negative coordinates will wrap around.
Draw all functional patterns, before data placement.
All functional patterns (e.g. the finder pattern) except the format
info pattern will be filled in. The format info pattern will be filled
with light modules instead. Data bits can then put in the empty modules.
with .draw_data()
.
Draws the encoded data and error correction codes to the empty modules.
Applies a mask to the canvas. This method will also draw the format info
patterns.
Construct a new canvas and apply the best masking that gives the lowest
penalty score.
Deprecated since 0.4.0
: use into_colors()
instead
Convert the modules into a vector of booleans.
Convert the modules into a vector of colors.
Performs copy-assignment from source
. Read more