comparison Core/Images/ImageProcessing.cpp @ 2100:1554fc153a93

conversion RGB24 to BGRA32
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 10 Oct 2016 15:55:56 +0200
parents 7a969f235adf
children a3a65de1840f
comparison
equal deleted inserted replaced
2098:7d184e11043e 2100:1554fc153a93
517 } 517 }
518 518
519 return; 519 return;
520 } 520 }
521 521
522 if (target.GetFormat() == PixelFormat_BGRA32 &&
523 source.GetFormat() == PixelFormat_RGB24)
524 {
525 for (unsigned int y = 0; y < source.GetHeight(); y++)
526 {
527 const uint8_t* p = reinterpret_cast<const uint8_t*>(source.GetConstRow(y));
528 uint8_t* q = reinterpret_cast<uint8_t*>(target.GetRow(y));
529 for (unsigned int x = 0; x < source.GetWidth(); x++)
530 {
531 q[0] = p[2];
532 q[1] = p[1];
533 q[2] = p[0];
534 q[3] = 255;
535 p += 3;
536 q += 4;
537 }
538 }
539
540 return;
541 }
542
522 throw OrthancException(ErrorCode_NotImplemented); 543 throw OrthancException(ErrorCode_NotImplemented);
523 } 544 }
524 545
525 546
526 547