Class CodaBarReader

  • All Implemented Interfaces:
    Reader

    public final class CodaBarReader
    extends OneDReader

    Decodes Codabar barcodes.

    • Field Detail

      • ALPHABET

        static final char[] ALPHABET
      • CHARACTER_ENCODINGS

        static final int[] CHARACTER_ENCODINGS
        These represent the encodings of characters, as patterns of wide and narrow bars. The 7 least-significant bits of each int correspond to the pattern of wide and narrow, with 1s representing "wide" and 0s representing narrow.
      • STARTEND_ENCODING

        private static final char[] STARTEND_ENCODING
      • decodeRowResult

        private final java.lang.StringBuilder decodeRowResult
      • counters

        private int[] counters
      • counterLength

        private int counterLength
    • Constructor Detail

      • CodaBarReader

        public CodaBarReader()
    • Method Detail

      • decodeRow

        public Result decodeRow​(int rowNumber,
                                BitArray row,
                                java.util.Map<DecodeHintType,​?> hints)
                         throws NotFoundException
        Description copied from class: OneDReader

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

        Specified by:
        decodeRow in class OneDReader
        Parameters:
        rowNumber - row number from top of the row
        row - the black/white pixel data of the row
        hints - decode hints
        Returns:
        Result containing encoded string and start/end of barcode
        Throws:
        NotFoundException - if no potential barcode is found
      • setCounters

        private void setCounters​(BitArray row)
                          throws NotFoundException
        Records the size of all runs of white and black pixels, starting with white. This is just like recordPattern, except it records all the counters, and uses our builtin "counters" member for storage.
        Parameters:
        row - row to count from
        Throws:
        NotFoundException
      • counterAppend

        private void counterAppend​(int e)
      • arrayContains

        static boolean arrayContains​(char[] array,
                                     char key)
      • toNarrowWidePattern

        private int toNarrowWidePattern​(int position)