Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractRSSReader

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private Readonly dataCharacterCounters

dataCharacterCounters: Int32Array

Private Readonly decodeFinderCounters

decodeFinderCounters: Int32Array

Private Readonly evenCounts

evenCounts: number[]

Private Readonly evenRoundingErrors

evenRoundingErrors: number[]

Private Readonly oddCounts

oddCounts: number[]

Private Readonly oddRoundingErrors

oddRoundingErrors: number[]

Static Private Readonly MAX_AVG_VARIANCE

MAX_AVG_VARIANCE: number = 0.2

Static Private Readonly MAX_FINDER_PATTERN_RATIO

MAX_FINDER_PATTERN_RATIO: number = 12.5 / 14.0

Static Private Readonly MAX_INDIVIDUAL_VARIANCE

MAX_INDIVIDUAL_VARIANCE: number = 0.45

Static Private Readonly MIN_FINDER_PATTERN_RATIO

MIN_FINDER_PATTERN_RATIO: number = 9.5 / 12.0

Methods

decode

Abstract decodeRow

  • Attempts to decode a one-dimensional barcode format given a single row of an image.

    throws

    NotFoundException if no potential barcode is found

    throws

    ChecksumException if a potential barcode is found but does not pass its checksum

    throws

    FormatException if a potential barcode is found but format is invalid

    Parameters

    • rowNumber: number

      row number from top of the row

    • row: BitArray

      the black/white pixel data of the row

    • Optional hints: Map<DecodeHintType, any>

      decode hints

    Returns Result

    Result containing encoded string and start/end of barcode

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

reset

  • reset(): void

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