[gs-commits] rev 11945 - trunk/gs/base

mvrhel at ghostscript.com mvrhel at ghostscript.com
Fri Dec 10 03:06:41 UTC 2010


Author: mvrhel
Date: 2010-12-10 03:06:40 +0000 (Fri, 10 Dec 2010)
New Revision: 11945

Modified:
   trunk/gs/base/gdevp14.c
Log:
Apply proper alpha blending to compute luminosity of mask per the PDF specification.  Fixes bug 691822

Modified: trunk/gs/base/gdevp14.c
===================================================================
--- trunk/gs/base/gdevp14.c	2010-12-09 16:50:55 UTC (rev 11944)
+++ trunk/gs/base/gdevp14.c	2010-12-10 03:06:40 UTC (rev 11945)
@@ -1163,16 +1163,19 @@
                             "SMask_Pop_Lum(Mask_Plane0)",tos->data);
                 global_index++;
 #endif            
-                /* There is no need to convert.  Data is already gray scale.
+                /* There is no need to color convert.  Data is already gray scale.
                    We just need to copy the gray plane.  However it is 
                    possible that the soft mask could have a soft mask which 
                    would end us up with some alpha blending information 
-                   (Bug691803). */
-                if (ctx->smask_blend) {
+                   (Bug691803). In fact, according to the spec, the alpha
+                   blending has to occur.  See FTS test fts_26_2601.pdf 
+                   for an example of this.  Softmask buffer is intialized
+                   with BG values.  It would be nice to keep track if buffer
+                   ever has a alpha value not 1 so that we could detect and
+                   avoid this blend if not needed. */
                     smask_blend(tos->data, tos->rect.q.x - tos->rect.p.x, 
                                 tos->rect.q.y - tos->rect.p.y, tos->rowstride, 
                                 tos->planestride);
-                    ctx->smask_blend = false;
 #if RAW_DUMP
                     /* Dump the current buffer to see what we have. */
                     dump_raw_buffer(tos->rect.q.y-tos->rect.p.y, 
@@ -1181,7 +1184,6 @@
                                 "SMask_Pop_Lum_Post_Blend",tos->data);
                     global_index++;
 #endif            
-                } 
                 smask_copy(tos->rect.q.y - tos->rect.p.y,
                            tos->rect.q.x - tos->rect.p.x, 
                            tos->rowstride, tos->data, new_data_buf);



More information about the gs-commits mailing list