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

zbar_image_scanner_t* zbar_image_scanner_create ( void   ) 

constructor.

Definition at line 449 of file img_scanner.c.

References ZBAR_CFG_POSITION, ZBAR_CFG_X_DENSITY, ZBAR_CFG_Y_DENSITY, zbar_decoder_create(), zbar_decoder_set_handler(), zbar_decoder_set_userdata(), zbar_image_scanner_create(), zbar_image_scanner_destroy(), zbar_image_scanner_set_config(), and zbar_scanner_create().

Referenced by zbar::ImageScanner::ImageScanner(), zbar_image_scanner_create(), and zbar_processor_create().

{
    zbar_image_scanner_t *iscn = calloc(1, sizeof(zbar_image_scanner_t));
    if(!iscn)
        return(NULL);
    iscn->dcode = zbar_decoder_create();
    iscn->scn = zbar_scanner_create(iscn->dcode);
    if(!iscn->dcode || !iscn->scn) {
        zbar_image_scanner_destroy(iscn);
        return(NULL);
    }
    zbar_decoder_set_userdata(iscn->dcode, iscn);
    zbar_decoder_set_handler(iscn->dcode, symbol_handler);

#ifdef ENABLE_QRCODE
    iscn->qr = _zbar_qr_create();
#endif

    /* apply default configuration */
    CFG(iscn, ZBAR_CFG_X_DENSITY) = 1;
    CFG(iscn, ZBAR_CFG_Y_DENSITY) = 1;
    zbar_image_scanner_set_config(iscn, 0, ZBAR_CFG_POSITION, 1);
    return(iscn);
}


Generated by  Doxygen 1.6.0   Back to index