comparison Core/FileFormats/PngWriter.cpp @ 465:7a966b440f19

signed images to PNG
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 12 Jul 2013 11:15:27 +0200
parents 6f47a4262618
children 51892be15618
comparison
equal deleted inserted replaced
464:5987dd8e0776 465:7a966b440f19
144 pimpl_->bitDepth_ = 8; 144 pimpl_->bitDepth_ = 8;
145 pimpl_->colorType_ = PNG_COLOR_TYPE_GRAY; 145 pimpl_->colorType_ = PNG_COLOR_TYPE_GRAY;
146 break; 146 break;
147 147
148 case PixelFormat_Grayscale16: 148 case PixelFormat_Grayscale16:
149 case PixelFormat_SignedGrayscale16:
149 pimpl_->bitDepth_ = 16; 150 pimpl_->bitDepth_ = 16;
150 pimpl_->colorType_ = PNG_COLOR_TYPE_GRAY; 151 pimpl_->colorType_ = PNG_COLOR_TYPE_GRAY;
151 break; 152 break;
152 153
153 default: 154 default:
170 if (height > 0) 171 if (height > 0)
171 { 172 {
172 switch (format) 173 switch (format)
173 { 174 {
174 case PixelFormat_Grayscale16: 175 case PixelFormat_Grayscale16:
176 case PixelFormat_SignedGrayscale16:
175 png_set_rows(pimpl_->png_, pimpl_->info_, &pimpl_->rows_[0]); 177 png_set_rows(pimpl_->png_, pimpl_->info_, &pimpl_->rows_[0]);
176 178
177 if (Toolbox::DetectEndianness() == Endianness_Little) 179 if (Toolbox::DetectEndianness() == Endianness_Little)
178 { 180 {
179 // Must swap the endianness!! 181 // Must swap the endianness!!