diff options
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 |