mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-27 05:28:29 +00:00
A second take on HDR support with an SDR white point and HDR headroom
This better reflects how HDR content is actually used, e.g. most content is in the SDR range, with specular highlights and bright details beyond the SDR range, in the HDR headroom. This more closely matches how HDR is handled on Apple platforms, as EDR. This also greatly simplifies application code which no longer has to think about color scaling. SDR content is rendered at the appropriate brightness automatically, and HDR content is scaled to the correct range for the display HDR headroom.
This commit is contained in:
@@ -64,6 +64,8 @@ struct SDL_Texture
|
||||
{
|
||||
const void *magic;
|
||||
SDL_Colorspace colorspace; /**< The colorspace of the texture */
|
||||
float SDR_white_point; /**< The SDR white point for this content */
|
||||
float HDR_headroom; /**< The HDR headroom needed by this content */
|
||||
Uint32 format; /**< The pixel format of the texture */
|
||||
int access; /**< SDL_TextureAccess */
|
||||
int w; /**< The width of the texture */
|
||||
@@ -254,6 +256,8 @@ struct SDL_Renderer
|
||||
SDL_Mutex *target_mutex;
|
||||
|
||||
SDL_Colorspace output_colorspace;
|
||||
float SDR_white_point;
|
||||
float HDR_headroom;
|
||||
|
||||
float color_scale;
|
||||
SDL_FColor color; /**< Color for drawing operations values */
|
||||
|
Reference in New Issue
Block a user