|
| static l_int32 | barcodeFindFormat (char *barstr) |
| |
| static l_int32 | barcodeVerifyFormat (char *barstr, l_int32 format, l_int32 *pvalid, l_int32 *preverse) |
| |
| static char * | barcodeDecode2of5 (char *barstr, l_int32 debugflag) |
| |
| static char * | barcodeDecodeI2of5 (char *barstr, l_int32 debugflag) |
| |
| static char * | barcodeDecode93 (char *barstr, l_int32 debugflag) |
| |
| static char * | barcodeDecode39 (char *barstr, l_int32 debugflag) |
| |
| static char * | barcodeDecodeCodabar (char *barstr, l_int32 debugflag) |
| |
| static char * | barcodeDecodeUpca (char *barstr, l_int32 debugflag) |
| |
| static char * | barcodeDecodeEan13 (char *barstr, l_int32 first, l_int32 debugflag) |
| |
| char * | barcodeDispatchDecoder (char *barstr, l_int32 format, l_int32 debugflag) |
| |
| l_int32 | barcodeFormatIsSupported (l_int32 format) |
| |
Dispatcher
char *barcodeDispatchDecoder()
Format Determination
static l_int32 barcodeFindFormat()
l_int32 barcodeFormatIsSupported()
static l_int32 barcodeVerifyFormat()
Decode 2 of 5
static char *barcodeDecode2of5()
Decode Interleaved 2 of 5
static char *barcodeDecodeI2of5()
Decode Code 93
static char *barcodeDecode93()
Decode Code 39
static char *barcodeDecode39()
Decode Codabar
static char *barcodeDecodeCodabar()
Decode UPC-A
static char *barcodeDecodeUpca()
Decode EAN 13
static char *barcodeDecodeEan13()
Definition in file bardecode.c.
| static char * barcodeDecode2of5 |
( |
char * | barstr, |
|
|
l_int32 | debugflag ) |
|
static |
barcodeDecode2of5()
- Parameters
-
| [in] | barstr | of widths, in set {1, 2} |
| [in] | debugflag | |
- Returns
- data string of digits, or NULL if none found or on error
Notes:
(1) Ref: http://en.wikipedia.org/wiki/Two-out-of-five_code (Note:
the codes given here are wrong!)
http://morovia.com/education/symbology/code25.asp
(2) This is a very low density encoding for the 10 digits.
Each digit is encoded with 5 black bars, of which 2 are wide
and 3 are narrow. No information is carried in the spaces
between the bars, which are all equal in width, represented by
a "1" in our encoding.
(3) The mapping from the sequence of five bar widths to the
digit is identical to the mapping used by the interleaved
2 of 5 code. The start code is 21211, representing two
wide bars and a narrow bar, and the interleaved "1" spaces
are explicit. The stop code is 21112. For all codes
(including start and stop), the trailing space "1" is
implicit -- there is no reason to represent it in the
Code2of5[] array.
Definition at line 372 of file bardecode.c.
References barcodeVerifyFormat().
Referenced by barcodeDispatchDecoder().
| static char * barcodeDecodeEan13 |
( |
char * | barstr, |
|
|
l_int32 | first, |
|
|
l_int32 | debugflag ) |
|
static |
barcodeDecodeEan13()
- Parameters
-
| [in] | barstr | of widths, in set {1, 2, 3, 4} |
| [in] | first | first digit: 0 - 9 |
| [in] | debugflag | |
- Returns
- data string of digits, or NULL if none found or on error
Notes:
(1) Ref: http://en.wikipedia.org/wiki/UniversalProductCode
http://morovia.com/education/symbology/ean-13.asp
(2) The encoding is essentially the same as UPC-A, except
there are 13 digits in total, of which 12 are encoded
by bars (as with UPC-A) and the 13th is a leading digit
that determines the encoding of the next 6 digits,
selecting each digit from one of two tables.
encoded in the bars (as with UPC-A). If the first digit
is 0, the encoding is identical to UPC-A.
(3) As with UPC-A, the last digit is a check digit.
(4) For now, we assume the first digit is input to this function.
Eventually, we will read it by pattern matching.
TODO: fix this for multiple tables, depending on the value of first
Definition at line 942 of file bardecode.c.
References barcodeVerifyFormat().
Referenced by barcodeDispatchDecoder().
| static char * barcodeDecodeUpca |
( |
char * | barstr, |
|
|
l_int32 | debugflag ) |
|
static |
| static l_int32 barcodeVerifyFormat |
( |
char * | barstr, |
|
|
l_int32 | format, |
|
|
l_int32 * | pvalid, |
|
|
l_int32 * | preverse ) |
|
static |
barcodeVerifyFormat()
- Parameters
-
| [in] | barstr | of barcode widths, in set {1,2,3,4} |
| [in] | format | L_BF_CODEI2OF5, L_BF_CODE93, ... |
| [out] | pvalid | 0 if not valid, 1 and 2 if valid |
| [out] | preverse | [optional] 1 if reversed; 0 otherwise |
- Returns
- 0 if OK, 1 on error
Notes:
(1) If valid == 1, the barcode is of the given format in the
forward order; if valid == 2, it is backwards.
(2) If the barcode needs to be reversed to read it, and &reverse
is provided, a 1 is put into reverse.
(3) Require at least 12 data bits, in addition to format identifiers.
(TODO) If the barcode has a fixed length, this should be used
explicitly, as is done for L_BF_UPCA and L_BF_EAN13.
(4) (TODO) Add to this as more formats are supported.
Definition at line 204 of file bardecode.c.
Referenced by barcodeDecode2of5(), barcodeDecode39(), barcodeDecode93(), barcodeDecodeCodabar(), barcodeDecodeEan13(), barcodeDecodeI2of5(), barcodeDecodeUpca(), and barcodeFindFormat().