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

{
switch (format)
{
case SDL_PIXELFORMAT_YV12:
case SDL_PIXELFORMAT_IYUV:
case SDL_PIXELFORMAT_NV12:
case SDL_PIXELFORMAT_NV21:
return width;
case SDL_PIXELFORMAT_YUY2:
case SDL_PIXELFORMAT_UYVY:
case SDL_PIXELFORMAT_YVYU:
return 4*((width + 1)/2);
default:
return 0;
}
}
SDL_PIXELFORMAT_NV21
Definition: SDL_pixels.h:289
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
SDL_PIXELFORMAT_YVYU
Definition: SDL_pixels.h:285
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572
SDL_PIXELFORMAT_NV12
Definition: SDL_pixels.h:287
SDL_PIXELFORMAT_YV12
Definition: SDL_pixels.h:277
SDL_PIXELFORMAT_IYUV
Definition: SDL_pixels.h:279
SDL_PIXELFORMAT_UYVY
Definition: SDL_pixels.h:283
SDL_PIXELFORMAT_YUY2
Definition: SDL_pixels.h:281

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

{
switch (format)
{
case SDL_PIXELFORMAT_YV12:
case SDL_PIXELFORMAT_IYUV:
case SDL_PIXELFORMAT_NV12:
case SDL_PIXELFORMAT_NV21:
ConvertRGBtoPlanar2x2(format, src, pitch, out, w, h, mode, monochrome, luminance);
return SDL_TRUE;
case SDL_PIXELFORMAT_YUY2:
case SDL_PIXELFORMAT_UYVY:
case SDL_PIXELFORMAT_YVYU:
ConvertRGBtoPacked4(format, src, pitch, out, w, h, mode, monochrome, luminance);
return SDL_TRUE;
default:
return SDL_FALSE;
}
}
ConvertRGBtoPacked4
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
SDL_TRUE
Definition: SDL_stdinc.h:142
SDL_FALSE
Definition: SDL_stdinc.h:141
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1946
SDL_PIXELFORMAT_NV21
Definition: SDL_pixels.h:289
src
GLenum src
Definition: SDL_opengl_glext.h:1737
ConvertRGBtoPlanar2x2
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
SDL_PIXELFORMAT_YVYU
Definition: SDL_pixels.h:285
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572
SDL_PIXELFORMAT_NV12
Definition: SDL_pixels.h:287
mode
GLenum mode
Definition: SDL_opengl_glext.h:1122
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
SDL_PIXELFORMAT_YV12
Definition: SDL_pixels.h:277
SDL_PIXELFORMAT_IYUV
Definition: SDL_pixels.h:279
SDL_PIXELFORMAT_UYVY
Definition: SDL_pixels.h:283
SDL_PIXELFORMAT_YUY2
Definition: SDL_pixels.h:281