KItinerary
barcodedecoder.cpp
52BarcodeDecoder::Result BarcodeDecoder::decode(const QImage &img, BarcodeDecoder::BarcodeTypes hint) const
70std::vector<BarcodeDecoder::Result> BarcodeDecoder::decodeMulti(const QImage &img, BarcodeDecoder::BarcodeTypes hint) const
81QByteArray BarcodeDecoder::decodeBinary(const QImage &img, BarcodeDecoder::BarcodeTypes hint) const
96BarcodeDecoder::BarcodeTypes BarcodeDecoder::isPlausibleSize(int width, int height, BarcodeDecoder::BarcodeTypes hint)
110BarcodeDecoder::BarcodeTypes BarcodeDecoder::isPlausibleAspectRatio(int width, int height, BarcodeDecoder::BarcodeTypes hint)
141BarcodeDecoder::BarcodeTypes BarcodeDecoder::maybeBarcode(int width, int height, BarcodeDecoder::BarcodeTypes hint)
216 return ZXing::ImageView{img.bits(), img.width(), img.height(), zxingImageFormat(img.format()), static_cast<int>(img.bytesPerLine())};
219static void applyZXingResult(BarcodeDecoder::Result &result, const ZXing::Result &zxingResult, BarcodeDecoder::BarcodeTypes format)
229 if (std::any_of(zxUtf8Text.begin(), zxUtf8Text.end(), [](unsigned char c) { return c > 0x7F; })) {
248 if (std::any_of(zxingResult.text().begin(), zxingResult.text().end(), [](const auto c) { return c > 255; })) {
251 if (std::any_of(zxingResult.text().begin(), zxingResult.text().end(), [](const auto c) { return c < 0x20; })) {
271void BarcodeDecoder::decodeIfNeeded(const QImage &img, BarcodeDecoder::BarcodeTypes hint, BarcodeDecoder::Result &result) const
289 res = ZXing::ReadBarcode(zxingImageView(img.convertToFormat(QImage::Format_Grayscale8)), hints);
297void BarcodeDecoder::decodeMultiIfNeeded(const QImage &img, BarcodeDecoder::BarcodeTypes hint, std::vector<BarcodeDecoder::Result> &results) const
300 if (std::any_of(results.begin(), results.end(), [hint](const auto &r) { return (r.positive & hint) || ((r.negative & hint) == hint); })) {
312 zxingResults = ZXing::ReadBarcodes(zxingImageView(img.convertToFormat(QImage::Format_Grayscale8)), hints);
322 // ### in theory we need to handle the case that we already have results from a previous run with different hints here...
static BarcodeTypes isPlausibleSize(int width, int height, BarcodeTypes hint)
Checks if the given image dimensions are plausible for a barcode.
Definition barcodedecoder.cpp:96
QByteArray decodeBinary(const QImage &img, BarcodeTypes hint) const
Decodes a binary payload barcode in img of type hint.
Definition barcodedecoder.cpp:81
static BarcodeTypes maybeBarcode(int width, int height, BarcodeTypes hint)
The combination of the above.
Definition barcodedecoder.cpp:141
Result decode(const QImage &img, BarcodeTypes hint) const
Decodes a barcode in img based on hint.
Definition barcodedecoder.cpp:52
static BarcodeTypes isPlausibleAspectRatio(int width, int height, BarcodeTypes hint)
Checks if the given image dimensions are a barcode of type hint.
Definition barcodedecoder.cpp:110
QString decodeString(const QImage &img, BarcodeTypes hint) const
Decodes a textual payload barcode in img of type hint.
Definition barcodedecoder.cpp:86
std::vector< Result > decodeMulti(const QImage &img, BarcodeTypes hint) const
Decodes multiple barcodes in img based on hint.
Definition barcodedecoder.cpp:70
QAction * hint(const QObject *recvr, const char *slot, QObject *parent)
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
iterator begin()
void resize(qsizetype newSize, char c)
Format
uchar * bits()
qsizetype bytesPerLine() const const
qint64 cacheKey() const const
QImage convertToFormat(Format format, Qt::ImageConversionFlags flags) &&
Format format() const const
int height() const const
bool isNull() const const
int width() const const
QString fromStdString(const std::string &str)
QString fromStdWString(const std::wstring &str)
QByteArray toByteArray() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:00:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:00:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.