Add PixelFormat::NV12

This commit is contained in:
Wojtek Figat
2024-05-15 11:14:16 +02:00
parent 3ae30a59b3
commit 9d2dc91920
6 changed files with 18 additions and 2 deletions

View File

@@ -349,6 +349,10 @@ void RenderTools::ComputePitch(PixelFormat format, int32 width, int32 height, ui
rowPitch = ((width + 1) >> 1) * 4;
slicePitch = rowPitch * height;
break;
case PixelFormat::NV12:
rowPitch = width;
slicePitch = width * height * 3 / 2;
break;
default:
// Default byte alignment
rowPitch = (width * PixelFormatExtensions::SizeInBits(format) + 7) / 8;