OpenImageIO/oiio — pull request #924 by lgritz (2014-07-30 06:02:38+00:00)
Title: Massive refactor and amendment of orientation functionality

Clear up a lot of longstanding issues and new features:

* oiiotool --rotcw, --rotccw, and --rot180 have been renamed --orientcw, --orientccw, --orient180 to reflect the fact that they always have (by design) merely altered the Orientation metadata, not changed the pixels. (For now, the old deprecated names will still be silently accepted.)

* ImageBufAlgo::rotate90(), rotate180(), rotate270() are new IBA functions that do truly rotate the image pixels. The pixels are copied exactly, with no filtering, but only the 90 degree increments are supported.

* oiiotool --rotate90, --rotate180, --rotate270 expose the IBA functions in the obvious way.

* ImageBufAlgo::reorient() rotates, flips, and/or flops the image as necessary to make the actual image grid match what is suggested by the Orientation metadata (and in the process resets the Orientation to 1, which means no transformation for display).

* oiiotool --reorient exposes IBA::reorient in the obvious way.

* oiiotool --autoorient causes a --reorient to happen automatically for every image that's input. This can be handy if you are using oiiotool to combine image that may have different orientations, by transforming them all to a canonical orientation before doing actual pixel math on them. (This is not the case by default.)

* IBA::flip(), flop(), and flipflop(), as well as the oiiotool --flip, --flop, and --flipflop, have been rewritten and fixed. They worked ok as long as the image origin was 0 and the display and data windows were the same, but behaved in strange ways for crop windows or overscan images, or "shrink-wrapped" images (those whose data windows are shrunk to the minimum non-black rectangle, to save disk space). They now work with respect to the display (aka "full") window, which makes sense and adheres to the principle that any operation on a shrink-wrapped image ought to be indistinguishable from the same operation performed on the original image.

* Deprecate flipflop in favor of rotate180 (they were equivalent, but it's easier to think of it as a rotation).

And odds and ends to support all of thise.