diff options
author | Bastien Bouclet | 2019-01-22 15:02:05 +0100 |
---|---|---|
committer | Bastien Bouclet | 2019-04-28 07:59:14 +0200 |
commit | 0d5d04ca3a5473f24f45112bb40a009679024acc (patch) | |
tree | db509988aed8e0ef0f51052ca5154f771de8edb9 /image/jpeg.h | |
parent | 5196ae1cd49b879f0497c5ad863dfa6dfebe61c7 (diff) | |
download | scummvm-rg350-0d5d04ca3a5473f24f45112bb40a009679024acc.tar.gz scummvm-rg350-0d5d04ca3a5473f24f45112bb40a009679024acc.tar.bz2 scummvm-rg350-0d5d04ca3a5473f24f45112bb40a009679024acc.zip |
IMAGE: Allow setting the output pixel format to the JPEG decoder
Diffstat (limited to 'image/jpeg.h')
-rw-r--r-- | image/jpeg.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/image/jpeg.h b/image/jpeg.h index ac0d22d129..08b5c01dc4 100644 --- a/image/jpeg.h +++ b/image/jpeg.h @@ -60,11 +60,11 @@ public: // Special API for JPEG enum ColorSpace { /** - * Output 32bit RGBA data. + * Output RGB data in the pixel format specified using `setOutputPixelFormat`. * * This is the default output. */ - kColorSpaceRGBA, + kColorSpaceRGB, /** * Output (interleaved) YUV data. @@ -86,15 +86,25 @@ public: * Request the output color space. This can be used to obtain raw YUV * data from the JPEG file. But this might not work for all files! * - * The decoder itself defaults to RGBA. + * The decoder itself defaults to RGB. * * @param outSpace The color space to output. */ void setOutputColorSpace(ColorSpace outSpace) { _colorSpace = outSpace; } + /** + * Request the output pixel format. The JPEG decoder provides high performance + * color conversion routines for some pixel formats. This setting allows to use + * them and avoid costly subsequent color conversion. + */ + void setOutputPixelFormat(const Graphics::PixelFormat &format) { _requestedPixelFormat = format; } + private: Graphics::Surface _surface; ColorSpace _colorSpace; + Graphics::PixelFormat _requestedPixelFormat; + + Graphics::PixelFormat getByteOrderRgbPixelFormat() const; }; } // End of namespace Image |