Enrollment 28.2.0
Loading...
Searching...
No Matches
FaceImageType.h
Go to the documentation of this file.
1
9
10#pragma once
12#include "enrollment/Export.h"
13#include <ostream>
14
15namespace inno
16{
21 */
22 enum class FaceImageType : uint8_t
23 {
27 BASIC = 0,
35 FULL_FRONTAL = 1,
43 TOKEN_FRONTAL = 2,
48 };
49
50 // The numbers are from ISO standard and are tested in unit tests.
51 // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
52
59 */
60 static constexpr int FaceToIsoImageType(FaceImageType faceImageType)
61 {
62 switch (faceImageType)
63 {
65 return 0;
67 return 1;
69 return 2;
71 return 3;
72 }
73
74 throw EnrollmentInvalidArgumentException("Invalid conversion from FaceImageType to ISO");
75 }
76
83 */
84 static constexpr FaceImageType IsoToFaceImageType(int faceImageType)
85 {
86 switch (faceImageType)
87 {
88 case 0:
90 case 1:
92 case 2:
94 case 3:
96 default:
97 break;
98 }
99
100 throw EnrollmentInvalidArgumentException("Invalid conversion from ISO to FaceImageType");
101 }
102 // NOLINTEND(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
103
104 inline std::ostream& operator<<(std::ostream& os, FaceImageType faceImageType)
105 {
106 switch (faceImageType)
107 {
109 os << "BASIC";
110 break;
112 os << "FULL_FRONTAL";
113 break;
115 os << "TOKEN_FRONTAL";
116 break;
118 os << "POST_PROCESSED_FRONTAL";
119 break;
120 }
121 return os;
122 }
123
124} // namespace inno
Base exception for all enrollment-sdk invalid argument exceptions.
Definition EnrollmentException.h:96
static constexpr int FaceToIsoImageType(FaceImageType faceImageType)
Function converts FaceImageType to ISO face image type as defined in iso_19794-5_2011.
Definition FaceImageType.h:59
FaceImageType
Several face image types are introduced to define categories that satisfy requirements of some applic...
Definition FaceImageType.h:22
static constexpr FaceImageType IsoToFaceImageType(int faceImageType)
Function converts ISO face image type to FaceImageType.
Definition FaceImageType.h:83
@ POST_PROCESSED_FRONTAL
Applying digital post-processing to a captured image can modify this image in a way that it is more s...
Definition FaceImageType.h:46
@ TOKEN_FRONTAL
A Face Image Type that specifies frontal images with a specific geometric size and eye positioning ba...
Definition FaceImageType.h:42
@ FULL_FRONTAL
A Face Image Type that specifies frontal images with sufficient resolution for human examination as w...
Definition FaceImageType.h:34
@ BASIC
This is the fundamental Face Image Type that specifies a record format including header and represent...
Definition FaceImageType.h:26