SDL_COLORSPACE_JPEG is the default YUV colorspace

main
Sam Lantinga 2024-02-04 00:11:46 -08:00
parent 5b8e5f8b9f
commit 327b976bc4
4 changed files with 12 additions and 5 deletions

View File

@ -1386,7 +1386,7 @@ The following functions have been renamed:
The following functions have been removed:
* SDL_GetYUVConversionMode()
* SDL_GetYUVConversionModeForResolution()
* SDL_SetYUVConversionMode() - use SDL_SetSurfaceColorspace() to set the surface colorspace and SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER with SDL_CreateTextureWithProperties() to set the texture colorspace. The default colorspace for YUV pixel formats is SDL_COLORSPACE_BT601_LIMITED.
* SDL_SetYUVConversionMode() - use SDL_SetSurfaceColorspace() to set the surface colorspace and SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER with SDL_CreateTextureWithProperties() to set the texture colorspace. The default colorspace for YUV pixel formats is SDL_COLORSPACE_JPEG.
* SDL_SoftStretchLinear() - use SDL_SoftStretch() with SDL_SCALEMODE_LINEAR
## SDL_system.h

View File

@ -591,6 +591,14 @@ typedef enum
SDL_MATRIX_COEFFICIENTS_UNSPECIFIED,
SDL_CHROMA_LOCATION_NONE),
SDL_COLORSPACE_JPEG = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 */
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
SDL_COLOR_RANGE_FULL,
SDL_COLOR_PRIMARIES_BT709,
SDL_TRANSFER_CHARACTERISTICS_BT601,
SDL_MATRIX_COEFFICIENTS_BT601,
SDL_CHROMA_LOCATION_NONE),
SDL_COLORSPACE_BT601_LIMITED = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 */
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
SDL_COLOR_RANGE_LIMITED,
@ -627,7 +635,7 @@ typedef enum
SDL_COLORSPACE_RGB_DEFAULT = SDL_COLORSPACE_SRGB,
/* The default colorspace for YUV surfaces if no colorspace is specified */
SDL_COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_BT601_LIMITED,
SDL_COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_JPEG,
} SDL_Colorspace;

View File

@ -458,8 +458,7 @@ extern DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer *
* - `SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER`: an SDL_ColorSpace value
* describing the texture colorspace, defaults to SDL_COLORSPACE_SCRGB for
* floating point textures, SDL_COLORSPACE_HDR10 for 10-bit textures,
* SDL_COLORSPACE_SRGB for other RGB textures and
* SDL_COLORSPACE_BT601_LIMITED for YUV textures.
* SDL_COLORSPACE_SRGB for other RGB textures and SDL_COLORSPACE_JPEG for YUV textures.
* - `SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER`: one of the enumerated values in
* SDL_PixelFormatEnum, defaults to the best RGBA format for the renderer
* - `SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER`: one of the enumerated values in

View File

@ -117,7 +117,7 @@ static int run_automated_tests(int pattern_size, int extra_pitch)
SDL_PIXELFORMAT_YVYU
};
const SDL_Colorspace colorspaces[] = {
SDL_COLORSPACE_BT601_FULL,
SDL_COLORSPACE_JPEG,
SDL_COLORSPACE_BT601_LIMITED,
SDL_COLORSPACE_BT709_LIMITED
};