Face Engine SDK
4.6.0
A face detection, recognition and tracking engine.
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
Format.h
1
#pragma once
2
3
#include <cassert>
4
5
namespace
fsdk
6
{
7
11
struct
Format
{
12
15
enum
Type
{
16
Unknown
,
17
B8G8R8X8
,
18
R8G8B8X8
,
19
B8G8R8
,
20
R8G8B8
,
21
R8
,
22
R16
,
23
IR_X8X8X8
,
24
YUV_NV21
25
};
26
33
int
getChannelCount
() const noexcept {
34
switch
(
m_type
) {
35
case
B8G8R8X8
:
36
case
R8G8B8X8
:
37
case
B8G8R8
:
38
case
R8G8B8
:
39
case
IR_X8X8X8
:
40
case
YUV_NV21
:
41
return
3;
42
case
R8
:
43
case
R16
:
44
return
1;
45
default
:
46
return
0;
47
}
48
}
49
54
int
getChannelStep
() const noexcept {
55
switch
(
m_type
) {
56
case
B8G8R8X8
:
57
case
R8G8B8X8
:
58
return
4;
59
case
B8G8R8
:
60
case
R8G8B8
:
61
case
IR_X8X8X8
:
62
return
3;
63
case
R8
:
64
case
R16
:
65
case
YUV_NV21
:
66
return
1;
67
default
:
68
return
0;
69
}
70
}
71
75
int
getChannelSize
() const noexcept {
76
switch
(
m_type
) {
77
case
B8G8R8X8
:
78
case
R8G8B8X8
:
79
case
B8G8R8
:
80
case
R8G8B8
:
81
case
IR_X8X8X8
:
82
case
R8
:
83
return
8;
84
case
R16
:
85
return
16;
86
case
YUV_NV21
:
87
return
12;
88
default
:
89
return
0;
90
}
91
}
92
96
int
getBitDepth
() const noexcept {
97
return
getChannelStep
() *
getChannelSize
();
98
}
99
103
int
getByteDepth
() const noexcept {
104
if
(
isBlock
()) {
105
assert(!
"Not implemented"
);
106
return
0;
107
}
108
else
{
109
return
getBitDepth
() >> 3;
110
}
111
}
112
117
int
computePitch
(
int
rowWidth)
const
noexcept {
118
return
rowWidth *
getByteDepth
();
119
}
120
123
bool
isPadded
() const noexcept {
124
switch
(
m_type
) {
125
case
B8G8R8X8
:
126
case
R8G8B8X8
:
127
return
true
;
128
default
:
129
return
false
;
130
}
131
}
132
137
bool
isBGR
() const noexcept {
138
switch
(
m_type
) {
139
case
B8G8R8X8
:
140
case
B8G8R8
:
141
return
true
;
142
default
:
143
return
false
;
144
}
145
}
146
149
bool
isYUV
() const noexcept {
150
switch
(
m_type
) {
151
case
YUV_NV21
:
152
return
true
;
153
default
:
154
return
false
;
155
}
156
}
157
162
bool
isBlock
() const noexcept {
163
return
false
;
164
}
165
169
bool
isValid
() const noexcept {
170
return
m_type
!=
Unknown
;
171
}
172
176
Format
() noexcept :
m_type
(
Unknown
) {}
177
181
Format
(
Type
type) noexcept :
m_type
(type) {}
182
184
operator
Type
() const noexcept {
185
return
m_type
;
186
}
187
188
protected
:
189
Type
m_type
;
190
};
191
}
192
193
fsdk::Format::getBitDepth
int getBitDepth() const noexcept
Get number of bits per pixel.
Definition:
Format.h:96
fsdk::Format::getChannelSize
int getChannelSize() const noexcept
Get color channel size in bits.
Definition:
Format.h:75
fsdk::Format::R8G8B8
3 channel, 8 bit per channel, R-G-B color order format;
Definition:
Format.h:20
fsdk::Format::Unknown
unknown format.
Definition:
Format.h:16
fsdk::Format::getChannelStep
int getChannelStep() const noexcept
Get channel step.
Definition:
Format.h:54
fsdk::Format::isBlock
bool isBlock() const noexcept
Definition:
Format.h:162
fsdk::Format::Format
Format() noexcept
Initializes format structure.
Definition:
Format.h:176
fsdk::Format::computePitch
int computePitch(int rowWidth) const noexcept
Compute row size in bytes.
Definition:
Format.h:117
fsdk::Format::isValid
bool isValid() const noexcept
Definition:
Format.h:169
fsdk::Format
Image format.
Definition:
Format.h:11
fsdk::Format::isBGR
bool isBGR() const noexcept
Definition:
Format.h:137
fsdk::Format::getChannelCount
int getChannelCount() const noexcept
Get color channel count.
Definition:
Format.h:33
fsdk::Format::getByteDepth
int getByteDepth() const noexcept
Get number of bytes per pixel.
Definition:
Format.h:103
fsdk::Format::B8G8R8
3 channel, 8 bit per channel, B-G-R color order format;
Definition:
Format.h:19
fsdk::Format::Type
Type
Format type enumeration.
Definition:
Format.h:15
fsdk::Format::m_type
Type m_type
Format type.
Definition:
Format.h:189
fsdk::Format::isPadded
bool isPadded() const noexcept
Definition:
Format.h:123
fsdk::Format::R8
1 channel, 8 bit per channel format;
Definition:
Format.h:21
fsdk::Format::B8G8R8X8
3 channel, 8 bit per channel, B-G-R color order format with 8 bit padding before next pixel; ...
Definition:
Format.h:17
fsdk::Format::R16
1 channel, 16 bit per channel format;
Definition:
Format.h:22
fsdk::Format::R8G8B8X8
3 channel, 8 bit per channel, R-G-B color order format with 8 bit padding before next pixel; ...
Definition:
Format.h:18
fsdk::Format::YUV_NV21
4:2:0 format with a plane of 8-bit Y samples followed by interleaved 2x2 subsampled V/U 8-bit chroma ...
Definition:
Format.h:24
fsdk::Format::isYUV
bool isYUV() const noexcept
Definition:
Format.h:149
fsdk::Format::Format
Format(Type type) noexcept
Initializes format structure.
Definition:
Format.h:181
fsdk::Format::IR_X8X8X8
3 channel, 8 bit per channel format with InfraRed semantics.
Definition:
Format.h:23
include
fsdk
Types
Format.h
Generated on Fri Apr 16 2021 10:32:02 for Face Engine SDK by
1.8.5