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

zbar_symbol_type_t zbar_scanner_flush ( zbar_scanner_t scanner  )  [inline]

flush scanner processing pipeline. forces current scanner position to be a scan boundary. call multiple times (max 3) to completely flush decoder.

Returns:
any decode/scan results flushed from the pipeline
Note:
when not using callback handlers, the return value should be checked the same as zbar_scan_y()
Since:
0.9

Definition at line 175 of file scanner.c.

References zbar_decode_width(), ZBAR_NONE, ZBAR_PARTIAL, and zbar_scanner_flush().

Referenced by zbar::Scanner::flush(), zbar_scanner_flush(), and zbar_scanner_new_scan().

{
    if(!scn->y1_sign)
        return(ZBAR_NONE);

    unsigned x = (scn->x << ZBAR_FIXED) + ROUND;

    if(scn->cur_edge != x || scn->y1_sign > 0) {
        dprintf(1, "flush0:");
        zbar_symbol_type_t edge = process_edge(scn, -scn->y1_sign);
        scn->cur_edge = x;
        scn->y1_sign = -scn->y1_sign;
        return(edge);
    }

    scn->y1_sign = scn->width = 0;
    if(scn->decoder)
        return(zbar_decode_width(scn->decoder, 0));
    return(ZBAR_PARTIAL);
}


Generated by  Doxygen 1.6.0   Back to index