Operators |
gen_1d_bar_code_descr — Generate a description of a 1D bar code.
gen_1d_bar_code_descr is obsolete and is only provided for reasons of backward compatibility. New applications for reading bar codes should use the functionality in the chapter Identification / Bar Code instead (see create_bar_code_model).
gen_1d_bar_code_descr( : : CodeName, MinCharacters, MaxCharacters : BarCodeDescr)
gen_1d_bar_code_descr generates a description of a one dimensional bar code. This description is used for the search (find_1d_bar_code or find_1d_bar_code_region) and the decoding (decode_1d_bar_code) of the bar code. gen_1d_bar_code_descr is therefore the first operator in a program sequence for bar code processing. gen_1d_bar_code_descr has only to be called once at the beginning of a program. The descriptor can be used multiple times. In the case of different types of bar codes the operator has to be called once for each type.
You have to be aware that this description contains only basic informations about the bar code. Thus an arbitrary description can be used to extract almost every type of bar code. On the other hand a specific description is important for the decoding of a bar code type.
Name of bar code.
Default value: 'EAN 13'
List of values: '2/5 Industrial' , '2/5 Interleaved' , 'Codabar' , 'Code 128' , 'Code 39' , 'Code 93' , 'EAN 13 Add-On 2' , 'EAN 13 Add-On 5' , 'EAN 13' , 'EAN 8 Add-On 2' , 'EAN 8 Add-On 5' , 'EAN 8' , 'PharmaCode' , 'UPC-A Add-On 2' , 'UPC-A Add-On 5' , 'UPC-A' , 'UPC-E Add-On 2' , 'UPC-E Add-On 5' , 'UPC-E'
Minimum number of characters (if not fixed).
Default value: 6
Suggested values: -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 25, 30
Maximum number of characters (if not fixed).
Default value: 10
Suggested values: -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 25, 30, 35, 40, 50
Description of a bar code class.
HTuple empty; // empty list of values HTuple BarCodeDescr; HTuple BarcodeFound,Elements,Orientation; HTuple Characters,Reference,IsCorrect; Hobject Image,CodeRegion; gen_1d_bar_code_descr("EAN 13",13,13,&BarCodeDescr); find_1d_bar_code(Image,&CodeRegion,BarCodeDescr,empty,empty, &BarcodeFound,&Elements,&Orientation); if (BarcodeFound[0].l) { decode_1d_bar_code(Elements,BarCodeDescr, &Characters,&Reference,&IsCorrect); if (IsCorrect[0].l) for (int i=0; i<Characters.Num(); i++) { char *value = Characters[i]; } }
The operator gen_1d_bar_code_descr returns the value 2 (H_MSG_TRUE) if the transfered bar code name is correct.
Bar Code
Operators |