21 #include "../SDL_internal.h"
61 const int sz_plane =
w *
h;
62 const int sz_plane_chroma = ((
w + 1) / 2) * ((
h + 1) / 2);
63 const int sz_plane_packed = ((
w + 1) / 2) *
h;
69 dst_size = sz_plane + sz_plane_chroma + sz_plane_chroma;
75 dst_size = 4 * sz_plane_packed;
80 dst_size = sz_plane + sz_plane_chroma + sz_plane_chroma;
84 SDL_assert(0 &&
"We should never get here (caught above)");
109 swdata->
pitches[0] = ((
w + 1) / 2) * 4;
122 SDL_assert(0 &&
"We should never get here (caught above)");
141 const void *
pixels,
int pitch)
149 (swdata->
h * swdata->
w) + 2* ((swdata->
h + 1) /2) * ((swdata->
w + 1) / 2));
172 src += (pitch + 1)/2;
173 dst += (swdata->
w + 1)/2;
179 ((swdata->
h + 1)/2) * ((swdata->
w+1) / 2);
184 src += (pitch + 1)/2;
185 dst += (swdata->
w + 1)/2;
214 (swdata->
h * swdata->
w) + 2* ((swdata->
h + 1) /2) * ((swdata->
w + 1) / 2));
234 dst += 2 * ((
rect->
y + 1)/2) * ((swdata->
w + 1) / 2) + 2 * (
rect->
x/2);
238 src += 2 * ((pitch + 1)/2);
239 dst += 2 * ((swdata->
w + 1)/2);
249 const Uint8 *Yplane,
int Ypitch,
250 const Uint8 *Uplane,
int Upitch,
251 const Uint8 *Vplane,
int Vpitch)
274 ((swdata->
h + 1) / 2) * ((swdata->
w + 1) / 2);
281 dst += (swdata->
w + 1)/2;
290 ((swdata->
h + 1) / 2) * ((swdata->
w + 1) / 2);
297 dst += (swdata->
w + 1)/2;
304 void **
pixels,
int *pitch)
313 ||
rect->
h != swdata->
h)) {
315 (
"YV12, IYUV, NV12, NV21 textures only support full surface locks");
348 if (srcrect->
x || srcrect->
y || srcrect->
w < swdata->
w || srcrect->
h < swdata->
h) {
355 }
else if ((srcrect->
w !=
w) || (srcrect->
h !=
h)) {
360 Uint32 Rmask, Gmask, Bmask, Amask;
373 Gmask, Bmask, Amask);
384 Gmask, Bmask, Amask);
394 target_format,
pixels, pitch) < 0) {
#define SDL_assert(condition)
#define SDL_PixelFormatEnumToMasks
#define SDL_CreateRGBSurfaceFrom
#define SDL_CreateRGBSurface
#define SDL_ConvertPixels
#define SDL_OutOfMemory()
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLuint GLsizei GLsizei * length
GLfloat GLfloat GLfloat GLfloat h
GLubyte GLubyte GLubyte GLubyte w
@ SDL_PIXELFORMAT_UNKNOWN
void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture *swdata)
SDL_SW_YUVTexture * SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture *swdata, const SDL_Rect *srcrect, Uint32 target_format, int w, int h, void *pixels, int pitch)
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)
int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const void *pixels, int pitch)
int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, void **pixels, int *pitch)
int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture *swdata, void **pixels, int *pitch)
void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture *swdata)
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
A rectangle, with the origin at the upper left (integer).