[Poppler-bugs] [Bug 14408] Spectacular gradient failure

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Feb 23 05:00:29 PST 2008


http://bugs.freedesktop.org/show_bug.cgi?id=14408





--- Comment #9 from Adrian Johnson <ajohnson at redneon.com>  2008-02-23 05:00:28 PST ---
(In reply to comment #7)
> Created an attachment (id=14507)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=14507) [details]
> Begin adding support for using cairo gradients to paint gradients.
> 
> Here's a lightly tested patch that does axial shading using cairo's linear
> gradients.
> 

I made a start on this recently as well but never got any further than you
have. 

My plan for the stitching and exponential functions was to go over each
function to get the boundary points and use these as gradient stops. If the
exponential function has N=1 there is nothing further to do. If N!=1, bisect
the stops  until the color error is less than some predefined tolerance.

For Type 0 Sample functions, use each sample as a stop.

For the Type 4 Postscript functions, I was planning on sampling values at a
number of points. I wanted to avoid anything like the existing code that
bisects the sample points until the color difference is less than some
tolerance. This has the flaw that the bisection stops when two almost identical
colors are found even though the sample points may be widely spaced apart with
further color changes between these points. Keeping the sampling interval small
would give best results and should be ok for PS/PDF printing since we are using
a linear gradient between stops rather the the solid color the existing code
uses. Further optimization to reduce the number of stops can be done by
checking if multiple consecutive sample values can be approximated with a
linear gradient.

When shading->getExtend0() != shading->getExtend1() I was planning to add an
extra stop top extend the gradient out to the bounding box on one side.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Poppler-bugs mailing list