xoreos  0.0.5
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Graphics::YUVToRGBManager Class Reference

#include <yuv_to_rgb.h>

Inheritance diagram for Graphics::YUVToRGBManager:
Inheritance graph
[legend]
Collaboration diagram for Graphics::YUVToRGBManager:
Collaboration graph
[legend]

Public Types

enum  LuminanceScale { kScaleFull, kScaleITU }
 The scale of the luminance values. More...
 

Public Member Functions

void convert420 (LuminanceScale scale, byte *dst, int dstPitch, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
 Convert a YUV420 image to an RGBA surface. More...
 
void convert420 (LuminanceScale scale, byte *dst, int dstPitch, const byte *ySrc, const byte *uSrc, const byte *vSrc, const byte *aSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
 Convert a YUV420 image to an RGBA surface. More...
 

Private Member Functions

 YUVToRGBManager ()
 
 ~YUVToRGBManager ()
 
const YUVToRGBLookupgetLookup (LuminanceScale scale)
 

Private Attributes

Common::ScopedPtr< YUVToRGBLookup_lookup
 
int16 _colorTab [4 *256]
 

Friends

class Common::Singleton< SingletonBaseType >
 

Additional Inherited Members

- Static Public Member Functions inherited from Common::Singleton< YUVToRGBManager >
static YUVToRGBManager & instance ()
 
static void destroy ()
 
- Protected Types inherited from Common::Singleton< YUVToRGBManager >
typedef YUVToRGBManager SingletonBaseType
 
- Protected Member Functions inherited from Common::Singleton< YUVToRGBManager >
 Singleton ()
 
virtual ~Singleton ()
 

Detailed Description

Definition at line 37 of file yuv_to_rgb.h.

Member Enumeration Documentation

◆ LuminanceScale

The scale of the luminance values.

Enumerator
kScaleFull 
kScaleITU 

Luminance values range from [0, 255].

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

Definition at line 40 of file yuv_to_rgb.h.

Constructor & Destructor Documentation

◆ YUVToRGBManager()

Graphics::YUVToRGBManager::YUVToRGBManager ( )
private

Definition at line 161 of file yuv_to_rgb.cpp.

References _colorTab.

◆ ~YUVToRGBManager()

Graphics::YUVToRGBManager::~YUVToRGBManager ( )
private

Definition at line 181 of file yuv_to_rgb.cpp.

Member Function Documentation

◆ convert420() [1/2]

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

Convert a YUV420 image to an RGBA surface.

Parameters
scalethe scale of the luminance values
dstthe destination surface
dstPitchthe pitch of the destination surface
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

Definition at line 238 of file yuv_to_rgb.cpp.

References _colorTab, Graphics::YUVToRGBLookup::getRGBToPix(), PUT_PIXEL, and YUVToRGBMan.

Here is the call graph for this function:

◆ convert420() [2/2]

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

Convert a YUV420 image to an RGBA surface.

Parameters
scalethe scale of the luminance values
dstthe destination surface
dstPitchthe pitch of the destination surface
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 and a surfaces
uvPitchthe pitch of the u and v surfaces

Definition at line 199 of file yuv_to_rgb.cpp.

References _colorTab, Graphics::YUVToRGBLookup::getRGBToPix(), PUT_PIXEL, and YUVToRGBMan.

Here is the call graph for this function:

◆ getLookup()

const YUVToRGBLookup * Graphics::YUVToRGBManager::getLookup ( LuminanceScale  scale)
private

Definition at line 184 of file yuv_to_rgb.cpp.

References _lookup.

Friends And Related Function Documentation

◆ Common::Singleton< SingletonBaseType >

friend class Common::Singleton< SingletonBaseType >
friend

Definition at line 79 of file yuv_to_rgb.h.

Member Data Documentation

◆ _colorTab

int16 Graphics::YUVToRGBManager::_colorTab[4 *256]
private

Definition at line 86 of file yuv_to_rgb.h.

Referenced by convert420(), and YUVToRGBManager().

◆ _lookup

Common::ScopedPtr<YUVToRGBLookup> Graphics::YUVToRGBManager::_lookup
private

Definition at line 85 of file yuv_to_rgb.h.

Referenced by getLookup().


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