Go to the documentation of this file.
21 #include "../SDL_internal.h"
62 const int sz_plane =
w *
h;
63 const int sz_plane_chroma = ((
w + 1) / 2) * ((
h + 1) / 2);
64 const int sz_plane_packed = ((
w + 1) / 2) *
h;
70 dst_size = sz_plane + sz_plane_chroma + sz_plane_chroma;
76 dst_size = 4 * sz_plane_packed;
81 dst_size = sz_plane + sz_plane_chroma + sz_plane_chroma;
85 SDL_assert(0 &&
"We should never get here (caught above)");
110 swdata->
pitches[0] = ((
w + 1) / 2) * 4;
123 SDL_assert(0 &&
"We should never get here (caught above)");
142 const void *
pixels,
int pitch)
150 (swdata->
h * swdata->
w) + 2* ((swdata->
h + 1) /2) * ((swdata->
w + 1) / 2));
173 src += (pitch + 1)/2;
174 dst += (swdata->
w + 1)/2;
180 ((swdata->
h + 1)/2) * ((swdata->
w+1) / 2);
185 src += (pitch + 1)/2;
186 dst += (swdata->
w + 1)/2;
215 (swdata->
h * swdata->
w) + 2* ((swdata->
h + 1) /2) * ((swdata->
w + 1) / 2));
235 dst += 2 * ((
rect->
y + 1)/2) * ((swdata->
w + 1) / 2) + 2 * (
rect->
x/2);
239 src += 2 * ((pitch + 1)/2);
240 dst += 2 * ((swdata->
w + 1)/2);
250 const Uint8 *Yplane,
int Ypitch,
251 const Uint8 *Uplane,
int Upitch,
252 const Uint8 *Vplane,
int Vpitch)
275 ((swdata->
h + 1) / 2) * ((swdata->
w + 1) / 2);
282 dst += (swdata->
w + 1)/2;
291 ((swdata->
h + 1) / 2) * ((swdata->
w + 1) / 2);
298 dst += (swdata->
w + 1)/2;
305 void **
pixels,
int *pitch)
314 ||
rect->
h != swdata->
h)) {
316 (
"YV12, IYUV, NV12, NV21 textures only support full surface locks");
349 if (srcrect->
x || srcrect->
y || srcrect->
w < swdata->
w || srcrect->
h < swdata->
h) {
356 }
else if ((srcrect->
w !=
w) || (srcrect->
h !=
h)) {
361 Uint32 Rmask, Gmask, Bmask, Amask;
374 Gmask, Bmask, Amask);
385 Gmask, Bmask, Amask);
395 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()
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp
#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