OpenImageIO/oiio — pull request #650 by lgritz (2013-08-01 22:09:02+00:00)
Title: oiiotool frame range changes

Recall that oiiotool can operate on frame ranges, like this:

oiiotool --frames 1-10 fg.#.exr bg.#.exr --over -o composite.#.exr

At SPI's request, this change more fully implements their way of specifying numeric frame ranges for filename wildcard expansion. We previously accepted ranges (1-10), concatenations (1,2,5-10), and step sizes (1-10x2). This set of changes allows for descending order (10-1), negative step sizes, "complement" of stepped range (1-10y2 means the frames that would be in 1-10 but are excluded from 1-10x2), and the use of @ as a wildcard. The distinction between # and @ is that # pads to 4 digits and @ pads 1 digit (they can be combined... #@ would pad to 5 digits, for example).

There are a few clunky bits of this notation, but I'll just say that there's a historical precedent here that is hard for me to change, and I'm fairly certain that Foundry's Katana also follows these same conventions by default, so it seems pointless to deviate from it.

I've encapsulated the expansion rules into a couple public functions in filesystem.h, so other apps should be able to easily follow the convention also, if they wish.