pub struct Matrix {
pub size: usize,
pub modules: Vec<Module>,
}Expand description
Matrix is a 2-dimensional grid holding the QR modules.
Fields§
§size: usizeSize defines the width and height of the matrix.
modules: Vec<Module>The modules.
Implementations§
Source§impl Matrix
impl Matrix
Sourcepub fn is_fun(&self, x: usize, y: usize) -> bool
pub fn is_fun(&self, x: usize, y: usize) -> bool
Return true if the module at x,y is a function module.
Sourcepub fn is_data(&self, x: usize, y: usize) -> bool
pub fn is_data(&self, x: usize, y: usize) -> bool
Return true if the module at x,y contains data.
Sourcepub fn set_fun(&mut self, x: usize, y: usize, v: bool)
pub fn set_fun(&mut self, x: usize, y: usize, v: bool)
Assign a function module. Fails if the existing module is a Data module.
Sourcepub fn set_data(&mut self, x: usize, y: usize, v: bool)
pub fn set_data(&mut self, x: usize, y: usize, v: bool)
Assign a data module. Fails unless the existing module is Unknown.
Sourcepub fn set_square_outline(&mut self, x: usize, y: usize, w: usize, v: Module)
pub fn set_square_outline(&mut self, x: usize, y: usize, w: usize, v: Module)
Set square outline.
Sourcepub fn any_in_square(&self, x: usize, y: usize, w: usize) -> bool
pub fn any_in_square(&self, x: usize, y: usize, w: usize) -> bool
Return true if there’s any module other than Unknown in square.
Trait Implementations§
impl Eq for Matrix
impl StructuralPartialEq for Matrix
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnwindSafe for Matrix
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