[cl-pdf-devel] gradients

Eric Marsden eric.marsden at free.fr
Thu Apr 19 07:17:34 UTC 2012


On 18/04/2012 10:17, Tamas K Papp wrote:

> I would like to write a plotting function that draws image plots
> (plotting a matrix in 2d using colors).  It would be useful to use
> gradients; in particular, paint a rectangle where the four corners each
> have a color and the each point in the rectangle has a color which is a
> convex combination of the corner colors.  I think this is called a
> gradient in most libraries, but I could not figure out how to do it in
> cl-pdf (I have to admit that I didn't find gradients in the library,
> maybe I didn't look hard enough).

Hi,

Gradients of this sort are called shading patterns in PDF (available 
from PDF version 1.3). Several types of shading patterns are available: 
function-based, axial, radial, Gourad-shaded. cl-pdf doesn't have any 
support for this, but it shouldn't be very hard to add.

The PDF specification is available from

    http://www.adobe.com/devnet/pdf/pdf_reference_archive.html

You want section 4.6.3.

-- 
Eric




More information about the cl-pdf-devel mailing list