C# Class ZXing.OneD.ITFReader

Implements decoding of the ITF format, or Interleaved Two of Five.

This Reader will scan ITF barcodes of certain lengths only. At the moment it reads length 6, 8, 10, 12, 14, 16, 18, 20, 24, 44 and 48 as these have appeared "in the wild". Not all lengths are scanned, especially shorter ones, to avoid false positives. This in turn is due to a lack of required checksum function.

The checksum is optional and is not applied by this Reader. The consumer of the decoded value will have to apply a checksum if required.

http://en.wikipedia.org/wiki/Interleaved_2_of_5 is a great reference for Interleaved 2 of 5 information.

[email protected], SITA Lab.
Inheritance: ZXing.OneD.OneDReader
Exibir arquivo Open project: Redth/ZXing.Net.Mobile

Public Methods

Method Description
decodeRow ( int rowNumber, BitArray row, object>.IDictionary hints ) : System.Result

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

Private Methods

Method Description
decodeDigit ( int counters, int &bestMatch ) : bool

Attempts to decode a sequence of ITF black/white lines into single digit.

decodeEnd ( BitArray row ) : int[]

Identify where the end of the middle / payload section ends.

decodeMiddle ( BitArray row, int payloadStart, int payloadEnd, StringBuilder resultString ) : bool

decodeStart ( BitArray row ) : int[]

Identify where the start of the middle / payload section starts.

findGuardPattern ( BitArray row, int rowOffset, int pattern ) : int[]

skipWhiteSpace ( BitArray row ) : int

Skip all whitespace until we get to the first black line.

validateQuietZone ( BitArray row, int startPattern ) : bool

The start & end patterns must be pre/post fixed by a quiet zone. This zone must be at least 10 times the width of a narrow line. Scan back until we either get to the start of the barcode or match the necessary number of quiet zone pixels. Note: Its assumed the row is reversed when using this method to find quiet zone after the end pattern. ref: http://www.barcode-1.net/i25code.html

Method Details

decodeRow() public method

Attempts to decode a one-dimensional barcode format given a single row of an image.
public decodeRow ( int rowNumber, BitArray row, object>.IDictionary hints ) : System.Result
rowNumber int row number from top of the row
row ZXing.Common.BitArray the black/white pixel data of the row
hints object>.IDictionary decode hints
return System.Result