Mercurial > hg > orthanc
comparison Core/Images/ImageProcessing.cpp @ 2252:002b94046c69
colorspace conversion from BGRA32 to RGB24
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 20 Jan 2017 13:14:30 +0100 |
parents | a3a65de1840f |
children | e002430baa41 |
comparison
equal
deleted
inserted
replaced
2251:d623bff7edab | 2252:002b94046c69 |
---|---|
456 } | 456 } |
457 | 457 |
458 return; | 458 return; |
459 } | 459 } |
460 | 460 |
461 if (target.GetFormat() == PixelFormat_RGB24 && | |
462 source.GetFormat() == PixelFormat_BGRA32) | |
463 { | |
464 for (unsigned int y = 0; y < source.GetHeight(); y++) | |
465 { | |
466 const uint8_t* p = reinterpret_cast<const uint8_t*>(source.GetConstRow(y)); | |
467 uint8_t* q = reinterpret_cast<uint8_t*>(target.GetRow(y)); | |
468 for (unsigned int x = 0; x < source.GetWidth(); x++) | |
469 { | |
470 q[0] = p[2]; | |
471 q[1] = p[1]; | |
472 q[2] = p[0]; | |
473 p += 4; | |
474 q += 3; | |
475 } | |
476 } | |
477 | |
478 return; | |
479 } | |
480 | |
461 if (target.GetFormat() == PixelFormat_RGBA32 && | 481 if (target.GetFormat() == PixelFormat_RGBA32 && |
462 source.GetFormat() == PixelFormat_RGB24) | 482 source.GetFormat() == PixelFormat_RGB24) |
463 { | 483 { |
464 for (unsigned int y = 0; y < source.GetHeight(); y++) | 484 for (unsigned int y = 0; y < source.GetHeight(); y++) |
465 { | 485 { |