Code

Change lcms transforms to match change of display buffer from RGB-24 to ARGB-32
authorjoncruz <joncruz@users.sourceforge.net>
Wed, 31 Dec 2008 20:10:09 +0000 (20:10 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Wed, 31 Dec 2008 20:10:09 +0000 (20:10 +0000)
src/color-profile.cpp
src/display/sp-canvas.cpp

index 513e15e78f514ff98c4c123312d8280eab266b20..42650b1704b15879361b2a0b45e2df37dd0e76ce 100644 (file)
@@ -860,9 +860,9 @@ cmsHTRANSFORM Inkscape::colorprofile_get_display_transform()
                 dwFlags |= cmsFLAGS_PRESERVEBLACK;
             }
 #endif // defined(cmsFLAGS_PRESERVEBLACK)
-            transf = cmsCreateProofingTransform( ColorProfile::getSRGBProfile(), TYPE_RGB_8, hprof, TYPE_RGB_8, proofProf, intent, proofIntent, dwFlags );
+            transf = cmsCreateProofingTransform( ColorProfile::getSRGBProfile(), TYPE_ARGB_8, hprof, TYPE_ARGB_8, proofProf, intent, proofIntent, dwFlags );
         } else if ( hprof ) {
-            transf = cmsCreateTransform( ColorProfile::getSRGBProfile(), TYPE_RGB_8, hprof, TYPE_RGB_8, intent, 0 );
+            transf = cmsCreateTransform( ColorProfile::getSRGBProfile(), TYPE_ARGB_8, hprof, TYPE_ARGB_8, intent, 0 );
         }
     }
 
@@ -1020,9 +1020,9 @@ cmsHTRANSFORM Inkscape::colorprofile_get_display_per( Glib::ustring const& id )
                             dwFlags |= cmsFLAGS_PRESERVEBLACK;
                         }
 #endif // defined(cmsFLAGS_PRESERVEBLACK)
-                        item.transf = cmsCreateProofingTransform( ColorProfile::getSRGBProfile(), TYPE_RGB_8, item.hprof, TYPE_RGB_8, proofProf, intent, proofIntent, dwFlags );
+                        item.transf = cmsCreateProofingTransform( ColorProfile::getSRGBProfile(), TYPE_ARGB_8, item.hprof, TYPE_ARGB_8, proofProf, intent, proofIntent, dwFlags );
                     } else if ( item.hprof ) {
-                        item.transf = cmsCreateTransform( ColorProfile::getSRGBProfile(), TYPE_RGB_8, item.hprof, TYPE_RGB_8, intent, 0 );
+                        item.transf = cmsCreateTransform( ColorProfile::getSRGBProfile(), TYPE_ARGB_8, item.hprof, TYPE_ARGB_8, intent, 0 );
                     }
                 }
 
index 651bd041490b360aed11d2ff975dfe84fcb88fc3..97713b18e1e69a557a6a998940d40f8b66792c86 100644 (file)
@@ -1781,7 +1781,7 @@ sp_canvas_paint_single_buffer (SPCanvas *canvas, int x0, int y0, int x1, int y1,
 #if ENABLE_LCMS
         if ( transf && canvas->enable_cms_display_adj ) {
             for ( gint yy = 0; yy < (y1 - y0); yy++ ) {
-                guchar* p = buf.buf + (sw * 3) * yy;
+                guchar* p = buf.buf + (buf.buf_rowstride * yy);
                 cmsDoTransform( transf, p, p, (x1 - x0) );
             }
         }