aboutsummaryrefslogtreecommitdiff
path: root/graphics/surface.h
diff options
context:
space:
mode:
authorJohannes Schickel2012-10-08 14:18:33 -0700
committerJohannes Schickel2012-10-08 14:18:33 -0700
commitc2971374cdb189dbf9f72953a970d0769648e5ae (patch)
tree90734d450f4f30677f14b3a3a2ef29a28ff35d67 /graphics/surface.h
parentdbb09fe984373205453ca7989f9f4aefb245bc4f (diff)
parenta1e56adad8eb8ed4c8de5850fb2c81af9adb9585 (diff)
downloadscummvm-rg350-c2971374cdb189dbf9f72953a970d0769648e5ae.tar.gz
scummvm-rg350-c2971374cdb189dbf9f72953a970d0769648e5ae.tar.bz2
scummvm-rg350-c2971374cdb189dbf9f72953a970d0769648e5ae.zip
Merge pull request #257 from lordhoto/graphics-conversion
Extend crossBlit for abitrary (in-place) conversions and add a in-place conversion to Surface
Diffstat (limited to 'graphics/surface.h')
-rw-r--r--graphics/surface.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/graphics/surface.h b/graphics/surface.h
index 9c8c040cbf..6c9e464657 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.
*