diff include/SDL_pixels.h @ 1675:d33dcfc3fde7 SDL-1.3

Overlay functions are being replaced by YUV textures. If the driver doesn't support YUV textures, they can be emulated by backing the texture with an RGB texture and using the software conversion routines. Note that it doesn't make sense to lock a portion of a YV12 texture, since you'd need to return three pixel pointers and pitch values instead of the one that's available through the API. I'm guessing that's one of the reasons DirectX 9 doesn't support this format at all.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 11 Jun 2006 07:30:16 +0000
parents 4da1ee79c9af
children e136f3ffdc1b
line wrap: on
line diff
--- a/include/SDL_pixels.h	Sun Jun 11 05:27:10 2006 +0000
+++ b/include/SDL_pixels.h	Sun Jun 11 07:30:16 2006 +0000
@@ -95,6 +95,9 @@
     SDL_PackedLayout_1010102,
 };
 
+#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) \
+    ((A) | ((B) << 8) | ((C) << 16) | ((D) << 24))
+
 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
     ((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
      ((bits) << 8) | ((bytes) << 0))
@@ -167,6 +170,12 @@
     SDL_PixelFormat_ARGB2101010 =
         SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_ARGB,
                                SDL_PackedLayout_2101010, 32, 4),
+
+    SDL_PixelFormat_YV12 = SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
+    SDL_PixelFormat_IYUV = SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
+    SDL_PixelFormat_YUY2 = SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
+    SDL_PixelFormat_UYVY = SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
+    SDL_PixelFormat_YVYU = SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
 };
 
 typedef struct SDL_Color