Prison

imagescanner.h
1/*
2 SPDX-FileCopyrightText: 2024 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: MIT
4*/
5
6#ifndef PRISON_IMAGESCANNER_H
7#define PRISON_IMAGESCANNER_H
8
9#include "format.h"
10#include "prisonscanner_export.h"
11
12class QImage;
13
14namespace Prison
15{
16
17class ScanResult;
18
19/** Scans a still image for barcodes.
20 *
21 * @since 6.3
22 */
23namespace ImageScanner
24{
25
26/** Scan @p image for a barcode.
27 * This method is synchronous and expensive.
28 * For use in the main thread running this on a secondary thread is strongly recommended
29 * when processing larger images.
30 *
31 * @code
32 * QtConcurrent::run([&img]() { return ImageScanner::scan(img); }).then([](const ScanResult &result) {
33 * ...
34 * });
35 * @endcode
36 *
37 * @param image The image to scan for barcodes, in any format.
38 * @param formats The barcode formats to look for. By default all supported formats
39 * are searched, limiting this improves performance and can improve result quality.
40 *
41 * @since 6.3
42 */
43[[nodiscard]] PRISONSCANNER_EXPORT ScanResult scan(const QImage &image, Format::BarcodeFormats formats = {});
44
45}
46}
47
48#endif // PRISON_IMAGESCANNER_H
Result of a barcode scan attempt.
Definition scanresult.h:31
PRISONSCANNER_EXPORT ScanResult scan(const QImage &image, Format::BarcodeFormats formats={})
Scan image for a barcode.
Provides classes and methods for generating barcodes.
Definition barcode.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:03:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.