本文整理汇总了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;
}