# HG changeset patch # User Sebastien Jodogne # Date 1476107767 -7200 # Node ID 0b6464320aac9a10db22a74e33b8b828c8fa7a9d # Parent 1554fc153a93d930ed600ae51aca9224c48f94ef# Parent bcbc9137a535954572d3e4b0b79337ca8ccddd72 merge diff -r bcbc9137a535 -r 0b6464320aac Core/Images/ImageProcessing.cpp --- a/Core/Images/ImageProcessing.cpp Fri Oct 07 11:13:41 2016 +0200 +++ b/Core/Images/ImageProcessing.cpp Mon Oct 10 15:56:07 2016 +0200 @@ -519,6 +519,27 @@ return; } + if (target.GetFormat() == PixelFormat_BGRA32 && + source.GetFormat() == PixelFormat_RGB24) + { + 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]; + q[3] = 255; + p += 3; + q += 4; + } + } + + return; + } + throw OrthancException(ErrorCode_NotImplemented); }