ScummVM API documentation
Graphics::YUVToRGBManager Class Reference
Inheritance diagram for Graphics::YUVToRGBManager:
Common::Singleton< YUVToRGBManager > Common::NonCopyable

Public Types

enum  LuminanceScale { kScaleFull, kScaleITU }
 

Public Member Functions

void convert444 (Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
 
void convert422 (Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
 
void convert420 (Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
 
void convert420Alpha (Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, const byte *aSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
 
void convert410 (Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
 

Additional Inherited Members

- Static Public Member Functions inherited from Common::Singleton< YUVToRGBManager >
static bool hasInstance ()
 
static YUVToRGBManager & instance ()
 
static void destroy ()
 
- Protected Types inherited from Common::Singleton< YUVToRGBManager >
typedef YUVToRGBManager SingletonBaseType
 
- Static Protected Attributes inherited from Common::Singleton< YUVToRGBManager >
static YUVToRGBManager * _singleton
 

Member Enumeration Documentation

◆ LuminanceScale

The scale of the luminance values

Enumerator
kScaleITU 

Luminance values range from [0, 255] Luminance values range from [16, 235], the range from ITU-R BT.601

Member Function Documentation

◆ convert444()

void Graphics::YUVToRGBManager::convert444 ( Graphics::Surface dst,
LuminanceScale  scale,
const byte *  ySrc,
const byte *  uSrc,
const byte *  vSrc,
int  yWidth,
int  yHeight,
int  yPitch,
int  uvPitch 
)

Convert a YUV444 image to an RGB surface

Parameters
dstthe destination surface
scalethe scale of the luminance values
ySrcthe source of the y component
uSrcthe source of the u component
vSrcthe source of the v component
yWidththe width of the y surface
yHeightthe height of the y surface
yPitchthe pitch of the y surface
uvPitchthe pitch of the u and v surfaces

◆ convert422()

void Graphics::YUVToRGBManager::convert422 ( Graphics::Surface dst,
LuminanceScale  scale,
const byte *  ySrc,
const byte *  uSrc,
const byte *  vSrc,
int  yWidth,
int  yHeight,
int  yPitch,
int  uvPitch 
)

Convert a YUV422 image to an RGB surface

Parameters
dstthe destination surface
scalethe scale of the luminance values
ySrcthe source of the y component
uSrcthe source of the u component
vSrcthe source of the v component
yWidththe width of the y surface (must be divisible by 2)
yHeightthe height of the y surface
yPitchthe pitch of the y surface
uvPitchthe pitch of the u and v surfaces

◆ convert420()

void Graphics::YUVToRGBManager::convert420 ( Graphics::Surface dst,
LuminanceScale  scale,
const byte *  ySrc,
const byte *  uSrc,
const byte *  vSrc,
int  yWidth,
int  yHeight,
int  yPitch,
int  uvPitch 
)

Convert a YUV420 image to an RGB surface

Parameters
dstthe destination surface
scalethe scale of the luminance values
ySrcthe source of the y component
uSrcthe source of the u component
vSrcthe source of the v component
yWidththe width of the y surface (must be divisible by 2)
yHeightthe height of the y surface (must be divisible by 2)
yPitchthe pitch of the y surface
uvPitchthe pitch of the u and v surfaces

◆ convert420Alpha()

void Graphics::YUVToRGBManager::convert420Alpha ( Graphics::Surface dst,
LuminanceScale  scale,
const byte *  ySrc,
const byte *  uSrc,
const byte *  vSrc,
const byte *  aSrc,
int  yWidth,
int  yHeight,
int  yPitch,
int  uvPitch 
)

Convert a YUV420 image with Alpha component to an ARGB surface

Parameters
dstthe destination surface
scalethe scale of the luminance values
ySrcthe source of the y component
uSrcthe source of the u component
vSrcthe source of the v component
aSrcthe source of the a component
yWidththe width of the y surface (must be divisible by 2)
yHeightthe height of the y surface (must be divisible by 2)
yPitchthe pitch of the y surface
uvPitchthe pitch of the u and v surfaces

◆ convert410()

void Graphics::YUVToRGBManager::convert410 ( Graphics::Surface dst,
LuminanceScale  scale,
const byte *  ySrc,
const byte *  uSrc,
const byte *  vSrc,
int  yWidth,
int  yHeight,
int  yPitch,
int  uvPitch 
)

Convert a YUV410 image to an RGB surface

Since the chroma has a very low resolution in 410, we perform bilinear scaling on the two chroma planes to produce the image. The chroma planes must have at least one extra row and one extra column that can be read from in order to produce a proper image. It is suggested that you fill these in with the previous row and column's data. This is required in order to speed up this function.

Parameters
dstthe destination surface
scalethe scale of the luminance values
ySrcthe source of the y component
uSrcthe source of the u component
vSrcthe source of the v component
yWidththe width of the y surface (must be divisible by 4)
yHeightthe height of the y surface (must be divisible by 4)
yPitchthe pitch of the y surface
uvPitchthe pitch of the u and v surfaces

The documentation for this class was generated from the following file: