MCPcopy
hub / github.com/zxing-js/library / decode

Method decode

src/core/aztec/decoder/Decoder.ts:75–85  ·  view source on GitHub ↗
(detectorResult: AztecDetectorResult)

Source from the content-addressed store, hash-verified

73 private ddata: AztecDetectorResult;
74
75 public decode(detectorResult: AztecDetectorResult): DecoderResult {
76 this.ddata = detectorResult;
77 let matrix = detectorResult.getBits();
78 let rawbits = this.extractBits(matrix);
79 let correctedBits = this.correctBits(rawbits);
80 let rawBytes = Decoder.convertBoolArrayToByteArray(correctedBits);
81 let result = Decoder.getEncodedData(correctedBits);
82 let decoderResult = new DecoderResult(rawBytes, result, null, null);
83 decoderResult.setNumBits(correctedBits.length);
84 return decoderResult;
85 }
86
87 // This method is used for testing the high-level encoder
88 public static highLevelDecode(correctedBits: boolean[]): string {

Callers

nothing calls this directly

Calls 6

extractBitsMethod · 0.95
correctBitsMethod · 0.95
setNumBitsMethod · 0.95
getEncodedDataMethod · 0.80
getBitsMethod · 0.45

Tested by

no test coverage detected