Begin porting qrcode

This commit is contained in:
Henry Schimke
2022-09-30 16:20:46 -05:00
parent 5436b8d9f3
commit 9f0fcf7ce9
10 changed files with 123 additions and 99 deletions

View File

@@ -0,0 +1,3 @@
mod qr_code;
pub use qr_code::*;

View File

@@ -14,27 +14,26 @@
* limitations under the License.
*/
package com.google.zxing.qrcode.encoder;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.google.zxing.qrcode.decoder.Mode;
import com.google.zxing.qrcode.decoder.Version;
const NUM_MASK_PATTERNS : u32 = 8;
/**
* @author satorux@google.com (Satoru Takabayashi) - creator
* @author dswitkin@google.com (Daniel Switkin) - ported from C++
*/
public final class QRCode {
pub struct QRCode {
public static final int NUM_MASK_PATTERNS = 8;
// public static final int NUM_MASK_PATTERNS = 8;
private Mode mode;
private ErrorCorrectionLevel ecLevel;
private Version version;
private int maskPattern;
private ByteMatrix matrix;
mode:Mode,
ecLevel:ErrorCorrectionLevel,
version:Version,
maskPattern:i32,
matrix:ByteMatrix,
public QRCode() {
}
impl QRCode {
pub fn new()->Self {
maskPattern = -1;
}