Logo Search packages:      
Sourcecode: zbar version File versions  Download package

int zbar_image_scanner_set_config ( zbar_image_scanner_t scanner,
zbar_symbol_type_t  symbology,
zbar_config_t  config,
int  value 
)

set config for indicated symbology (0 for all) to specified value.

Returns:
0 for success, non-0 for failure (config does not apply to specified symbology, or value out of range)
See also:
zbar_decoder_set_config()
Since:
0.4

Definition at line 534 of file img_scanner.c.

References ZBAR_CFG_POSITION, ZBAR_CFG_X_DENSITY, ZBAR_CFG_Y_DENSITY, zbar_decoder_set_config(), zbar_image_scanner_set_config(), and ZBAR_PARTIAL.

Referenced by zbar::ImageScanner::set_config(), zbar_image_scanner_create(), zbar_image_scanner_parse_config(), zbar_image_scanner_set_config(), and zbar_processor_set_config().

{
    if(cfg < ZBAR_CFG_POSITION)
        return(zbar_decoder_set_config(iscn->dcode, sym, cfg, val));

    if(sym > ZBAR_PARTIAL)
        return(1);

    if(cfg >= ZBAR_CFG_X_DENSITY && cfg <= ZBAR_CFG_Y_DENSITY) {

        CFG(iscn, cfg) = val;
        return(0);
    }

    if(cfg > ZBAR_CFG_POSITION)
        return(1);
    cfg -= ZBAR_CFG_POSITION;

    if(!val)
        iscn->config &= ~(1 << cfg);
    else if(val == 1)
        iscn->config |= (1 << cfg);
    else
        return(1);

    return(0);
}


Generated by  Doxygen 1.6.0   Back to index