ScummVM API documentation
yuv_to_rgb.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
37 #ifndef GRAPHICS_YUV_TO_RGB_H
38 #define GRAPHICS_YUV_TO_RGB_H
39 
40 #include "common/scummsys.h"
41 #include "common/singleton.h"
42 #include "graphics/surface.h"
43 
44 namespace Graphics {
45 
46 class YUVToRGBLookup;
47 
48 class YUVToRGBManager : public Common::Singleton<YUVToRGBManager> {
49 public:
52  kScaleFull,
54  };
55 
69  void convert444(Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch);
70 
84  void convert422(Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch);
85 
99  void convert420(Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch);
100 
115  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);
116 
136  void convert410(Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch);
137 
138 private:
139  friend class Common::Singleton<SingletonBaseType>;
140  YUVToRGBManager();
141  ~YUVToRGBManager();
142 
143  const YUVToRGBLookup *getLookup(Graphics::PixelFormat format, LuminanceScale scale);
144 
145  YUVToRGBLookup *_lookup;
146 };
148 } // End of namespace Graphics
149 
150 #define YUVToRGBMan (::Graphics::YUVToRGBManager::instance())
151 
152 #endif
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)
Definition: surface.h:66
void convert444(Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
LuminanceScale
Definition: yuv_to_rgb.h:51
void convert420(Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
Definition: pixelformat.h:138
void convert422(Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
Definition: yuv_to_rgb.h:48
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: formatinfo.h:28
Definition: yuv_to_rgb.h:53
void convert410(Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch)
Definition: singleton.h:42