Go to the documentation of this file.
21 #include "../SDL_internal.h"
60 const int sz_plane =
w *
h;
61 const int sz_plane_chroma = ((
w + 1) / 2) * ((
h + 1) / 2);
62 const int sz_plane_packed = ((
w + 1) / 2) *
h;
68 dst_size = sz_plane + sz_plane_chroma + sz_plane_chroma;
74 dst_size = 4 * sz_plane_packed;
79 dst_size = sz_plane + sz_plane_chroma + sz_plane_chroma;
83 SDL_assert(0 &&
"We should never get here (caught above)");
108 swdata->
pitches[0] = ((
w + 1) / 2) * 4;
121 SDL_assert(0 &&
"We should never get here (caught above)");
140 const void *
pixels,
int pitch)
148 (swdata->
h * swdata->
w) + 2* ((swdata->
h + 1) /2) * ((swdata->
w + 1) / 2));
171 src += (pitch + 1)/2;
172 dst += (swdata->
w + 1)/2;
178 ((swdata->
h + 1)/2) * ((swdata->
w+1) / 2);
183 src += (pitch + 1)/2;
184 dst += (swdata->
w + 1)/2;
213 (swdata->
h * swdata->
w) + 2* ((swdata->
h + 1) /2) * ((swdata->
w + 1) / 2));
233 dst += 2 * ((
rect->
y + 1)/2) * ((swdata->
w + 1) / 2) + 2 * (
rect->
x/2);
237 src += 2 * ((pitch + 1)/2);
238 dst += 2 * ((swdata->
w + 1)/2);
248 const Uint8 *Yplane,
int Ypitch,
249 const Uint8 *Uplane,
int Upitch,
250 const Uint8 *Vplane,
int Vpitch)
273 ((swdata->
h + 1) / 2) * ((swdata->
w + 1) / 2);
280 dst += (swdata->
w + 1)/2;
289 ((swdata->
h + 1) / 2) * ((swdata->
w + 1) / 2);
296 dst += (swdata->
w + 1)/2;
303 void **
pixels,
int *pitch)
312 ||
rect->
h != swdata->
h)) {
314 (
"YV12, IYUV, NV12, NV21 textures only support full surface locks");
347 if (srcrect->
x || srcrect->
y || srcrect->
w < swdata->
w || srcrect->
h < swdata->
h) {
354 }
else if ((srcrect->
w !=
w) || (srcrect->
h !=
h)) {
359 Uint32 Rmask, Gmask, Bmask, Amask;
372 Gmask, Bmask, Amask);
383 Gmask, Bmask, Amask);
393 target_format,
pixels, pitch) < 0) {
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, void **pixels, int *pitch)
GLfloat GLfloat GLfloat GLfloat h
GLuint GLsizei GLsizei * length
int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture *swdata, const SDL_Rect *srcrect, Uint32 target_format, int w, int h, void *pixels, int pitch)
#define SDL_CreateRGBSurfaceFrom
void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture *swdata)
#define SDL_PixelFormatEnumToMasks
void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture *swdata)
int SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch)
#define SDL_assert(condition)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
#define SDL_OutOfMemory()
#define SDL_CreateRGBSurface
SDL_SW_YUVTexture * SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
A rectangle, with the origin at the upper left (integer).
int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture *swdata, void **pixels, int *pitch)
@ SDL_PIXELFORMAT_UNKNOWN
#define SDL_ConvertPixels
int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const void *pixels, int pitch)
GLubyte GLubyte GLubyte GLubyte w