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.

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
@ SDL_PIXELFORMAT_YVYU
Definition: SDL_pixels.h:285
@ SDL_PIXELFORMAT_UYVY
Definition: SDL_pixels.h:283
@ SDL_PIXELFORMAT_YV12
Definition: SDL_pixels.h:277
@ SDL_PIXELFORMAT_YUY2
Definition: SDL_pixels.h:281
@ SDL_PIXELFORMAT_NV12
Definition: SDL_pixels.h:287
@ SDL_PIXELFORMAT_NV21
Definition: SDL_pixels.h:289
@ SDL_PIXELFORMAT_IYUV
Definition: SDL_pixels.h:279

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().

◆ 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.

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}
GLenum mode
GLenum src
GLfloat GLfloat GLfloat GLfloat h
GLubyte GLubyte GLubyte GLubyte w
@ SDL_TRUE
Definition: SDL_stdinc.h:164
@ SDL_FALSE
Definition: SDL_stdinc.h:163
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
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

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().