3#include "../result.hpp"
4#include "../_decl/decl_decoder.hpp"
5#include "../_decl/decl_result_handle.hpp"
13 inline std::unique_ptr<Decoder> Decoder::FromHandle(HandleGuard<Decoder> &&guard)
16 throw std::runtime_error(
"decoder handle must not be null");
18 return std::make_unique<Decoder>(std::move(guard), PrivateTag{});
23 return Internal::DoResCallObjectOut<Decoder>(
24 [&](
void *&handle) {
return CVB_CALL_CAPI(CVCRCreateDecoder(handle)); });
29 CVB_CALL_CAPI_CHECKED(
30 CVCRSetPropertyInt(Handle(),
static_cast<int>(Properties::BasicInkjet),
static_cast<int>(value)));
36 CVB_CALL_CAPI_CHECKED(CVCRGetPropertyInt(Handle(),
static_cast<int>(Properties::BasicInkjet), value));
37 return static_cast<bool>(value);
42 CVB_CALL_CAPI_CHECKED(
43 CVCRSetPropertyInt(Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_CustomPerformance),
44 static_cast<int>(value)));
50 CVB_CALL_CAPI_CHECKED(CVCRGetPropertyInt(
51 Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_CustomPerformance), value));
57 if (value < 1 || value > 4)
60 CVB_CALL_CAPI_CHECKED(
61 CVCRSetPropertyInt(Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_DetectorDensity),
62 static_cast<int>(value)));
68 CVB_CALL_CAPI_CHECKED(CVCRGetPropertyInt(
69 Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_DetectorDensity), value));
75 if (value < 0 || value > 3)
78 CVB_CALL_CAPI_CHECKED(
79 CVCRSetPropertyInt(Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_CodeSearchSpeed),
80 static_cast<int>(value)));
86 CVB_CALL_CAPI_CHECKED(CVCRGetPropertyInt(
87 Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_CodeSearchSpeed), value));
93 auto pResult = Internal::DoResCallObjectOut<ResultHandle>([&](
void *&handle) {
94 return CVB_CALL_CAPI(CVCRDecodeMultiImageWithResultRect(Handle(), plane.
Handle(), 0, aoi.
Left(), aoi.
Top(),
98 return pResult->CreateResultVector();
103 const auto size = plane.Parent().Size();
104 const auto aoi = Rect<int>(0, 0, size.Width() - 1, size.Height() - 1);
106 return ExecuteSingleInstance(plane, aoi);
111 auto pResult = Internal::DoResCallObjectOut<ResultHandle>([&](
void *&handle) {
112 return CVB_CALL_CAPI(CVCRDecodeMultiImageParallelizableRect(Handle(), plane.
Handle(), 0, aoi.
Left(), aoi.
Top(),
116 return pResult->CreateResultVector();
122 const auto aoi =
Rect<int>(0, 0, size.Width() - 1, size.Height() - 1);
void SetCodeSearchSpeed(int value)
Sets the code search speed.
Definition detail_decoder.hpp:73
void SetDetectorDensity(int value)
Sets the detector density to control the search aggressiveness for small codes.
Definition detail_decoder.hpp:55
CodeReader::CustomPerformance CustomPerformance() const
Retrieves the custom image processing method used to optimize decoding robustness and performance.
Definition detail_decoder.hpp:47
bool IsBasicInkjetDPMEnabled() const
Checks whether the Basic Inkjet DPM mode is enabled.
Definition detail_decoder.hpp:33
int CodeSearchSpeed() const
Retrieves the code search speed.
Definition detail_decoder.hpp:83
int DetectorDensity() const
Retrieves the detector density to control the search aggressiveness for small codes.
Definition detail_decoder.hpp:65
std::vector< Result > Execute(const ImagePlane &plane, const Rect< int > &aoi)
Performs the decoding.
Definition detail_decoder.hpp:109
static std::unique_ptr< Decoder > Create()
Creates and returns a new Decoder instance.
Definition detail_decoder.hpp:21
void SetCustomPerformance(CustomPerformance value)
Sets the custom image processing method used to optimize decoding robustness and performance.
Definition detail_decoder.hpp:40
void SetBasicInkjetDPMEnabled(bool value)
Enables or disables the reading of Basic Inkjet DPM (Direct Part Marking) codes.
Definition detail_decoder.hpp:27
Size2D< int > Size() const noexcept
Size of the image in pixels.
Definition decl_image.hpp:428
Image plane information container.
Definition decl_image_plane.hpp:29
void * Handle() const noexcept override
Classic API image handle.
Definition detail_image_plane.hpp:35
const Image & Parent() const noexcept
Image to which this plane descriptor refers to.
Definition detail_image_plane.hpp:87
Rectangle object.
Definition rect.hpp:24
T Bottom() const noexcept
Gets bottom row of the rectangle (still inside the rectangle).
Definition rect.hpp:144
T Top() const noexcept
Gets first row of the rectangle.
Definition rect.hpp:104
T Right() const noexcept
Gets rightmost column of the rectangle (still inside the rectangle).
Definition rect.hpp:124
T Left() const noexcept
Gets first column of the rectangle.
Definition rect.hpp:84
Namespace for all decoding functionalities.
Definition decl_config_2d_codes.hpp:10
CustomPerformance
Enum class specifying custom image processing methods to improve decoding robustness and performance.
Definition decl_decoder.hpp:47
Root namespace for the Image Manager interface.
Definition version.hpp:11