mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-07-31 12:38:58 +00:00
Check for the sRGB color primaries rather than the transfer function
This commit is contained in:
@@ -2834,7 +2834,7 @@ bool SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g
|
||||
|
||||
if (bytes_per_pixel <= sizeof(pixel) &&
|
||||
!SDL_ISPIXELFORMAT_FOURCC(surface->format) &&
|
||||
SDL_COLORSPACETRANSFER(surface->colorspace) == SDL_TRANSFER_CHARACTERISTICS_SRGB) {
|
||||
SDL_COLORSPACEPRIMARIES(surface->colorspace) == SDL_COLOR_PRIMARIES_BT709) {
|
||||
/* Fill the appropriate number of least-significant bytes of pixel,
|
||||
* leaving the most-significant bytes set to zero */
|
||||
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
||||
@@ -2913,7 +2913,7 @@ bool SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, flo
|
||||
|
||||
if (SDL_BYTESPERPIXEL(surface->format) <= sizeof(Uint32) &&
|
||||
!SDL_ISPIXELFORMAT_FOURCC(surface->format) &&
|
||||
SDL_COLORSPACETRANSFER(surface->colorspace) == SDL_TRANSFER_CHARACTERISTICS_SRGB) {
|
||||
SDL_COLORSPACEPRIMARIES(surface->colorspace) == SDL_COLOR_PRIMARIES_BT709) {
|
||||
Uint8 r8, g8, b8, a8;
|
||||
|
||||
if (SDL_ReadSurfacePixel(surface, x, y, &r8, &g8, &b8, &a8)) {
|
||||
|
||||
Reference in New Issue
Block a user