XSLT and Image Rendering

by Philip Fennell

My previous post 'XSLT and Binary File Formats', brought-up the subject of the sequence in XSLT 2.0 and how it can be used to build a byte sequence for a binary file format like a TIFF image. For the XSLT generation of new binary files to be even remotely useful, you would need something that requires transformation into binary data and a way to transform it.


In the world of 3D computer graphics Pixar are the 'King of the hill' and their Reyes Image Rendering Architecture defines a very powerful image processing pipeline that is used for the transformation of complex graphics primitives into smaller, simpler primitives that are easier to sample and rasterize. The keyword in the last sentence was transformation, and XSLT is very good at transforming hierarchical data structures like computer graphics models.


To simplify the implementation of a Reyes pipeline processor in XSLT, it makes scene to start with just two dimensions and use SVG as the source model, while the final output format can be TIFF (see previous post). The following example shows an enhanced Reyes pipeline, expressed in XML, that makes use of their bucketing technique to allow for more efficient sorting and sampling strategies. The XSLT transform consumes the pipeline definition in order to control the processing of the source model.