3#include "../result.hpp"
4#include "../_decl/decl_decoder.hpp"
5#include "../_decl/decl_result_handle.hpp"
14 inline std::unique_ptr<Decoder> Decoder::FromHandle(HandleGuard<Decoder> &&guard)
17 throw std::runtime_error(
"decoder handle must not be null");
19 return std::make_unique<Decoder>(std::move(guard), PrivateTag{});
24 return Internal::DoResCallObjectOut<Decoder>(
25 [&](
void *&handle) {
return CVB_CALL_CAPI(CVCRCreateDecoder(handle)); });
30 CVB_CALL_CAPI_CHECKED(
31 CVCRSetPropertyInt(Handle(),
static_cast<int>(Properties::BasicInkjet),
static_cast<int>(value)));
37 CVB_CALL_CAPI_CHECKED(CVCRGetPropertyInt(Handle(),
static_cast<int>(Properties::BasicInkjet), value));
38 return static_cast<bool>(value);
43 CVB_CALL_CAPI_CHECKED(
44 CVCRSetPropertyInt(Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_CustomPerformance),
45 static_cast<int>(value)));
51 CVB_CALL_CAPI_CHECKED(CVCRGetPropertyInt(
52 Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_CustomPerformance), value));
58 if (value < 1 || value > 4)
61 CVB_CALL_CAPI_CHECKED(
62 CVCRSetPropertyInt(Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_DetectorDensity),
63 static_cast<int>(value)));
69 CVB_CALL_CAPI_CHECKED(CVCRGetPropertyInt(
70 Handle(),
static_cast<int>(CExports::CVCRPerformanceProperties::CVCRPP_DetectorDensity), value));
76 auto pResult = Internal::DoResCallObjectOut<ResultHandle>([&](
void *&handle) {
77 return CVB_CALL_CAPI(CVCRDecodeMultiImageWithResultRect(Handle(), plane.
Handle(), 0, aoi.Left(), aoi.Top(),
78 aoi.Right(), aoi.Bottom(), 0, 0, handle));
81 return pResult->CreateResultVector();
86 const auto size = plane.Parent().Size();
87 const auto aoi = Rect<int>(0, 0, size.Width() - 1, size.Height() - 1);
89 return ExecuteSingleInstance(plane, aoi);
94 auto pResult = Internal::DoResCallObjectOut<ResultHandle>([&](
void *&handle) {
95 return CVB_CALL_CAPI(CVCRDecodeMultiImageParallelizableRect(Handle(), plane.
Handle(), 0, aoi.Left(), aoi.Top(),
96 aoi.Right(), aoi.Bottom(), 0, handle));
99 return pResult->CreateResultVector();
105 const auto aoi =
Rect<int>(0, 0, size.Width() - 1, size.Height() - 1);
void SetDetectorDensity(int value)
Sets the detector density to control the search aggressiveness for small codes.
Definition detail_decoder.hpp:56
CodeReader::CustomPerformance CustomPerformance() const
Retrieves the custom image processing method used to optimize decoding robustness and performance.
Definition detail_decoder.hpp:48
bool IsBasicInkjetDPMEnabled() const
Checks whether the Basic Inkjet DPM mode is enabled.
Definition detail_decoder.hpp:34
int DetectorDensity() const
Retrieves the detector density to control the search aggressiveness for small codes.
Definition detail_decoder.hpp:66
std::vector< Result > Execute(const ImagePlane &plane, const Rect< int > &aoi)
Performs the decoding.
Definition detail_decoder.hpp:92
static std::unique_ptr< Decoder > Create()
Creates and returns a new Decoder instance.
Definition detail_decoder.hpp:22
void SetCustomPerformance(CustomPerformance value)
Sets the custom image processing method used to optimize decoding robustness and performance.
Definition detail_decoder.hpp:41
void SetBasicInkjetDPMEnabled(bool value)
Enables or disables the reading of Basic Inkjet DPM (Direct Part Marking) codes.
Definition detail_decoder.hpp:28
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
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:32
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17