Monthly Archives: April 2008

Storing Colours in 31 bits (Part 2)

Jean-Baptiste Rouquier rose to the challenge in my last post: to provide a fast way of storing premultiplied colours in OCaml’s 31bit integers (see his post here). With his kind permission, I’ve included this code (somewhat optimized) in the Colour … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

A Simple Parser with Genlex

(If you’re reading this via the OCaml planet, click the post title to see it with proper formatting – I shall fix this problem for the next post, I hope.) When calling our command line PDF Tools to, for instance, … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

Storing Colours in 31 bits (Part One)

For rendering vector graphics scenes, colours are usually stored with what we call “premultiplied” or “associated” alpha. For instance, opaque dark red is stored as: 0.5, 0, 0, 0.5 (R * A, G * A, B * A, A) instead … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

A Proper GUI for OCaml (Part Two)

I’ve packaged up the basic libraries described last time and you can get them here, together with a little example. It should work on any platform / toolchain where OCaml and Python and WxPython can be installed. It allows you … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment