From 6aaedb813fa11ba0679c3051bc2eb28646b9506c Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 30 Aug 2025 16:53:58 -0700 Subject: Update to SDL3 --- src/contrib/SDL-3.2.20/test/testyuv_cvt.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/contrib/SDL-3.2.20/test/testyuv_cvt.h (limited to 'src/contrib/SDL-3.2.20/test/testyuv_cvt.h') diff --git a/src/contrib/SDL-3.2.20/test/testyuv_cvt.h b/src/contrib/SDL-3.2.20/test/testyuv_cvt.h new file mode 100644 index 0000000..460026d --- /dev/null +++ b/src/contrib/SDL-3.2.20/test/testyuv_cvt.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 1997-2025 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* These functions are designed for testing correctness, not for speed */ + +typedef enum +{ + YUV_CONVERSION_JPEG, /**< Full range JPEG */ + YUV_CONVERSION_BT601, /**< BT.601 (the default) */ + YUV_CONVERSION_BT709, /**< BT.709 */ + YUV_CONVERSION_BT2020, /**< BT.2020 */ + YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */ +} YUV_CONVERSION_MODE; + +extern void SetYUVConversionMode(YUV_CONVERSION_MODE mode); +extern YUV_CONVERSION_MODE GetYUVConversionModeForResolution(int width, int height); +extern SDL_Colorspace GetColorspaceForYUVConversionMode(YUV_CONVERSION_MODE mode); +extern bool ConvertRGBtoYUV(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, YUV_CONVERSION_MODE mode, int monochrome, int luminance); +extern int CalculateYUVPitch(Uint32 format, int width); -- cgit v1.2.3