47 template <
bool tReportUpcASeparately = true>
61 static bool isLeftGuard(
const uint32_t* segmentData,
const size_t size, uint32_t& moduleSize, uint32_t& minModuleSize, uint32_t& maxModuleSize);
71 static bool isMiddleGuard(
const uint32_t* segmentData,
const size_t size,
const uint32_t& minModuleSize,
const uint32_t& maxModuleSize);
81 static bool isRightGuard(
const uint32_t* segmentData,
const size_t size,
const uint32_t& minModuleSize,
const uint32_t& maxModuleSize);
93 static bool decodeDigits(
const uint32_t* leftDigitsSegmentData,
const uint32_t* rightDigitsSegmentData,
const uint32_t moduleSize,
const uint32_t& minModuleSize,
const uint32_t& maxModuleSize, std::vector<uint8_t>& decodedDigits);
105 template <
bool tUseCodesLAndG>
106 static bool decodeDigit(
const uint32_t* digitSegmentData,
const uint32_t moduleSize,
const uint32_t& minModuleSize,
const uint32_t& maxModuleSize, uint8_t& decodedDigit,
unsigned int& parityBit);
118 static uint32_t
computePatternScore(
const uint32_t* digitSegmentData,
const DigitPattern& digitPattern,
const uint32_t moduleSize,
const uint32_t& minModuleSize,
const uint32_t& maxModuleSize);
Definition of a barcode.
Definition: Barcode.h:52
A parser for EAN-13 and UPC-A barcodes.
Definition: ParserEan13Upca.h:30
static bool isLeftGuard(const uint32_t *segmentData, const size_t size, uint32_t &moduleSize, uint32_t &minModuleSize, uint32_t &maxModuleSize)
Returns if the given segment data is the start of the left guard of a barcode.
static bool verifyCheckDigit(const uint8_t *barcodeDigits, const size_t numberDigits)
Checks the verification digits of a barcode.
static bool parse(const uint32_t *segmentData, const size_t size, Barcode &barcode, IndexPair32 &xCoordinates)
Parses segment data for an EAN-13 or UPC-A barcode.
static bool decodeDigits(const uint32_t *leftDigitsSegmentData, const uint32_t *rightDigitsSegmentData, const uint32_t moduleSize, const uint32_t &minModuleSize, const uint32_t &maxModuleSize, std::vector< uint8_t > &decodedDigits)
Decodes the left and right digits of a barcode given their respective start segments.
static bool isMiddleGuard(const uint32_t *segmentData, const size_t size, const uint32_t &minModuleSize, const uint32_t &maxModuleSize)
Returns if the given segment data is the start of the middle guard of a barcode.
static bool isRightGuard(const uint32_t *segmentData, const size_t size, const uint32_t &minModuleSize, const uint32_t &maxModuleSize)
Returns if the given segment data is the start of the right guard of a barcode.
static uint32_t computePatternScore(const uint32_t *digitSegmentData, const DigitPattern &digitPattern, const uint32_t moduleSize, const uint32_t &minModuleSize, const uint32_t &maxModuleSize)
Computes a score for digit pattern The score indicates how well a certain digit pattern fits with a p...
std::array< uint32_t, 4 > DigitPattern
Definition of a digit pattern, i.e. any digit is encoded by the widths of two light and dark bars.
Definition: ParserEan13Upca.h:34
static bool decodeDigit(const uint32_t *digitSegmentData, const uint32_t moduleSize, const uint32_t &minModuleSize, const uint32_t &maxModuleSize, uint8_t &decodedDigit, unsigned int &parityBit)
Decodes a single digit given its segment data.
std::pair< Index32, Index32 > IndexPair32
Definition of a pair holding 32 bit indices.
Definition: Base.h:138
std::vector< Barcode > Barcodes
Definition of a vector of barcodes.
Definition: Barcode.h:25
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15