mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 16:03:24 +00:00
GRAPHICS: Add some docs and sanity checks to the YUV to RGB code
This commit is contained in:
parent
f8323cc672
commit
affb6a38a1
@ -203,6 +203,13 @@ namespace Graphics {
|
||||
*((uint32 *)(d)) = (L[cr_r] | L[crb_g] | L[cb_b])
|
||||
|
||||
void convertYUV420ToRGB(Graphics::Surface *dst, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch) {
|
||||
// Sanity checks
|
||||
assert(dst && dst->pixels);
|
||||
assert(dst->format.bytesPerPixel == 2 || dst->format.bytesPerPixel == 4);
|
||||
assert(ySrc && uSrc && vSrc);
|
||||
assert((yWidth & 1) == 0);
|
||||
assert((yHeight & 1) == 0);
|
||||
|
||||
const YUVToRGBLookup *lookup = YUVToRGBMan.getLookup(dst->format);
|
||||
|
||||
byte *dstPtr = (byte *)dst->pixels;
|
||||
|
@ -23,6 +23,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* YUV to RGB conversion used in engines:
|
||||
* - sword25
|
||||
*/
|
||||
|
||||
#ifndef GRAPHICS_YUV_TO_RGB_H
|
||||
#define GRAPHICS_YUV_TO_RGB_H
|
||||
|
||||
@ -33,6 +39,18 @@ namespace Graphics {
|
||||
|
||||
struct Surface;
|
||||
|
||||
/**
|
||||
* Convert a YUV420 image to an RGB surface
|
||||
*
|
||||
* @param dst the destination surface
|
||||
* @param ySrc the source of the y component
|
||||
* @param uSrc the source of the u component
|
||||
* @param vSrc the source of the v component
|
||||
* @param yWidth the width of the y surface (must be divisible by 2)
|
||||
* @param yHeight the height of the y surface (must be divisible by 2)
|
||||
* @param yPitch the pitch of the y surface
|
||||
* @param uvPitch the pitch of the u and v surfaces
|
||||
*/
|
||||
void convertYUV420ToRGB(Graphics::Surface *dst, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch);
|
||||
|
||||
} // End of namespace Graphics
|
||||
|
Loading…
x
Reference in New Issue
Block a user