src/video/SDL_yuv_sw.c
changeset 1965 a788656ca29a
parent 1920 8a162bfdc838
child 2168 07f084fe97d0
     1.1 --- a/src/video/SDL_yuv_sw.c	Thu Aug 03 19:34:05 2006 +0000
     1.2 +++ b/src/video/SDL_yuv_sw.c	Sat Aug 05 17:09:42 2006 +0000
     1.3 @@ -975,8 +975,8 @@
     1.4  
     1.5      /* You have chosen wisely... */
     1.6      switch (swdata->texture->format) {
     1.7 -    case SDL_PixelFormat_YV12:
     1.8 -    case SDL_PixelFormat_IYUV:
     1.9 +    case SDL_PIXELFORMAT_YV12:
    1.10 +    case SDL_PIXELFORMAT_IYUV:
    1.11          if (SDL_BYTESPERPIXEL(target_format) == 2) {
    1.12  #if 0                           /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES */
    1.13              /* inline assembly functions */
    1.14 @@ -1015,9 +1015,9 @@
    1.15              swdata->Display2X = Color32DitherYV12Mod2X;
    1.16          }
    1.17          break;
    1.18 -    case SDL_PixelFormat_YUY2:
    1.19 -    case SDL_PixelFormat_UYVY:
    1.20 -    case SDL_PixelFormat_YVYU:
    1.21 +    case SDL_PIXELFORMAT_YUY2:
    1.22 +    case SDL_PIXELFORMAT_UYVY:
    1.23 +    case SDL_PIXELFORMAT_YVYU:
    1.24          if (SDL_BYTESPERPIXEL(target_format) == 2) {
    1.25              swdata->Display1X = Color16DitherYUY2Mod1X;
    1.26              swdata->Display2X = Color16DitherYUY2Mod2X;
    1.27 @@ -1061,11 +1061,11 @@
    1.28      }
    1.29  
    1.30      switch (texture->format) {
    1.31 -    case SDL_PixelFormat_YV12:
    1.32 -    case SDL_PixelFormat_IYUV:
    1.33 -    case SDL_PixelFormat_YUY2:
    1.34 -    case SDL_PixelFormat_UYVY:
    1.35 -    case SDL_PixelFormat_YVYU:
    1.36 +    case SDL_PIXELFORMAT_YV12:
    1.37 +    case SDL_PIXELFORMAT_IYUV:
    1.38 +    case SDL_PIXELFORMAT_YUY2:
    1.39 +    case SDL_PIXELFORMAT_UYVY:
    1.40 +    case SDL_PIXELFORMAT_YVYU:
    1.41          break;
    1.42      default:
    1.43          SDL_SetError("Unsupported YUV format");
    1.44 @@ -1073,7 +1073,7 @@
    1.45      }
    1.46  
    1.47      swdata->texture = texture;
    1.48 -    swdata->target_format = SDL_PixelFormat_Unknown;
    1.49 +    swdata->target_format = SDL_PIXELFORMAT_UNKNOWN;
    1.50      swdata->pixels = (Uint8 *) SDL_malloc(texture->w * texture->h * 2);
    1.51      swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int));
    1.52      swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32));
    1.53 @@ -1101,8 +1101,8 @@
    1.54  
    1.55      /* Find the pitch and offset values for the overlay */
    1.56      switch (texture->format) {
    1.57 -    case SDL_PixelFormat_YV12:
    1.58 -    case SDL_PixelFormat_IYUV:
    1.59 +    case SDL_PIXELFORMAT_YV12:
    1.60 +    case SDL_PIXELFORMAT_IYUV:
    1.61          swdata->pitches[0] = texture->w;
    1.62          swdata->pitches[1] = swdata->pitches[0] / 2;
    1.63          swdata->pitches[2] = swdata->pitches[0] / 2;
    1.64 @@ -1112,9 +1112,9 @@
    1.65          swdata->planes[2] =
    1.66              swdata->planes[1] + swdata->pitches[1] * texture->h / 2;
    1.67          break;
    1.68 -    case SDL_PixelFormat_YUY2:
    1.69 -    case SDL_PixelFormat_UYVY:
    1.70 -    case SDL_PixelFormat_YVYU:
    1.71 +    case SDL_PIXELFORMAT_YUY2:
    1.72 +    case SDL_PIXELFORMAT_UYVY:
    1.73 +    case SDL_PIXELFORMAT_YVYU:
    1.74          swdata->pitches[0] = texture->w * 2;
    1.75          swdata->planes[0] = swdata->pixels;
    1.76          break;
    1.77 @@ -1143,8 +1143,8 @@
    1.78      SDL_Texture *texture = swdata->texture;
    1.79  
    1.80      switch (texture->format) {
    1.81 -    case SDL_PixelFormat_YV12:
    1.82 -    case SDL_PixelFormat_IYUV:
    1.83 +    case SDL_PIXELFORMAT_YV12:
    1.84 +    case SDL_PIXELFORMAT_IYUV:
    1.85          if (rect
    1.86              && (rect->x != 0 || rect->y != 0 || rect->w != texture->w
    1.87                  || rect->h != texture->h)) {
    1.88 @@ -1154,9 +1154,9 @@
    1.89          }
    1.90          SDL_memcpy(swdata->pixels, pixels, texture->h * texture->w * 2);
    1.91          break;
    1.92 -    case SDL_PixelFormat_YUY2:
    1.93 -    case SDL_PixelFormat_UYVY:
    1.94 -    case SDL_PixelFormat_YVYU:
    1.95 +    case SDL_PIXELFORMAT_YUY2:
    1.96 +    case SDL_PIXELFORMAT_UYVY:
    1.97 +    case SDL_PIXELFORMAT_YVYU:
    1.98          {
    1.99              Uint8 *src, *dst;
   1.100              int row;
   1.101 @@ -1185,8 +1185,8 @@
   1.102      SDL_Texture *texture = swdata->texture;
   1.103  
   1.104      switch (texture->format) {
   1.105 -    case SDL_PixelFormat_YV12:
   1.106 -    case SDL_PixelFormat_IYUV:
   1.107 +    case SDL_PIXELFORMAT_YV12:
   1.108 +    case SDL_PIXELFORMAT_IYUV:
   1.109          if (rect
   1.110              && (rect->x != 0 || rect->y != 0 || rect->w != texture->w
   1.111                  || rect->h != texture->h)) {
   1.112 @@ -1277,27 +1277,27 @@
   1.113          pitch = swdata->stretch->pitch;
   1.114      }
   1.115      switch (texture->format) {
   1.116 -    case SDL_PixelFormat_YV12:
   1.117 +    case SDL_PIXELFORMAT_YV12:
   1.118          lum = swdata->planes[0];
   1.119          Cr = swdata->planes[1];
   1.120          Cb = swdata->planes[2];
   1.121          break;
   1.122 -    case SDL_PixelFormat_IYUV:
   1.123 +    case SDL_PIXELFORMAT_IYUV:
   1.124          lum = swdata->planes[0];
   1.125          Cr = swdata->planes[2];
   1.126          Cb = swdata->planes[1];
   1.127          break;
   1.128 -    case SDL_PixelFormat_YUY2:
   1.129 +    case SDL_PIXELFORMAT_YUY2:
   1.130          lum = swdata->planes[0];
   1.131          Cr = lum + 3;
   1.132          Cb = lum + 1;
   1.133          break;
   1.134 -    case SDL_PixelFormat_UYVY:
   1.135 +    case SDL_PIXELFORMAT_UYVY:
   1.136          lum = swdata->planes[0] + 1;
   1.137          Cr = lum + 1;
   1.138          Cb = lum - 1;
   1.139          break;
   1.140 -    case SDL_PixelFormat_YVYU:
   1.141 +    case SDL_PIXELFORMAT_YVYU:
   1.142          lum = swdata->planes[0];
   1.143          Cr = lum + 1;
   1.144          Cb = lum + 3;