Enum qrcode::canvas::Module [−][src]
The color of a module (pixel) in the QR code.
Variants
Empty
The module is empty.
Masked(Color)
The module is of functional patterns which cannot be masked, or pixels which have been masked.
Unmasked(Color)
The module is of data and error correction bits before masking.
Methods
impl Module
[src]
impl Module
pub fn is_dark(self) -> bool
[src]
pub fn is_dark(self) -> bool
Checks whether a module is dark.
pub fn mask(self, should_invert: bool) -> Self
[src]
pub fn mask(self, should_invert: bool) -> Self
Apply a mask to the unmasked modules.
use qrcode::canvas::Module; use qrcode::types::Color; assert_eq!(Module::Unmasked(Color::Light).mask(true), Module::Masked(Color::Dark)); assert_eq!(Module::Unmasked(Color::Dark).mask(true), Module::Masked(Color::Light)); assert_eq!(Module::Unmasked(Color::Light).mask(false), Module::Masked(Color::Light)); assert_eq!(Module::Masked(Color::Dark).mask(true), Module::Masked(Color::Dark)); assert_eq!(Module::Masked(Color::Dark).mask(false), Module::Masked(Color::Dark));
Trait Implementations
impl PartialEq for Module
[src]
impl PartialEq for Module
fn eq(&self, other: &Module) -> bool
[src]
fn eq(&self, other: &Module) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Module) -> bool
[src]
fn ne(&self, other: &Module) -> bool
This method tests for !=
.
impl Eq for Module
[src]
impl Eq for Module
impl Clone for Module
[src]
impl Clone for Module
fn clone(&self) -> Module
[src]
fn clone(&self) -> Module
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Module
[src]
impl Copy for Module
impl Debug for Module
[src]
impl Debug for Module
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl From<Module> for Color
[src]
impl From<Module> for Color