Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PDF417ScanningDecoder

author

Guenther Grau

Hierarchy

  • PDF417ScanningDecoder

Index

Constructors

Private constructor

Properties

Static CODEWORD_SKEW_SIZE

CODEWORD_SKEW_SIZE: int = 2

Static MAX_EC_CODEWORDS

MAX_EC_CODEWORDS: int = 512

Static MAX_ERRORS

MAX_ERRORS: int = 3

Static errorCorrection

errorCorrection: ErrorCorrection = new ErrorCorrection()

Methods

Static Private adjustBoundingBox

Static Private adjustCodewordCount

Static Private adjustCodewordStartColumn

  • adjustCodewordStartColumn(image: BitMatrix, minColumn: int, maxColumn: int, leftToRight: boolean, codewordStartColumn: int, imageRow: int): int

Static Private checkCodewordSkew

  • checkCodewordSkew(codewordSize: int, minCodewordWidth: int, maxCodewordWidth: int): boolean

Static Private correctErrors

  • correctErrors(codewords: Int32Array, erasures: Int32Array, numECCodewords: int): int
  • Given data and error-correction codewords received, possibly corrupted by errors, attempts to correct the errors in-place.

    throws

    ChecksumException if error correction fails

    Parameters

    • codewords: Int32Array

      data and error correction codewords

    • erasures: Int32Array

      positions of any known erasures

    • numECCodewords: int

      number of error correction codewords that are available in codewords

    Returns int

Static Private createBarcodeMatrix

Static Private createDecoderResult

Static Private createDecoderResultFromAmbiguousValues

  • createDecoderResultFromAmbiguousValues(ecLevel: int, codewords: Int32Array, erasureArray: Int32Array, ambiguousIndexes: Int32Array, ambiguousIndexValues: Int32Array[]): DecoderResult
  • This method deals with the fact, that the decoding process doesn't always yield a single most likely value. The current error correction implementation doesn't deal with erasures very well, so it's better to provide a value for these ambiguous codewords instead of treating it as an erasure. The problem is that we don't know which of the ambiguous values to choose. We try decode using the first value, and if that fails, we use another of the ambiguous values and try to decode again. This usually only happens on very hard to read and decode barcodes, so decoding the normal barcodes is not affected by this.

    throws

    FormatException

    throws

    ChecksumException

    Parameters

    • ecLevel: int
    • codewords: Int32Array
    • erasureArray: Int32Array

      contains the indexes of erasures

    • ambiguousIndexes: Int32Array

      array with the indexes that have more than one most likely value

    • ambiguousIndexValues: Int32Array[]

      two dimensional array that contains the ambiguous values. The first dimension must be the same length as the ambiguousIndexes array

    Returns DecoderResult

Static decode

  • todo

    don't pass in minCodewordWidth and maxCodewordWidth, pass in barcode columns for start and stop pattern

    columns. That way width can be deducted from the pattern column. This approach also allows to detect more details about the barcode, e.g. if a bar type (white or black) is wider than it should be. This can happen if the scanner used a bad blackpoint.

    throws

    NotFoundException

    throws

    FormatException

    throws

    ChecksumException

    Parameters

    Returns DecoderResult

Static Private decodeCodewords

  • decodeCodewords(codewords: Int32Array, ecLevel: int, erasures: Int32Array): DecoderResult

Static Private detectCodeword

  • detectCodeword(image: BitMatrix, minColumn: int, maxColumn: int, leftToRight: boolean, startColumn: int, imageRow: int, minCodewordWidth: int, maxCodewordWidth: int): Codeword

Static Private getBarcodeMetadata

Static Private getBitCountForCodeword

  • getBitCountForCodeword(codeword: int): Int32Array

Static Private getCodewordBucketNumber

  • getCodewordBucketNumber(codeword: int | Int32Array): int

Static Private getCodewordBucketNumber_Int32Array

  • getCodewordBucketNumber_Int32Array(moduleBitCount: Int32Array): int

Static Private getCodewordBucketNumber_number

  • getCodewordBucketNumber_number(codeword: int): int

Static Private getMax

  • getMax(values: Int32Array): int

Static Private getModuleBitCount

  • getModuleBitCount(image: BitMatrix, minColumn: int, maxColumn: int, leftToRight: boolean, startColumn: int, imageRow: int): Int32Array

Static Private getNumberOfECCodeWords

  • getNumberOfECCodeWords(barcodeECLevel: int): int

Static Private getRowIndicatorColumn

Static Private getStartColumn

  • getStartColumn(detectionResult: DetectionResult, barcodeColumn: int, imageRow: int, leftToRight: boolean): int

Static Private isValidBarcodeColumn

  • isValidBarcodeColumn(detectionResult: DetectionResult, barcodeColumn: int): boolean

Static Private merge

Static toString

Static Private verifyCodewordCount

  • verifyCodewordCount(codewords: Int32Array, numECCodewords: int): void

Generated using TypeDoc