libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
jpegxsbitstream.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_PROAV
13#include <cstdint>
14#include <promeki/namespace.h>
15#include <promeki/bufferview.h>
16#include <promeki/error.h>
17#include <promeki/pixelformat.h>
18
19PROMEKI_NAMESPACE_BEGIN
20
52class JpegXsBitstream {
53 public:
55 enum Marker : uint16_t {
56 MarkerSoc = 0xFF10,
57 MarkerEoc = 0xFF11,
58 MarkerPih = 0xFF12,
59 MarkerCdt = 0xFF13,
60 MarkerWgt = 0xFF14,
61 MarkerCom = 0xFF15,
62 MarkerNlt = 0xFF16,
63 MarkerCwd = 0xFF17,
64 MarkerCts = 0xFF18,
65 MarkerCrg = 0xFF19,
66 MarkerCap = 0xFF50,
67 };
68
89 struct PictureInfo {
90 uint16_t width = 0;
91 uint16_t height = 0;
92 uint8_t numComponents = 0;
93 uint8_t bitDepth = 0;
94 uint16_t profile = 0;
95 uint16_t level = 0;
96 uint8_t hSubsampling[4] = {1, 1, 1, 1};
97 uint8_t vSubsampling[4] = {1, 1, 1, 1};
98 uint8_t perComponentBitDepth[4] = {0, 0, 0, 0};
99 bool hasCdt = false;
100 };
101
125 static Error parsePictureHeader(const BufferView &view, PictureInfo &out);
126
142 static PixelFormat::ID pixelFormatFor(const PictureInfo &info);
143};
144
145PROMEKI_NAMESPACE_END
146
147#endif // PROMEKI_ENABLE_PROAV