CVB++ 14.0
grade_result_base.hpp
1#pragma once
2
3#include "../_cexports/c_barcode.h"
4#include "barcode.hpp"
5#include "../global.hpp"
6
7namespace Cvb
8{
9 CVB_BEGIN_INLINE_NS
10
11 namespace Barcode
12 {
13 namespace Results
14 {
15
17
20 {
21 public:
22 GradeResultBase(CExports::CVC_BC_INFO& handle)
23 : handle_(&handle)
24 {
25 }
26
28 : handle_(nullptr)
29 {
30 }
31
32 virtual double GradeDecode() const = 0;
33 virtual double GradeOverall() const = 0;
34 virtual double GradeSymbolContrast() const = 0;
35 virtual double ReflectanceMax() const = 0;
36 virtual double ReflectanceMin() const = 0;
37 virtual double SymbolContrast() const = 0;
38
39 bool IsValid() const noexcept
40 {
41 return handle_ != nullptr;
42 }
43
44 protected:
45 CExports::CVC_BC_INFO* handle_;
46
47 protected:
48 void CheckHandlePointerAndThrow() const
49 {
50 if (handle_ == nullptr)
51 std::runtime_error("Grade result not defined: Tried to access nullptr.");
52 }
53
54 };
55 }
56
59 }
60
61 CVB_END_INLINE_NS
62}
Configuration to access parameters of GradeResultBase.
Definition: grade_result_base.hpp:20
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24