From b6d2a11432c16b12fea48830f7aa131dba091ef7 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sat, 2 Jul 2011 23:43:52 -0400 Subject: GRAPHICS: Make the JPEG code use the new YUV to RGB converter --- graphics/decoders/jpeg.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'graphics/decoders/jpeg.cpp') diff --git a/graphics/decoders/jpeg.cpp b/graphics/decoders/jpeg.cpp index 0cd2388d52..a871377ca1 100644 --- a/graphics/decoders/jpeg.cpp +++ b/graphics/decoders/jpeg.cpp @@ -20,8 +20,8 @@ * */ -#include "graphics/conversion.h" #include "graphics/pixelformat.h" +#include "graphics/yuv_to_rgb.h" #include "graphics/decoders/jpeg.h" #include "common/debug.h" @@ -81,13 +81,7 @@ const Surface *JPEGDecoder::getSurface() const { const Graphics::Surface *uComponent = getComponent(2); const Graphics::Surface *vComponent = getComponent(3); - for (uint16 i = 0; i < _h; i++) { - for (uint16 j = 0; j < _w; j++) { - byte r = 0, g = 0, b = 0; - YUV2RGB(*((const byte *)yComponent->getBasePtr(j, i)), *((const byte *)uComponent->getBasePtr(j, i)), *((const byte *)vComponent->getBasePtr(j, i)), r, g, b); - *((uint32 *)_rgbSurface->getBasePtr(j, i)) = _rgbSurface->format.RGBToColor(r, g, b); - } - } + convertYUV444ToRGB(_rgbSurface, (byte *)yComponent->pixels, (byte *)uComponent->pixels, (byte *)vComponent->pixels, yComponent->w, yComponent->h, yComponent->pitch, uComponent->pitch); return _rgbSurface; } -- cgit v1.2.3