OpenImageIO/oiio — pull request #635 by lgritz (2013-07-05 06:13:53+00:00)
Title: oiiotool --autotrim, IBA::isConstantValue, IBA::nonzero_region

Primarily, this implements oiiotool --autotrim, which causes any oiiotool output to image files whose formats support differing pixel data and display windows to automatically "trim" or "shrink-wrap" the data region to exclude rectangular boundary pixels that are black. It has no effect when outputting to image file formats that can't support crop windows in this manner.

It's implemented in terms of the existing crop functionality, plus two new reusable components I added to ImageBufAlgo:

* IBA::isConstantValue() return whether a given region is everywhere a given color (this is in contrast to the previously existing isConstantColor, which tests if a region is *any* constant color, and also returns that color).

* IBA::nonzero_region returns the minimal ROI of an ImageBuf that contains all the nonzero pixels.

I think this only adds functionality and doesn't change link compatibility or have much risk or breaking anything, so I'm tempted to squeeze it into 1.2 as well as put it in master.