Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
b
c
d
e
h
i
l
m
n
p
r
s
u
x
Typedefs
b
c
d
e
f
g
i
m
p
r
u
v
Enumerations
Enumerator
a
b
f
g
i
m
n
r
s
u
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
h
i
m
n
p
q
r
s
t
u
v
x
Enumerations
a
c
d
e
f
k
l
m
p
r
s
t
v
w
Enumerator
a
b
d
f
g
h
i
l
m
n
o
p
r
s
u
v
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
b
c
d
e
f
g
m
o
p
r
s
t
u
v
w
Variables
a
b
c
d
e
f
i
k
l
m
n
o
p
r
s
t
w
Typedefs
Enumerations
Enumerator
Macros
_
d
f
i
m
n
p
s
t
u
shared
depthai-shared
include
depthai-shared
datatype
RawImgFrame.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <unordered_map>
4
5
#include "
depthai-shared/common/FrameEvent.hpp
"
6
#include "
depthai-shared/datatype/RawBuffer.hpp
"
7
#include "
depthai-shared/utility/Serialization.hpp
"
8
9
namespace
dai
{
10
12
struct
RawImgFrame
:
public
RawBuffer
{
13
enum class
Type
{
14
YUV422i
,
// interleaved 8 bit
15
YUV444p
,
// planar 4:4:4 format
16
YUV420p
,
// planar 4:2:0 format
17
YUV422p
,
// planar 8 bit
18
YUV400p
,
// 8-bit greyscale
19
RGBA8888
,
// RGBA interleaved stored in 32 bit word
20
RGB161616
,
// Planar 16 bit RGB data
21
RGB888p
,
// Planar 8 bit RGB data
22
BGR888p
,
// Planar 8 bit BGR data
23
RGB888i
,
// Interleaved 8 bit RGB data
24
BGR888i
,
// Interleaved 8 bit BGR data
25
LUT2
,
// 1 bit per pixel, Lookup table (used for graphics layers)
26
LUT4
,
// 2 bits per pixel, Lookup table (used for graphics layers)
27
LUT16
,
// 4 bits per pixel, Lookup table (used for graphics layers)
28
RAW16
,
// save any raw type (8, 10, 12bit) on 16 bits
29
RAW14
,
// 14bit value in 16bit storage
30
RAW12
,
// 12bit value in 16bit storage
31
RAW10
,
// 10bit value in 16bit storage
32
RAW8
,
33
PACK10
,
// SIPP 10bit packed format
34
PACK12
,
// SIPP 12bit packed format
35
YUV444i
,
36
NV12
,
37
NV21
,
38
BITSTREAM
,
// used for video encoder bitstream
39
HDR
,
40
RGBF16F16F16p
,
// Planar FP16 RGB data
41
BGRF16F16F16p
,
// Planar FP16 BGR data
42
RGBF16F16F16i
,
// Interleaved FP16 RGB data
43
BGRF16F16F16i
,
// Interleaved FP16 BGR data
44
GRAY8
,
// 8 bit grayscale (1 plane)
45
GRAYF16
,
// FP16 grayscale (normalized)
46
NONE
47
};
48
49
static
constexpr
int
typeToBpp
(
Type
type
) {
50
switch
(
type
) {
51
case
Type::YUV422i
:
52
return
1;
53
break
;
54
case
Type::YUV444p
:
55
return
1;
56
break
;
57
case
Type::YUV420p
:
58
return
1;
59
break
;
60
case
Type::YUV422p
:
61
return
1;
62
break
;
63
case
Type::YUV400p
:
64
return
1;
65
break
;
66
case
Type::RGBA8888
:
67
return
1;
68
break
;
69
case
Type::RGB161616
:
70
return
2;
71
break
;
72
case
Type::RGB888p
:
73
return
1;
74
break
;
75
case
Type::BGR888p
:
76
return
1;
77
break
;
78
case
Type::RGB888i
:
79
return
1;
80
break
;
81
case
Type::BGR888i
:
82
return
1;
83
break
;
84
case
Type::RGBF16F16F16p
:
85
return
2;
86
break
;
87
case
Type::BGRF16F16F16p
:
88
return
2;
89
break
;
90
case
Type::RGBF16F16F16i
:
91
return
2;
92
break
;
93
case
Type::BGRF16F16F16i
:
94
return
2;
95
break
;
96
case
Type::GRAY8
:
97
return
1;
98
break
;
99
case
Type::GRAYF16
:
100
return
2;
101
break
;
102
case
Type::LUT2
:
103
return
1;
104
break
;
105
case
Type::LUT4
:
106
return
1;
107
break
;
108
case
Type::LUT16
:
109
return
1;
110
break
;
111
case
Type::RAW16
:
112
return
2;
113
break
;
114
case
Type::RAW14
:
115
return
2;
116
break
;
117
case
Type::RAW12
:
118
return
2;
119
break
;
120
case
Type::RAW10
:
121
return
2;
122
break
;
123
case
Type::RAW8
:
124
return
1;
125
break
;
126
case
Type::PACK10
:
127
return
2;
128
break
;
129
case
Type::PACK12
:
130
return
2;
131
break
;
132
case
Type::YUV444i
:
133
return
1;
134
break
;
135
case
Type::NV12
:
136
return
1;
137
break
;
138
case
Type::NV21
:
139
return
1;
140
break
;
141
case
Type::BITSTREAM
:
142
return
1;
143
break
;
144
case
Type::HDR
:
145
return
1;
146
break
;
147
case
Type::NONE
:
148
return
0;
149
break
;
150
}
151
return
0;
152
}
153
154
struct
Specs
{
155
Type
type
=
Type::NONE
;
156
unsigned
int
width
;
// width in pixels
157
unsigned
int
height
;
// height in pixels
158
unsigned
int
stride
;
// defined as distance in bytes from pix(y,x) to pix(y+1,x)
159
unsigned
int
bytesPP
;
// bytes per pixel (for LUT types 1)
160
unsigned
int
p1Offset
;
// Offset to first plane
161
unsigned
int
p2Offset
;
// Offset to second plane
162
unsigned
int
p3Offset
;
// Offset to third plane
163
164
DEPTHAI_SERIALIZE
(
Specs
,
type
,
width
,
height
,
stride
,
bytesPP
,
p1Offset
,
p2Offset
,
p3Offset
);
165
};
166
struct
CameraSettings
{
167
int32_t
exposureTimeUs
;
168
int32_t
sensitivityIso
;
169
int32_t
lensPosition
;
170
int32_t
wbColorTemp
;
171
float
lensPositionRaw
;
172
173
DEPTHAI_SERIALIZE
(
CameraSettings
,
exposureTimeUs
,
sensitivityIso
,
lensPosition
,
wbColorTemp
,
lensPositionRaw
);
174
};
175
176
Specs
fb
= {};
177
CameraSettings
cam
;
178
uint32_t
category
= 0;
//
179
uint32_t
instanceNum
= 0;
// Which source created this frame (color, mono, ...)
180
dai::FrameEvent
event
=
dai::FrameEvent::NONE
;
181
182
void
serialize
(std::vector<std::uint8_t>& metadata,
DatatypeEnum
& datatype)
const override
{
183
metadata =
utility::serialize
(*
this
);
184
datatype =
DatatypeEnum::ImgFrame
;
185
};
186
187
DatatypeEnum
getType
()
const override
{
188
return
DatatypeEnum::ImgFrame
;
189
}
190
191
DEPTHAI_SERIALIZE
(
RawImgFrame
,
fb
,
cam
,
category
,
instanceNum
,
RawBuffer::sequenceNum
,
RawBuffer::ts
,
RawBuffer::tsDevice
);
192
};
193
194
}
// namespace dai
dai::RawImgFrame::Type::RAW8
@ RAW8
dai::RawImgFrame::Specs
Definition:
RawImgFrame.hpp:154
dai::RawImgFrame::Type::BITSTREAM
@ BITSTREAM
dai::RawImgFrame
RawImgFrame structure.
Definition:
RawImgFrame.hpp:12
dai::FrameEvent
FrameEvent
Definition:
FrameEvent.hpp:8
dai::RawImgFrame::Type::GRAYF16
@ GRAYF16
dai::RawImgFrame::Type::RAW12
@ RAW12
dai::RawImgFrame::Type::GRAY8
@ GRAY8
dai::RawImgFrame::Type::LUT16
@ LUT16
dai::DatatypeEnum
DatatypeEnum
Definition:
DatatypeEnum.hpp:7
dai::RawImgFrame::Type::BGRF16F16F16p
@ BGRF16F16F16p
dai::RawImgFrame::Type::BGRF16F16F16i
@ BGRF16F16F16i
dai::RawImgFrame::Specs::p3Offset
unsigned int p3Offset
Definition:
RawImgFrame.hpp:162
dai::RawImgFrame::CameraSettings::DEPTHAI_SERIALIZE
DEPTHAI_SERIALIZE(CameraSettings, exposureTimeUs, sensitivityIso, lensPosition, wbColorTemp, lensPositionRaw)
dai::RawImgFrame::typeToBpp
static constexpr int typeToBpp(Type type)
Definition:
RawImgFrame.hpp:49
dai::RawImgFrame::Specs::width
unsigned int width
Definition:
RawImgFrame.hpp:156
dai::RawImgFrame::Type::RGB888p
@ RGB888p
dai::RawImgFrame::Type::PACK12
@ PACK12
dai::RawImgFrame::CameraSettings
Definition:
RawImgFrame.hpp:166
dai::RawImgFrame::Type
Type
Definition:
RawImgFrame.hpp:13
dai::RawImgFrame::Type::LUT4
@ LUT4
dai::RawImgFrame::Type::RGBF16F16F16p
@ RGBF16F16F16p
dai::RawImgFrame::CameraSettings::wbColorTemp
int32_t wbColorTemp
Definition:
RawImgFrame.hpp:170
dai::RawImgFrame::Type::NV12
@ NV12
dai::RawImgFrame::serialize
void serialize(std::vector< std::uint8_t > &metadata, DatatypeEnum &datatype) const override
Definition:
RawImgFrame.hpp:182
dai::RawImgFrame::Type::RGB888i
@ RGB888i
dai::utility::serialize
bool serialize(const T &obj, std::vector< std::uint8_t > &data)
Definition:
Serialization.hpp:38
dai::RawImgFrame::Type::YUV444i
@ YUV444i
dai::RawImgFrame::Type::BGR888i
@ BGR888i
dai::RawImgFrame::CameraSettings::lensPosition
int32_t lensPosition
Definition:
RawImgFrame.hpp:169
dai::RawImgFrame::Type::BGR888p
@ BGR888p
dai::RawImgFrame::Specs::stride
unsigned int stride
Definition:
RawImgFrame.hpp:158
dai::RawBuffer::sequenceNum
int64_t sequenceNum
Definition:
RawBuffer.hpp:16
dai::RawImgFrame::Type::RAW14
@ RAW14
dai::RawImgFrame::Type::RAW16
@ RAW16
dai::RawImgFrame::Type::HDR
@ HDR
dai::RawBuffer::tsDevice
Timestamp tsDevice
Definition:
RawBuffer.hpp:18
dai::RawImgFrame::category
uint32_t category
Definition:
RawImgFrame.hpp:178
RawBuffer.hpp
dai::RawImgFrame::Type::YUV444p
@ YUV444p
dai::RawImgFrame::Type::NV21
@ NV21
dai::RawImgFrame::Type::PACK10
@ PACK10
dai::RawImgFrame::Type::LUT2
@ LUT2
FrameEvent.hpp
nanorpc::core::detail::pack::meta::type
type
Definition:
pack_meta.h:26
dai::RawImgFrame::CameraSettings::sensitivityIso
int32_t sensitivityIso
Definition:
RawImgFrame.hpp:168
dai::RawImgFrame::Specs::p2Offset
unsigned int p2Offset
Definition:
RawImgFrame.hpp:161
Serialization.hpp
dai::RawImgFrame::Specs::DEPTHAI_SERIALIZE
DEPTHAI_SERIALIZE(Specs, type, width, height, stride, bytesPP, p1Offset, p2Offset, p3Offset)
dai::RawImgFrame::CameraSettings::lensPositionRaw
float lensPositionRaw
Definition:
RawImgFrame.hpp:171
dai::RawImgFrame::Type::YUV400p
@ YUV400p
dai::RawImgFrame::Type::RGBF16F16F16i
@ RGBF16F16F16i
dai::RawImgFrame::Type::NONE
@ NONE
dai::RawImgFrame::Specs::bytesPP
unsigned int bytesPP
Definition:
RawImgFrame.hpp:159
dai::RawImgFrame::instanceNum
uint32_t instanceNum
Definition:
RawImgFrame.hpp:179
dai::RawImgFrame::cam
CameraSettings cam
Definition:
RawImgFrame.hpp:177
dai::RawImgFrame::CameraSettings::exposureTimeUs
int32_t exposureTimeUs
Definition:
RawImgFrame.hpp:167
dai::RawImgFrame::Type::RAW10
@ RAW10
dai::RawBuffer
RawBuffer structure.
Definition:
RawBuffer.hpp:12
dai::RawImgFrame::Type::YUV420p
@ YUV420p
dai::RawImgFrame::fb
Specs fb
Definition:
RawImgFrame.hpp:176
dai::DatatypeEnum::ImgFrame
@ ImgFrame
dai::RawImgFrame::Type::RGBA8888
@ RGBA8888
dai::RawImgFrame::Specs::type
Type type
Definition:
RawImgFrame.hpp:155
dai::FrameEvent::NONE
@ NONE
dai::RawImgFrame::Type::YUV422p
@ YUV422p
dai
Definition:
CameraExposureOffset.hpp:6
dai::RawImgFrame::DEPTHAI_SERIALIZE
DEPTHAI_SERIALIZE(RawImgFrame, fb, cam, category, instanceNum, RawBuffer::sequenceNum, RawBuffer::ts, RawBuffer::tsDevice)
dai::RawImgFrame::Type::RGB161616
@ RGB161616
dai::RawImgFrame::getType
DatatypeEnum getType() const override
Definition:
RawImgFrame.hpp:187
dai::RawImgFrame::Specs::p1Offset
unsigned int p1Offset
Definition:
RawImgFrame.hpp:160
dai::RawImgFrame::Specs::height
unsigned int height
Definition:
RawImgFrame.hpp:157
dai::RawImgFrame::Type::YUV422i
@ YUV422i
dai::RawBuffer::ts
Timestamp ts
Definition:
RawBuffer.hpp:17
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19