简体   繁体   中英

Disable a decoder type in ZBar's C++ API

I have a barcode which is incorrectly recognized as EAN, when it is in fact Code 39. I know the type of barcode beforehand, so I want to tell ZBar to look only for Code 39 barcodes.

I found a related question - Wrong decoding of barcodes also in ZBAR SDK example , but the function it mentions is setSymbology() , and it is absent from the C++ API. Maybe it's only in the iPhone SDK?

Is there an equivalent function for the C++ API?

I'm not sure if it's an exact equivalent to setSymbology() but I used ImageScanner::set_config() to do the job.

scanner.set_config(ZBAR_EAN8, ZBAR_CFG_ENABLE, 0);
scanner.set_config(ZBAR_EAN13, ZBAR_CFG_ENABLE, 0);

Using this code I could disable all the EAN decoders.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM