10.11 Shadings

One of the most powerful graphical effects within PDF and other input formats is that of Shadings. Our central type representing shadings, fz_shade is all that we have to pass details of shadings across the fz_device interface.

Consequently, we need fz_shade to be expressive enough to cope with shadings from all possible sources, and yet we would like to avoid having to reproduce the shade handling code in all devices.

Accordingly, fz_shade is defined to be expressive enough to encapsulate all the different shading representations found in PDF with the data essentially unchanged. PDF is currently the super-set of shadings found in other formats. If this changes, fz_shade will be extended as required.

Further discussion is deferred to chapterĀ 26 Shading Internals in Part 2, as it would be unusable (though not inconceivable) for applications authors to want to author their own shadings.