# HG changeset patch # User Sebastien Jodogne # Date 1484914470 -3600 # Node ID 002b94046c695f748f37a5c9c73858b0ccd2bae0 # Parent d623bff7edab5ffa12d12e5b12a8e1c1d3613a0c colorspace conversion from BGRA32 to RGB24 diff -r d623bff7edab -r 002b94046c69 Core/Images/ImageProcessing.cpp --- a/Core/Images/ImageProcessing.cpp Fri Jan 20 10:43:50 2017 +0100 +++ b/Core/Images/ImageProcessing.cpp Fri Jan 20 13:14:30 2017 +0100 @@ -458,6 +458,26 @@ return; } + if (target.GetFormat() == PixelFormat_RGB24 && + source.GetFormat() == PixelFormat_BGRA32) + { + for (unsigned int y = 0; y < source.GetHeight(); y++) + { + const uint8_t* p = reinterpret_cast(source.GetConstRow(y)); + uint8_t* q = reinterpret_cast(target.GetRow(y)); + for (unsigned int x = 0; x < source.GetWidth(); x++) + { + q[0] = p[2]; + q[1] = p[1]; + q[2] = p[0]; + p += 4; + q += 3; + } + } + + return; + } + if (target.GetFormat() == PixelFormat_RGBA32 && source.GetFormat() == PixelFormat_RGB24) {