本文整理汇总了C++中SymbolSet::get_size方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolSet::get_size方法的具体用法?C++ SymbolSet::get_size怎么用?C++ SymbolSet::get_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolSet
的用法示例。
在下文中一共展示了SymbolSet::get_size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decode
QString ZBarReaderTest::decode(const QImage &image)
{
Image zbarImg(image.width(), image.height(), "Y800", image.bits(), image.bytesPerLine() * image.height());
QString line;
ImageScanner scanner;
scanner.set_config(ZBAR_NONE, ZBAR_CFG_ENABLE, 1);
scanner.scan(zbarImg);
SymbolSet s = scanner.get_results();
int resSize = s.get_size();
if (resSize > 0) {
mTotalRead++;
for (SymbolIterator symbol = scanner.get_results().symbol_begin(); symbol != scanner.get_results().symbol_end(); ++symbol) {
if (QString::compare("QR-Code ", QString(symbol->get_type_name().data()).trimmed()))
line += " | " + QString(symbol->get_data().data()).replace("\n", "<br>");
}
}
return line;
}
示例2: decodeIterative
QString ZBarReaderTest::decodeIterative(const QImage &image)
{
Image zbarImg(image.width(), image.height(), "Y800", image.bits(), image.bytesPerLine() * image.height());
QString line;
ImageScanner scanner;
scanner.set_config(ZBAR_NONE, ZBAR_CFG_ENABLE, 1);
scanner.scan(zbarImg);
SymbolSet s = scanner.get_results();
int resSize = s.get_size();
if (resSize == 0) {
int fib1 = 1, fib2 = 1;
int fib;
for (fib = fib1 + fib2; fib < 11; fib = fib1 + fib2) {
int roiWidth = (1. / fib) * image.width(), roiHeight = (1. / fib) * image.height();
for (int x = 0; x < image.width(); x += 50) {
for (int y = 0; y < image.height(); y += 50) {
// qDebug () << "roiWidth" << roiWidth << "roiHeight" << roiHeight;
QImage img = image.copy(x, y, roiWidth, roiHeight);
Image i(img.width(), img.height(), "Y800", img.bits(), img.bytesPerLine() * img.height());
scanner.scan(i);
}
}
int temp = fib1;
fib1 = fib;
fib2 = temp;
}
}
SymbolSet s2 = scanner.get_results();
resSize = s2.get_size();
if (resSize > 0) {
mTotalRead++;
for (SymbolIterator symbol = scanner.get_results().symbol_begin(); symbol != scanner.get_results().symbol_end(); ++symbol) {
if (QString::compare("QR-Code ", QString(symbol->get_type_name().data()).trimmed()))
line += " | " + QString(symbol->get_data().data()).replace("\n", "<br>");
}
}
return line;
}