140 #include <string_view>
142 #include "../base/bytes.h"
163 enum Format : uint8_t {
175 kFormatBgr888Packed = 10,
176 kFormatRgb888Packed = 11,
177 kFormatRgb888Planar = 12,
181 kFormatRgba8888Packed = 15,
182 kFormatBgra8888Packed = 16,
192 kFormatUint16C1 = 28,
193 kFormatUint16C2 = 29,
194 kFormatUint16C3 = 30,
195 kFormatUint16C4 = 31,
204 kFormatFloat32C1 = 40,
205 kFormatFloat32C2 = 41,
206 kFormatFloat32C3 = 42,
207 kFormatFloat32C4 = 43,
208 kFormatFloat64C1 = 44,
209 kFormatFloat64C2 = 45,
210 kFormatFloat64C3 = 46,
211 kFormatFloat64C4 = 47,
213 kFormatBayerRggb8 = 60,
214 kFormatBayerBggr8 = 61,
215 kFormatBayerGbrg8 = 62,
216 kFormatBayerGrbg8 = 63,
217 kFormatBayerRggb16 = 64,
218 kFormatBayerBggr16 = 65,
219 kFormatBayerGbrg16 = 66,
220 kFormatBayerGrbg16 = 67,
235 enum Stream : uint8_t {
301 bool operator>>(Bytes& bytes)
const noexcept;
309 [[nodiscard]]
static bool check_valid(
const Bytes& bytes) noexcept;
317 [[nodiscard]]
static Format format_from_encoding(std::string_view encoding) noexcept;
322 [[nodiscard]]
static std::string_view encoding_from_format(Format format) noexcept;
336 [[nodiscard]]
bool is_valid()
const noexcept;
344 bool shallow_copy(
const CameraFrame& target) noexcept;
352 bool deep_copy(
const CameraFrame& target) noexcept;
368 bool create(
size_t size) noexcept;
373 void clear() noexcept;
382 bool shallow_copy(uint8_t* data,
size_t size) noexcept;
391 bool deep_copy(uint8_t* data,
size_t size) noexcept;
400 bool fill_data(uint8_t* data,
size_t size) noexcept;
407 [[nodiscard]] uint32_t channel()
const noexcept;
414 [[nodiscard]] uint32_t width()
const noexcept;
421 [[nodiscard]] uint32_t height()
const noexcept;
428 [[nodiscard]] uint32_t freq()
const noexcept;
435 [[nodiscard]] Format format()
const noexcept;
442 [[nodiscard]] Stream stream()
const noexcept;
449 [[nodiscard]]
const uint8_t* data()
const noexcept;
456 [[nodiscard]]
size_t size()
const noexcept;
463 [[nodiscard]]
bool is_owner()
const noexcept;
470 void set_channel(uint32_t channel) noexcept;
477 void set_width(uint32_t width) noexcept;
484 void set_height(uint32_t height) noexcept;
491 void set_freq(uint32_t freq) noexcept;
498 void set_format(Format format) noexcept;
505 void set_stream(Stream stream) noexcept;
512 uint32_t& get_reserved() noexcept {
return reserved_buf_; }
516 static constexpr
bool kZerocopyTypes{
true};
519 uint8_t* data_{
nullptr};
521 uint32_t channel_{0};
525 Format format_{kFormatUnknown};
526 Stream stream_{kStreamUnknown};
527 bool is_owner_{
false};
528 uint32_t reserved_buf_{0};
530 static constexpr uint32_t kMagicNumberBegin{0x98B7F15A};
531 static constexpr uint32_t kMagicNumberEnd{0x98B7F15F};
constexpr bool is_valid() noexcept
Definition: name_detector.h:382
size_t get_serialized_size(const T &src) noexcept
Returns a serialised-size hint for src with explicit codec tag.
Definition: serializer-inl.h:263
VLINK_EXPORT std::ostream & operator<<(std::ostream &ostream, const BasePtr &status) noexcept
Writes the human-readable description of status to ostream.
struct VLINK_EXPORT_AND_ALIGNED(8) AudioFrame final
Definition: audio_frame.h:140
80-byte POD container holding one camera / video frame plus image-format metadata.