5#include "../shims/stdoptional.hpp"
7#include "../../global.hpp"
8#include "../../image.hpp"
9#include "../../rect.hpp"
11#include "../../_cexports/c_barcode.h"
12#include "decl_config.hpp"
13#include "../result.hpp"
21 inline HandleGuard<Barcode::Decoder>::HandleGuard(
void *handle) noexcept
22 : HandleGuard<Barcode::Decoder>(handle, [](
void *handle) { CVB_CALL_CAPI(ReleaseObject(handle)); })
75 friend class ConfigBase;
82 enum class ResultProperties
84 Corners = CExports::CVBCResultProperties::CVBCRP_Corners,
85 Center = CExports::CVBCResultProperties::CVBCRP_Center,
86 SymbolType = CExports::CVBCResultProperties::CVBCRP_SymbolType,
87 SymbolTypeEx = CExports::CVBCResultProperties::CVBCRP_SymbolTypeEx,
88 Length = CExports::CVBCResultProperties::CVBCRP_Length,
89 String = CExports::CVBCResultProperties::CVBCRP_String,
90 Quality = CExports::CVBCResultProperties::CVBCRP_Quality,
91 Status = CExports::CVBCResultProperties::CVBCRP_Status,
94 ECCError = CExports::CVBCResultProperties2D::CVBCRP2D_ECCError,
95 ECCErasure = CExports::CVBCResultProperties2D::CVBCRP2D_ECCErasure,
96 SymbolHeightWidth = CExports::CVBCResultProperties2D::CVBCRP2D_SymbolHeightWidth,
97 SymbolRowsColumns = CExports::CVBCResultProperties2D::CVBCRP2D_SymbolRowsColumns
146 template <Symbology SYM>
147 typename Config::Mapper<SYM>::Type &
Config()
149 return std::get<typename Config::Mapper<SYM>::Type>(config_);
169 : handle_(std::move(other.handle_))
170 , config_(std::move(other.config_))
174 int GetIntProperty(ResultProperties property,
int index);
175 String GetPropertyString(ResultProperties property,
int index);
185 float ConvertSizeToPixelCount(
int value);
187 Result GetResult(
int index);
191 Decoder(
const Decoder &other) =
delete;
192 Decoder &operator=(
const Decoder &other) =
delete;
193 explicit Decoder(HandleGuard<Decoder> &&guard, PrivateTag) noexcept
194 : handle_(std::move(guard))
195 , config_(std::make_tuple(
196 Config::DataMatrix(*
this),
198 Config::MicroQR(*
this),
199 Config::Pdf417(*
this),
200 Config::MicroPdf417(*
this),
201 Config::GS1DataBar14(*
this),
202 Config::GS1DataBarStacked(*
this),
203 Config::GS1DataBarLimited(*
this),
204 Config::GS1DataBarExpanded(*
this),
205 Config::GS1DataBarExpandedStacked(*
this),
207 Config::Ean13(*
this),
210 Config::Code128(*
this),
211 Config::Code39(*
this),
212 Config::Code93(*
this),
213 Config::Interleaved2of5(*
this),
214 Config::UspsIntelligentMail(*
this),
215 Config::DutchPost(*
this),
216 Config::AustraliaPost(*
this),
217 Config::RoyalMail(*
this),
218 Config::Pharmacode(*
this),
219 Config::Code32(*
this),
220 Config::Code11(*
this)))
223 virtual ~Decoder() =
default;
227 void *Handle() const noexcept
229 return handle_.Handle();
233 HandleGuard<Decoder> handle_;
240 Config::GS1DataBar14,
241 Config::GS1DataBarStacked,
242 Config::GS1DataBarLimited,
243 Config::GS1DataBarExpanded,
244 Config::GS1DataBarExpandedStacked,
252 Config::Interleaved2of5,
253 Config::UspsIntelligentMail,
255 Config::AustraliaPost,
Class for barcode decoding.
Definition: decl_decoder.hpp:73
void SetEnableBasicInkjetDPM(bool value)
Enables or disables the reading of Basic Inkjet DPM (Direct Part Marking) codes.
Definition: detail_decoder.hpp:28
bool EnabledBasicInkjetDPM() const
Checks whether the Basic Inkjet DPM mode is enabled.
Definition: detail_decoder.hpp:34
Config::Mapper< SYM >::Type & Config()
Retrieves the configuration object for a specific barcode symbology.
Definition: decl_decoder.hpp:147
static std::unique_ptr< Decoder > Create()
Creates and returns a new Decoder instance.
Definition: detail_decoder.hpp:22
std::vector< Result > Execute(const ImagePlane &plane, Rect< int > aoi)
Performs the barcode decoding.
Definition: detail_decoder.hpp:41
CompositeType
Enum class representing the type of composite barcode.
Definition: result.hpp:56
Image plane information container.
Definition: decl_image_plane.hpp:33
This class is a replacement for C++17 std::optional.
Definition: optional.hpp:60
Symbology
Enum class listing all supported barcode symbologies.
Definition: decl_config_base.hpp:36
Root namespace for the Image Manager interface.
Definition: c_barcode.h:15