[−][src]Struct qrcode::canvas::Canvas
Canvas
is an intermediate helper structure to render error-corrected data
into a QR code.
Methods
impl Canvas
[src]
pub fn new(version: Version, ec_level: EcLevel) -> Self
[src]
Constructs a new canvas big enough for a QR code of the given version.
pub fn get(&self, x: i16, y: i16) -> Module
[src]
Obtains a module at the given coordinates. For convenience, negative coordinates will wrap around.
pub fn get_mut(&mut self, x: i16, y: i16) -> &mut Module
[src]
Obtains a mutable module at the given coordinates. For convenience, negative coordinates will wrap around.
pub fn put(&mut self, x: i16, y: i16, color: Color)
[src]
Sets the color of a functional module at the given coordinates. For convenience, negative coordinates will wrap around.
impl Canvas
[src]
pub fn draw_all_functional_patterns(&mut self)
[src]
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()
.
impl Canvas
[src]
pub fn draw_data(&mut self, data: &[u8], ec: &[u8])
[src]
Draws the encoded data and error correction codes to the empty modules.
impl Canvas
[src]
pub fn apply_mask(&mut self, pattern: MaskPattern)
[src]
Applies a mask to the canvas. This method will also draw the format info patterns.
impl Canvas
[src]
pub fn apply_best_mask(&self) -> Self
[src]
Construct a new canvas and apply the best masking that gives the lowest penalty score.
pub fn to_bools(&self) -> Vec<bool>
[src]
use into_colors()
instead
Convert the modules into a vector of booleans.
pub fn into_colors(self) -> Vec<Color>
[src]
Convert the modules into a vector of colors.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Canvas
impl Send for Canvas
impl Sync for Canvas
impl Unpin for Canvas
impl UnwindSafe for Canvas
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,