]> git.saurik.com Git - wxWidgets.git/commitdiff
Changed TIFF handler's monochrome conversion to look at the green channel instead...
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Fri, 19 Aug 2011 02:27:11 +0000 (02:27 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Fri, 19 Aug 2011 02:27:11 +0000 (02:27 +0000)
It's common when reducing a coloured image to greyscale or black and white to give the green channel more significance. Since we're only looking at a single channel use the green one instead of red.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68783 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/imagtiff.cpp

index b3209d39f9fef8376a500178ddd247a454d10073..e852fc00f056c7acd60bd1758b72adff520e52d4 100644 (file)
@@ -666,9 +666,9 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo
                     uint8 reverse = 0;
                     for ( int bp = 0; bp < 8; bp++ )
                     {
-                        if ( ptr[column*24 + bp*3] > 127 )
+                        if ( ptr[column*24 + bp*3 + 1] > 127 )
                         {
-                            // check only red as this is sufficient
+                            // check only green as this is sufficient
                             reverse = (uint8)(reverse | 128 >> bp);
                         }
                     }