1 diff -ur pfstools-2.0.4/src/fileformat/pfsinimgmagick.cpp pfstools-2.0.4-im7/src/fileformat/pfsinimgmagick.cpp
2 --- pfstools-2.0.4/src/fileformat/pfsinimgmagick.cpp 2015-07-15 11:58:19.000000000 +0200
3 +++ pfstools-2.0.4-im7/src/fileformat/pfsinimgmagick.cpp 2016-12-26 23:03:33.929300971 +0100
6 #define PROG_NAME "pfsinimgmagick"
8 +using namespace Magick;
13 Magick::Image imImage( ff.fileName );
15 VERBOSE_STR << "input image gamma: " << imImage.gamma() << std::endl;
16 - bool hasAlpha = imImage.matte();
17 + bool hasAlpha = imImage.alpha();
19 VERBOSE_STR << "alpha channel found" << std::endl;
23 // Copy line by line to pfs::Frame
25 - const float maxValue = (float)(1<<QuantumDepth) - 1;
26 + const float maxValue = (float)QuantumRange;
27 for( int r = 0; r < imImage.rows(); r++ ) {
28 - const Magick::PixelPacket *pixels =
29 + const Magick::Quantum *pixels =
30 imImage.getConstPixels( 0, r, imImage.columns(), 1 );
32 for( int c = 0; c < imImage.columns(); c++ ) {
33 - (*X)(pixInd) = (float)pixels[c].red / maxValue;
34 - (*Y)(pixInd) = (float)pixels[c].green / maxValue;
35 - (*Z)(pixInd) = (float)pixels[c].blue / maxValue;
36 + (*X)(pixInd) = (float)MagickCore::GetPixelRed(imImage.image(), pixels) / maxValue;
37 + (*Y)(pixInd) = (float)MagickCore::GetPixelGreen(imImage.image(), pixels) / maxValue;
38 + (*Z)(pixInd) = (float)MagickCore::GetPixelBlue(imImage.image(), pixels) / maxValue;
40 - (*alpha)(pixInd) = (float)pixels[c].opacity / maxValue;
41 + (*alpha)(pixInd) = (float)MagickCore::GetPixelAlpha(imImage.image(), pixels) / maxValue;
43 + pixels += GetPixelChannels(imImage.image());