2017-11-12 23:51:12 -07:00
|
|
|
/*
|
2024-01-01 14:15:26 -07:00
|
|
|
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
2017-11-12 23:51:12 -07:00
|
|
|
|
|
|
|
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 */
|
|
|
|
|
2024-02-03 08:05:32 -07:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
YUV_CONVERSION_JPEG, /**< Full range JPEG */
|
|
|
|
YUV_CONVERSION_BT601, /**< BT.601 (the default) */
|
|
|
|
YUV_CONVERSION_BT709, /**< BT.709 */
|
2024-03-01 16:35:25 -07:00
|
|
|
YUV_CONVERSION_BT2020, /**< BT.2020 */
|
2024-02-03 08:05:32 -07:00
|
|
|
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);
|
2024-03-01 03:02:53 -07:00
|
|
|
extern SDL_Colorspace GetColorspaceForYUVConversionMode(YUV_CONVERSION_MODE mode);
|
2024-02-03 08:05:32 -07:00
|
|
|
extern SDL_bool ConvertRGBtoYUV(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, YUV_CONVERSION_MODE mode, int monochrome, int luminance);
|
2017-11-12 23:51:12 -07:00
|
|
|
extern int CalculateYUVPitch(Uint32 format, int width);
|