ImageBuf: be kinder to memory when writing huge files from ImageCache.
ImageBuf: be kinder to memory when writing huge files from ImageCache.

When writing an IB to disk, look out for situations where the IB is
backed by ImageCache rather than in local RAM. In the IC case, the old
method of doing a cache->get_pixels() of the whole image, followed by an
out->write_image() is rather wasteful for truly huge files because it
will force the whole image into memory. Instead, if the file is
IC-backed and bigger than a reasonable amount, read and write it in
strips of scanlines or tiles.

micler/oiio,micler/oiio,OpenImageIO/oiio,bdeluca/oiio,bdeluca/oiio,lgritz/oiio,YangYangTL/oiio,lgritz/oiio,OpenImageIO/oiio,YangYangTL/oiio,bdeluca/oiio,YangYangTL/oiio,micler/oiio,OpenImageIO/oiio,lgritz/oiio,YangYangTL/oiio,OpenImageIO/oiio,micler/oiio,lgritz/oiio,bdeluca/oiio