Преглед изворни кода

Check for the sRGB color primaries rather than the transfer function

Sam Lantinga пре 1 месец
родитељ
комит
1457503bd2
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/video/SDL_surface.c

+ 2 - 2
src/video/SDL_surface.c

@@ -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)) {