Enum qrcode::canvas::MaskPattern
source · pub enum MaskPattern {
Checkerboard = 0,
HorizontalLines = 1,
VerticalLines = 2,
DiagonalLines = 3,
LargeCheckerboard = 4,
Fields = 5,
Diamonds = 6,
Meadow = 7,
}
Expand description
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.
Variants§
Checkerboard = 0
QR code pattern 000: (x + y) % 2 == 0
.
HorizontalLines = 1
QR code pattern 001: y % 2 == 0
.
VerticalLines = 2
QR code pattern 010: x % 3 == 0
.
DiagonalLines = 3
QR code pattern 011: (x + y) % 3 == 0
.
LargeCheckerboard = 4
QR code pattern 100: ((x/3) + (y/2)) % 2 == 0
.
Fields = 5
QR code pattern 101: (x*y)%2 + (x*y)%3 == 0
.
Diamonds = 6
QR code pattern 110: ((x*y)%2 + (x*y)%3) % 2 == 0
.
Meadow = 7
QR code pattern 111: ((x+y)%2 + (x*y)%3) % 2 == 0
.
Trait Implementations§
source§impl Clone for MaskPattern
impl Clone for MaskPattern
source§fn clone(&self) -> MaskPattern
fn clone(&self) -> MaskPattern
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MaskPattern
impl Debug for MaskPattern
impl Copy for MaskPattern
Auto Trait Implementations§
impl RefUnwindSafe for MaskPattern
impl Send for MaskPattern
impl Sync for MaskPattern
impl Unpin for MaskPattern
impl UnwindSafe for MaskPattern
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more