I've already added stuff for render masks, if your interested. I implemented them using the TextureCombiners extension. (Should be supported pretty much everywhere and avoids issues with requiring main-memory images data, excessive computation, etc.)
Edit: It would be possible to add a rollback if TextureCombiners is not supported, but I imagine the set of machines that don't support TextureCombiners, but would have enough CPU to calculate this stuff the hard way each frame would be very small.
Edit Edit: Unless you just want to do everything at load time, but that would make the interface awkward and limit run-time features.