Mercurial > hg > orthanc
comparison OrthancFramework/Sources/Images/PngWriter.cpp @ 5054:255b02c68908
Added support for RGBA64 images in tools/create-dicom and /preview (Contribution from James Manners - Pliny)
author | Alain Mazy <am@osimis.io> |
---|---|
date | Fri, 08 Jul 2022 15:26:52 +0200 |
parents | 43e613a7756b |
children | 0ea402b4d901 |
comparison
equal
deleted
inserted
replaced
5053:1e435be86887 | 5054:255b02c68908 |
---|---|
163 case PixelFormat_Grayscale16: | 163 case PixelFormat_Grayscale16: |
164 case PixelFormat_SignedGrayscale16: | 164 case PixelFormat_SignedGrayscale16: |
165 bitDepth_ = 16; | 165 bitDepth_ = 16; |
166 colorType_ = PNG_COLOR_TYPE_GRAY; | 166 colorType_ = PNG_COLOR_TYPE_GRAY; |
167 break; | 167 break; |
168 | |
169 case PixelFormat_RGBA64: | |
170 bitDepth_ = 16; | |
171 colorType_ = PNG_COLOR_TYPE_RGBA; | |
172 break; | |
168 | 173 |
169 default: | 174 default: |
170 throw OrthancException(ErrorCode_NotImplemented); | 175 throw OrthancException(ErrorCode_NotImplemented); |
171 } | 176 } |
172 } | 177 } |
187 { | 192 { |
188 switch (format) | 193 switch (format) |
189 { | 194 { |
190 case PixelFormat_Grayscale16: | 195 case PixelFormat_Grayscale16: |
191 case PixelFormat_SignedGrayscale16: | 196 case PixelFormat_SignedGrayscale16: |
197 case PixelFormat_RGBA64: | |
192 { | 198 { |
193 int transforms = 0; | 199 int transforms = 0; |
194 if (Toolbox::DetectEndianness() == Endianness_Little) | 200 if (Toolbox::DetectEndianness() == Endianness_Little) |
195 { | 201 { |
196 transforms = PNG_TRANSFORM_SWAP_ENDIAN; | 202 transforms = PNG_TRANSFORM_SWAP_ENDIAN; |