diff options
author | Johannes Schickel | 2012-07-14 06:03:04 +0200 |
---|---|---|
committer | Johannes Schickel | 2012-08-28 02:27:48 +0200 |
commit | eeb39592599815875a736fdbef67204c2036e935 (patch) | |
tree | f78e6f63fed5c0b567985a8a92a271de6089b814 /graphics/surface.h | |
parent | e8cf0adf95217d4eedec526df960a8cdd46cc28f (diff) | |
download | scummvm-rg350-eeb39592599815875a736fdbef67204c2036e935.tar.gz scummvm-rg350-eeb39592599815875a736fdbef67204c2036e935.tar.bz2 scummvm-rg350-eeb39592599815875a736fdbef67204c2036e935.zip |
GRAPHICS: Add an in-place Surface PixelFormat conversion.
Diffstat (limited to 'graphics/surface.h')
-rw-r--r-- | graphics/surface.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/graphics/surface.h b/graphics/surface.h index eb8d1ac42e..eaf62f84eb 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -137,6 +137,20 @@ struct Surface { /** * Convert the data to another pixel format. * + * This works in-place. This means it will not create an additional buffer + * for the conversion process. The value of pixels might change though. + * + * Note that you should only use this, when you created the Surface data via + * create! Otherwise this function has undefined behavior. + * + * @param dstFormat The desired format + * @param palette The palette (in RGB888), if the source format has a Bpp of 1 + */ + void convertToInPlace(const PixelFormat &dstFormat, const byte *palette = 0); + + /** + * Convert the data to another pixel format. + * * The calling code must call free on the returned surface and then delete * it. * |