GRAPHICS: Add convertToInPlace method to ManagedSurface

This commit is contained in:
Paul Gilbert 2018-11-23 15:34:34 -08:00 committed by Paul Gilbert
parent 0b1e695f24
commit 3e8ed4eafc

View file

@ -368,9 +368,22 @@ public:
addDirtyRect(area);
return _innerSurface.getSubArea(area);
}
/**
* 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
* (that means it might realloc the pixel data).
*
* @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) {
_innerSurface.convertToInPlace(dstFormat, palette);
}
};
} // End of namespace Graphics
#endif