Mercurial > hg > orthanc
comparison Core/Images/ImageProcessing.cpp @ 2423:5a7c5c541a1d
Built-in decoding of palette images
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Oct 2017 21:58:08 +0200 |
parents | 7e217a1cc63f |
children | 878b59270859 |
comparison
equal
deleted
inserted
replaced
2422:b340f0a9022c | 2423:5a7c5c541a1d |
---|---|
566 } | 566 } |
567 | 567 |
568 return; | 568 return; |
569 } | 569 } |
570 | 570 |
571 if (target.GetFormat() == PixelFormat_RGB24 && | |
572 source.GetFormat() == PixelFormat_RGB48) | |
573 { | |
574 for (unsigned int y = 0; y < source.GetHeight(); y++) | |
575 { | |
576 const uint16_t* p = reinterpret_cast<const uint16_t*>(source.GetConstRow(y)); | |
577 uint8_t* q = reinterpret_cast<uint8_t*>(target.GetRow(y)); | |
578 for (unsigned int x = 0; x < source.GetWidth(); x++) | |
579 { | |
580 q[0] = p[0] >> 8; | |
581 q[1] = p[1] >> 8; | |
582 q[2] = p[2] >> 8; | |
583 p += 3; | |
584 q += 3; | |
585 } | |
586 } | |
587 | |
588 return; | |
589 } | |
590 | |
571 throw OrthancException(ErrorCode_NotImplemented); | 591 throw OrthancException(ErrorCode_NotImplemented); |
572 } | 592 } |
573 | 593 |
574 | 594 |
575 | 595 |