Options
All
  • Public
  • Public/Protected
  • All
Menu

Encapsulates logic that can detect an Aztec Code in an image, even if the Aztec Code is rotated or skewed, or partially obscured.

author

David Olivier

author

Frank Yellin

Hierarchy

  • Detector

Index

Constructors

constructor

Properties

Private EXPECTED_CORNER_BITS

EXPECTED_CORNER_BITS: Int32Array = new Int32Array([0xee0, // 07340 XXX .XX X.. ...0x1dc, // 00734 ... XXX .XX X..0x83b, // 04073 X.. ... XXX .XX0x707, // 03407 .XX X.. ... XXX])

Private compact

compact: boolean

Private image

image: BitMatrix

Private nbCenterLayers

nbCenterLayers: number

Private nbDataBlocks

nbDataBlocks: number

Private nbLayers

nbLayers: number

Private shift

shift: number

Methods

detect

detectMirror

Private distancePoint

Private distanceResultPoint

Private expandSquare

  • Expand the square represented by the corner points by pushing out equally in all directions

    Parameters

    • cornerPoints: ResultPoint[]

      the corners of the square, which has the bull's eye at its center

    • oldSide: number

      the original length of the side of the square in the target bit matrix

    • newSide: number

      the new length of the size of the square in the target bit matrix

    Returns ResultPoint[]

    the corners of the expanded square

Private extractParameters

  • extractParameters(bullsEyeCorners: ResultPoint[]): void
  • Extracts the number of data layers and data blocks from the layer around the bull's eye.

    throws

    NotFoundException in case of too many errors or invalid parameters

    Parameters

    • bullsEyeCorners: ResultPoint[]

      the array of bull's eye corners

    Returns void

Private getBullsEyeCorners

  • Finds the corners of a bull-eye centered on the passed point. This returns the centers of the diagonal points just outside the bull's eye Returns [topRight, bottomRight, bottomLeft, topLeft]

    throws

    NotFoundException If no valid bull-eye can be found

    Parameters

    • pCenter: Point

      Center point

    Returns ResultPoint[]

    The corners of the bull-eye

Private getColor

Private getCorrectedParameterData

  • getCorrectedParameterData(parameterData: number, compact: boolean): number
  • Corrects the parameter bits using Reed-Solomon algorithm.

    throws

    NotFoundException if the array contains too many errors

    Parameters

    • parameterData: number

      parameter bits

    • compact: boolean

      true if this is a compact Aztec code

    Returns number

Private getDimension

  • getDimension(): number

Private getFirstDifferent

  • getFirstDifferent(init: Point, color: boolean, dx: number, dy: number): Point

Private getMatrixCenter

  • getMatrixCenter(): Point

Private getMatrixCornerPoints

Private getRotation

  • getRotation(sides: Int32Array, length: number): number

Private isValid

  • isValid(x: number, y: number): boolean

Private isValidPoint

Private isWhiteOrBlackRectangle

Private sampleGrid

Private sampleLine

Generated using TypeDoc