SDL  2.0
testyuv_cvt.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

SDL_bool ConvertRGBtoYUV (Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, SDL_YUV_CONVERSION_MODE mode, int monochrome, int luminance)
 
int CalculateYUVPitch (Uint32 format, int width)
 

Function Documentation

◆ CalculateYUVPitch()

int CalculateYUVPitch ( Uint32  format,
int  width 
)

Definition at line 282 of file testyuv_cvt.c.

References SDL_PIXELFORMAT_IYUV, SDL_PIXELFORMAT_NV12, SDL_PIXELFORMAT_NV21, SDL_PIXELFORMAT_UYVY, SDL_PIXELFORMAT_YUY2, SDL_PIXELFORMAT_YV12, and SDL_PIXELFORMAT_YVYU.

Referenced by main(), and run_automated_tests().

283 {
284  switch (format)
285  {
290  return width;
294  return 4*((width + 1)/2);
295  default:
296  return 0;
297  }
298 }
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572

◆ ConvertRGBtoYUV()

SDL_bool ConvertRGBtoYUV ( Uint32  format,
Uint8 src,
int  pitch,
Uint8 out,
int  w,
int  h,
SDL_YUV_CONVERSION_MODE  mode,
int  monochrome,
int  luminance 
)

Definition at line 262 of file testyuv_cvt.c.

References ConvertRGBtoPacked4(), ConvertRGBtoPlanar2x2(), SDL_FALSE, SDL_PIXELFORMAT_IYUV, SDL_PIXELFORMAT_NV12, SDL_PIXELFORMAT_NV21, SDL_PIXELFORMAT_UYVY, SDL_PIXELFORMAT_YUY2, SDL_PIXELFORMAT_YV12, SDL_PIXELFORMAT_YVYU, and SDL_TRUE.

Referenced by main(), and run_automated_tests().

263 {
264  switch (format)
265  {
270  ConvertRGBtoPlanar2x2(format, src, pitch, out, w, h, mode, monochrome, luminance);
271  return SDL_TRUE;
275  ConvertRGBtoPacked4(format, src, pitch, out, w, h, mode, monochrome, luminance);
276  return SDL_TRUE;
277  default:
278  return SDL_FALSE;
279  }
280 }
static void ConvertRGBtoPacked4(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, SDL_YUV_CONVERSION_MODE mode, int monochrome, int luminance)
Definition: testyuv_cvt.c:192
GLfloat GLfloat GLfloat GLfloat h
GLenum src
static void ConvertRGBtoPlanar2x2(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, SDL_YUV_CONVERSION_MODE mode, int monochrome, int luminance)
Definition: testyuv_cvt.c:76
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572
GLenum mode
GLubyte GLubyte GLubyte GLubyte w