当前位置: 首页>>代码示例>>C++>>正文


C++ Scanner::scan_y方法代码示例

本文整理汇总了C++中Scanner::scan_y方法的典型用法代码示例。如果您正苦于以下问题:C++ Scanner::scan_y方法的具体用法?C++ Scanner::scan_y怎么用?C++ Scanner::scan_y使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Scanner的用法示例。


在下文中一共展示了Scanner::scan_y方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: scan_image


//.........这里部分代码省略.........
            if(max < y.y())
                max = y.y();
            raw[i] = (unsigned)(y.y() * 0x100);
            svg << ((i != 1) ? " " : " L ") << i << "," << raw[i];
            y.u(0);
            y.v(0);
            *pxp = y;
        }
        y.y(max); /* flush scan FIXME? */
        for(; i < inwidth + flush1; i++) {
            raw[i] = (unsigned)(y.y() * 0x100);
            svg << " " << i << "," << raw[i];
            *pxp++ = y;
        }
        y.y(0);
        for(; i < width; i++) {
            raw[i] = (unsigned)(y.y() * 0x100);
            svg << " " << i << "," << raw[i];
            *pxp++ = y;
        }
        view.sync();
        svg << "'/>" << endl
            << "</g>" << endl;
    }
    image.depth(8);
    image.write(file + ".png");

    // process scan and capture calculated values
    unsigned cur_edge[width], last_edge[width];
    int y0[width], y1[width], y2[width], y1_thr[width];

    svg << "<g transform='translate(-3)'>" << endl;
    for(unsigned i = 0; i < width; i++) {
        int edge = scanner.scan_y(raw[i]);
        unsigned x;
        zbar_scanner_get_state(scanner.get_c_scanner(), &x,
                                &cur_edge[i], &last_edge[i],
                                &y0[i], &y1[i], &y2[i], &y1_thr[i]);
#ifdef DEBUG_SCANNER
        cerr << endl;
#endif
        cur_edge[i] += i - x;
        if(edge) {
            last_edge[i] += i - x;
            unsigned w = scanner.get_width();
            svg << "<rect x='" << (2. * (last_edge[i] - w) / ZBAR_FRAC)
                << "' width='" << (w * 2. / ZBAR_FRAC)
                << "' height='32' class='"
                << (scanner.get_color() ? "space" : "bar") << "'/>" << endl
                << "<text transform='translate("
                << ((2. * last_edge[i] - w) / ZBAR_FRAC) - 3
                << ",16) rotate(90)' class='"
                << (scanner.get_color() ? "space" : "bar") << "'>" << endl
                << w << "</text>" << endl;
            zbar_symbol_type_t sym = decoder.decode_width(w);
            if(sym > ZBAR_PARTIAL) {
                svg << "<text transform='translate("
                    << (2. * (last_edge[i] + w) / ZBAR_FRAC)
                    << ",208) rotate(90)' class='data'>"
                    << decoder.get_data_string() << "</text>" << endl;
            }
        }
        else
            last_edge[i] = 0;
    }
开发者ID:krunalsoni01,项目名称:yocto-zbar,代码行数:66,代码来源:dbg_scan.cpp


注:本文中的Scanner::scan_y方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。