Generate a decscription of a 1D bar code.
::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 barcode. ::gen_1d_bar_code_descr is therefore the first operator in a program sequence for barcode 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 barcodes the operator has to be called once for each type.
You have to be aware that this description contains only basic informations about the barcode. Thus an arbitrary description can be used to extract almost every type of barcode. On the other hand a specific description is important for the decoding of a barcode type.
|
CodeName (input_control) |
string -> HTuple.char * |
| Name of bar code. | |
| Default value: ''EAN 13'' | |
| List of values: ''2/5 industrial'', ''2/5 interleaved'', ''code 39'', ''EAN 13'', ''EAN 8'', 'Codabar' | |
|
MinCharacters (input_control) |
integer -> HTuple.long |
| 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 | |
|
MaxCharacters (input_control) |
integer -> HTuple.long |
| 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 | |
|
BarCodeDescr (output_control) |
string-array -> HTuple.char * / long * / double * |
| 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 H_MSG_TRUE if the transfered barcode name is correct.
::find_1d_bar_code, ::find_1d_bar_code_region
Barcode reader