Mercurial > hg > orthanc
comparison Core/Images/ImageProcessing.cpp @ 2281:e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 09 Jun 2017 16:14:52 +0200 |
parents | 002b94046c69 |
children | 7e217a1cc63f |
comparison
equal
deleted
inserted
replaced
2280:2e7a8ce24be2 | 2281:e002430baa41 |
---|---|
770 | 770 |
771 default: | 771 default: |
772 throw OrthancException(ErrorCode_NotImplemented); | 772 throw OrthancException(ErrorCode_NotImplemented); |
773 } | 773 } |
774 } | 774 } |
775 | |
776 | |
777 void ImageProcessing::Invert(ImageAccessor& image) | |
778 { | |
779 switch (image.GetFormat()) | |
780 { | |
781 case PixelFormat_Grayscale8: | |
782 { | |
783 for (unsigned int y = 0; y < image.GetHeight(); y++) | |
784 { | |
785 uint8_t* p = reinterpret_cast<uint8_t*>(image.GetRow(y)); | |
786 | |
787 for (unsigned int x = 0; x < image.GetWidth(); x++, p++) | |
788 { | |
789 *p = 255 - (*p); | |
790 } | |
791 } | |
792 | |
793 return; | |
794 } | |
795 | |
796 default: | |
797 throw OrthancException(ErrorCode_NotImplemented); | |
798 } | |
799 } | |
775 } | 800 } |