#pragma once #include #include enum class VideoIOPixelFormat { Uyvy8, V210, Yuva10, Bgra8 }; struct V210CodeValues { uint16_t y = 64; uint16_t cb = 512; uint16_t cr = 512; }; struct V210SixPixelBlock { std::array y = {}; std::array cb = {}; std::array cr = {}; }; const char* VideoIOPixelFormatName(VideoIOPixelFormat format); bool VideoIOPixelFormatIsTenBit(VideoIOPixelFormat format); VideoIOPixelFormat ChoosePreferredVideoIOFormat(bool tenBitSupported); unsigned VideoIOBytesPerPixel(VideoIOPixelFormat format); unsigned VideoIORowBytes(VideoIOPixelFormat format, unsigned frameWidth); unsigned PackedTextureWidthFromRowBytes(unsigned rowBytes); unsigned MinimumV210RowBytes(unsigned frameWidth); unsigned MinimumYuva10RowBytes(unsigned frameWidth); unsigned ActiveV210WordsForWidth(unsigned frameWidth); V210CodeValues Rec709RgbToLegalV210(float red, float green, float blue); std::array PackV210Block(const V210SixPixelBlock& block); V210SixPixelBlock UnpackV210Block(const std::array& bytes);