decodeRow method

  1. @override
Result decodeRow(
  1. int rowNumber,
  2. BitArray row,
  3. Map<DecodeHintType, Object>? hints
)
override

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

@param rowNumber row number from top of the row @param row the black/white pixel data of the row @param hints decode hints @return Result containing encoded string and start/end of barcode @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

Implementation

@override
Result decodeRow(
  int rowNumber,
  BitArray row,
  Map<DecodeHintType, Object>? hints,
) {
  // Rows can start with even pattern in case in prev rows there where odd number of patters.
  // So lets try twice
  _pairs.clear();
  _startFromEven = false;
  try {
    return constructResult(decodeRow2pairs(rowNumber, row));
  } on NotFoundException catch (_) {
    // OK
  }

  _pairs.clear();
  _startFromEven = true;
  return constructResult(decodeRow2pairs(rowNumber, row));
}