writer test pass

This commit is contained in:
Henry Schimke
2022-12-26 14:07:00 -06:00
parent b0cd7f20f4
commit 3021c163d4
4 changed files with 32 additions and 32 deletions

View File

@@ -72,7 +72,7 @@ impl BarcodeMatrix {
}
pub fn getScaledMatrix(&self, xScale: usize, yScale: usize) -> Vec<Vec<u8>> {
let mut matrixOut = vec![vec![0; self.height * yScale]; self.width * xScale];
let mut matrixOut = vec![vec![0; self.width * xScale]; self.height * yScale];
// byte[][] matrixOut = new byte[height * yScale][width * xScale];
let yMax = self.height * yScale;
for i in 0..yMax {

View File

@@ -4,8 +4,8 @@ pub use compaction::*;
mod barcode_row;
pub use barcode_row::*;
mod barcode_batrix;
pub use barcode_batrix::*;
mod barcode_matrix;
pub use barcode_matrix::*;
mod dimensions;
pub use dimensions::*;

View File

@@ -181,7 +181,7 @@ pub fn generateErrorCorrection(
) -> Result<String, Exceptions> {
let k = getErrorCorrectionCodewordCount(errorCorrectionLevel)?;
let mut e = vec![0 as char; k as usize]; //new char[k];
let sld = dataCodewords.len();
let sld = dataCodewords.chars().count();
for i in 0..sld {
// for (int i = 0; i < sld; i++) {
let t1 = (dataCodewords.chars().nth(i).unwrap() as u32 + e[e.len() - 1] as u32) % 929;