Mercurial > hg > orthanc
changeset 2101:0b6464320aac
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 10 Oct 2016 15:56:07 +0200 |
parents | 1554fc153a93 (diff) bcbc9137a535 (current diff) |
children | f0544ab9396b |
files | |
diffstat | 1 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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<const uint8_t*>(source.GetConstRow(y)); + uint8_t* q = reinterpret_cast<uint8_t*>(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); }