comparison include/SDL_video.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 eef792d31de8
children e136f3ffdc1b
comparison
equal deleted inserted replaced
1674:7688a73b25b1 1675:d33dcfc3fde7
271 271
272 /* typedef for private surface blitting functions */ 272 /* typedef for private surface blitting functions */
273 typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, 273 typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
274 struct SDL_Surface * dst, SDL_Rect * dstrect); 274 struct SDL_Surface * dst, SDL_Rect * dstrect);
275 275
276
277 /* The most common video overlay formats.
278 For an explanation of these pixel formats, see:
279 http://www.webartz.com/fourcc/indexyuv.htm
280
281 For information on the relationship between color spaces, see:
282 http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
283 */
284 #define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */
285 #define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */
286 #define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
287 #define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
288 #define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
289
290 /* The YUV hardware video overlay */
291 typedef struct SDL_Overlay
292 {
293 Uint32 format; /* Read-only */
294 int w, h; /* Read-only */
295 int planes; /* Read-only */
296 Uint16 *pitches; /* Read-only */
297 Uint8 **pixels; /* Read-write */
298
299 /* Hardware-specific surface info */
300 struct private_yuvhwfuncs *hwfuncs;
301 struct private_yuvhwdata *hwdata;
302
303 /* Special flags */
304 Uint32 hw_overlay:1; /* Flag: This overlay hardware accelerated? */
305 Uint32 UnusedBits:31;
306 } SDL_Overlay;
307 276
308 /** 277 /**
309 * \enum SDL_GLattr 278 * \enum SDL_GLattr
310 * 279 *
311 * \brief OpenGL configuration attributes 280 * \brief OpenGL configuration attributes
1339 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, 1308 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
1340 SDL_Rect * srcrect, 1309 SDL_Rect * srcrect,
1341 SDL_Surface * dst, 1310 SDL_Surface * dst,
1342 SDL_Rect * dstrect); 1311 SDL_Rect * dstrect);
1343 1312
1344
1345 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1346 /* YUV video surface overlay functions */
1347 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1348
1349 /* This function creates a video output overlay
1350 Calling the returned surface an overlay is something of a misnomer because
1351 the contents of the display surface underneath the area where the overlay
1352 is shown is undefined - it may be overwritten with the converted YUV data.
1353 */
1354 extern DECLSPEC SDL_Overlay *SDLCALL SDL_CreateYUVOverlay(int width,
1355 int height,
1356 Uint32 format,
1357 SDL_Surface *
1358 display);
1359
1360 /* Lock an overlay for direct access, and unlock it when you are done */
1361 extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay * overlay);
1362 extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay * overlay);
1363
1364 /* Blit a video overlay to the display surface.
1365 The contents of the video surface underneath the blit destination are
1366 not defined.
1367 The width and height of the destination rectangle may be different from
1368 that of the overlay, but currently only 2x scaling is supported.
1369 */
1370 extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay * overlay,
1371 SDL_Rect * dstrect);
1372
1373 /* Free a video overlay */
1374 extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
1375
1376
1377 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1313 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1378 /* OpenGL support functions. */ 1314 /* OpenGL support functions. */
1379 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1315 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1380 1316
1381 /* 1317 /*