public static class VideoColourConversionTurns a decoded frame into packed BGRA, on the CPU.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
This is not the playback path. Playback uploads the planes as they are and converts in the sampler, because at 1080p60 this loop is most of a core and the GPU does it for nothing. What this is for is everything else: a thumbnail, a test that wants to assert on a pixel, a tool that writes a PNG, and a platform whose material stack cannot sample three textures at once.
Fixed point, not floating. Sixteen fractional bits are exact enough that no eight-bit output differs from the float result, and the loop stays integer end to end — which matters here because the alternative is four converts per pixel and two million pixels a frame.
Methods (2)
public static int BgraSize(in VideoFormat format)How many bytes ToBgra writes for a format.
public static void ToBgra(VideoFrame frame, Span<byte> destination)Converts a frame to packed BGRA.
Used by (2)
- ColourRoundTripTestsVixen.Video.Tests
- VideoColourConversionTestsVixen.Video.Tests