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

int zbar_process_image ( zbar_processor_t processor,
zbar_image_t image 
)

process the provided image for barcodes. if the library window is visible, the image will be displayed.

Returns:
>0 if symbols were successfully decoded, 0 if no symbols were found or -1 if an error occurs

Definition at line 661 of file processor.c.

References zbar_image_get_height(), zbar_image_get_width(), zbar_image_scanner_enable_cache(), and zbar_process_image().

Referenced by zbar::Processor::process_image(), and zbar_process_image().

{
    proc_enter(proc);
    _zbar_mutex_unlock(&proc->mutex);

    int rc = 0;
    if(img && proc->window)
        rc = _zbar_processor_set_size(proc,
                                      zbar_image_get_width(img),
                                      zbar_image_get_height(img));
    if(!rc) {
        zbar_image_scanner_enable_cache(proc->scanner, 0);
        rc = _zbar_process_image(proc, img);
        if(proc->streaming)
            zbar_image_scanner_enable_cache(proc->scanner, 1);
    }

    _zbar_mutex_lock(&proc->mutex);
    proc_leave(proc);
    return(rc);
}


Generated by  Doxygen 1.6.0   Back to index