Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RSS14Reader

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private Readonly possibleLeftPairs

possibleLeftPairs: Pair[] = []

Private Readonly possibleRightPairs

possibleRightPairs: Pair[] = []

Static Private Readonly FINDER_PATTERNS

FINDER_PATTERNS: Int32Array[] = [Int32Array.from([3, 8, 2, 1]),Int32Array.from([3, 5, 5, 1]),Int32Array.from([3, 3, 7, 1]),Int32Array.from([3, 1, 9, 1]),Int32Array.from([2, 7, 4, 1]),Int32Array.from([2, 5, 6, 1]),Int32Array.from([2, 3, 8, 1]),Int32Array.from([1, 5, 7, 1]),Int32Array.from([1, 3, 9, 1]),]

Static Private Readonly INSIDE_GSUM

INSIDE_GSUM: number[] = [0, 336, 1036, 1516]

Static Private Readonly INSIDE_ODD_TOTAL_SUBSET

INSIDE_ODD_TOTAL_SUBSET: number[] = [4, 20, 48, 81]

Static Private Readonly INSIDE_ODD_WIDEST

INSIDE_ODD_WIDEST: number[] = [2, 4, 6, 8]

Static Private Readonly OUTSIDE_EVEN_TOTAL_SUBSET

OUTSIDE_EVEN_TOTAL_SUBSET: number[] = [1, 10, 34, 70, 126]

Static Private Readonly OUTSIDE_GSUM

OUTSIDE_GSUM: number[] = [0, 161, 961, 2015, 2715]

Static Private Readonly OUTSIDE_ODD_WIDEST

OUTSIDE_ODD_WIDEST: number[] = [8, 6, 4, 3, 1]

Methods

Private adjustOddEvenCounts

  • adjustOddEvenCounts(outsideChar: boolean, numModules: number): void

decode

Private decodeDataCharacter

Private decodePair

decodeRow

Private findFinderPattern

  • findFinderPattern(row: BitArray, rightFinderPattern: boolean): number[]

Protected getDataCharacterCounters

  • getDataCharacterCounters(): Int32Array

Protected getDecodeFinderCounters

  • getDecodeFinderCounters(): Int32Array

Protected getEvenCounts

  • getEvenCounts(): number[]

Protected getEvenRoundingErrors

  • getEvenRoundingErrors(): number[]

Protected getOddCounts

  • getOddCounts(): number[]

Protected getOddRoundingErrors

  • getOddRoundingErrors(): number[]

Protected parseFinderValue

  • parseFinderValue(counters: Int32Array, finderPatterns: Int32Array[]): number

Private parseFoundFinderPattern

  • parseFoundFinderPattern(row: BitArray, rowNumber: number, right: boolean, startEnd: number[]): FinderPattern

reset

  • reset(): void

Static Private addOrTally

  • addOrTally(possiblePairs: Pair[], pair: Pair): void

Static Private checkChecksum

  • checkChecksum(leftPair: Pair, rightPair: Pair): boolean

Static Private constructResult

Static Protected count

  • count(array: number[]): number

Static Protected decrement

  • decrement(array: number[], errors: number[]): void

Static Protected increment

  • increment(array: number[], errors: number[]): void

Static Protected isFinderPattern

  • isFinderPattern(counters: Int32Array): boolean

Static Protected patternMatchVariance

  • patternMatchVariance(counters: Int32Array, pattern: Int32Array, maxIndividualVariance: number): number
  • Determines how closely a set of observed counts of runs of black/white values matches a given target pattern. This is reported as the ratio of the total variance from the expected pattern proportions across all pattern elements, to the length of the pattern.

    Parameters

    • counters: Int32Array

      observed counters

    • pattern: Int32Array

      expected pattern

    • maxIndividualVariance: number

      The most any counter can differ before we give up

    Returns number

    ratio of total variance between counters and pattern compared to total pattern size

Static Protected recordPattern

  • recordPattern(row: BitArray, start: number, counters: Int32Array): void
  • Records the size of successive runs of white and black pixels in a row, starting at a given point. The values are recorded in the given array, and the number of runs recorded is equal to the size of the array. If the row starts on a white pixel at the given start point, then the first count recorded is the run of white pixels starting from that point; likewise it is the count of a run of black pixels if the row begin on a black pixels at that point.

    throws

    NotFoundException if counters cannot be filled entirely from row before running out of pixels

    Parameters

    • row: BitArray

      row to count from

    • start: number

      offset into row to start at

    • counters: Int32Array

      array into which to record counts

    Returns void

Static Protected recordPatternInReverse

  • recordPatternInReverse(row: BitArray, start: number, counters: Int32Array): void

Generated using TypeDoc