OpenImageIO/oiio — pull request #355 by lgritz (2012-05-15 03:54:37+00:00)
Title: Review: ImageBuf copy/assign refactor, app buffers

Four changes to ImageBuf:

* New ctr and internals that make it possible to create an ImageBuf that "wraps" an application-owned memory buffer. All ImageBufAlgo functions ought to work just fine with this, no copying! But beware that of course IB/IBA knows it doesn't own the memory and thus can't resize it, so any IB operations that need to change the resolution, channels, or data type will fail.

* Add ImageBuf::copy to resize and/or copy pixels from one ImageBuf to another, with well-defined semantics.

* Eliminate ImageBuf::operator=, the best semantics were unclear, so let's just get rid of it.

* Change ImageBuf::copy_pixels to be fully 3D (i.e. work fine with both volumetric as well as planar images).