From 08de6656fcfc9aba8cf6d78461988ad24f3a6330 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 6 Dec 2024 16:14:05 -0800 Subject: [PATCH] Document the pixel layout of YUV format surfaces Fixes https://github.com/libsdl-org/SDL/issues/10530 --- include/SDL3/SDL_surface.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 9114701f1a..ff7f0d24af 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -115,6 +115,8 @@ typedef enum SDL_FlipMode * remaining bytes to reach the pitch are used as padding to reach a desired * alignment, and have undefined contents. * + * When a surface holds YUV format data, the planes are assumed to be contiguous without padding between them, e.g. a 32x32 surface in NV12 format with a pitch of 32 would consist of 32x32 bytes of Y plane followed by 32x16 bytes of UV plane. + * * \since This struct is available since SDL 3.1.3. * * \sa SDL_CreateSurface