#1930 has been available since version 2.0 (the current supported version is 2.1).
I think you can use this with an ImageBuf, too. I'm a little nervous because I don't see that we have an active test for it, but it ought to look like this: // Define a subclass of IOProxy, if one of the ones we have isn't adequate class MyInputProxy : public IOProxy { ... } // Make a proxy and a ptr to it MyInputProxy proxy; MyInputProxy *proxyptr = &proxy; // Make a "configuration hint" ImageSpec ImageSpec config; config.attribute("oiio:ioproxy", TypeDesc::PTR, &proxyptr); // Now open a ImageBuf that has the configuration hint that specifies the proxy ImageBuf buf ("image.exr", /*subimage=*/ 0, /*miplevel=*/ 0, /*imagecache=*/ nullptr, &config); This should all work, including the cases where this ImageBuf uses ImageCache underneath. Yes, it would be a welcome addition if you wanted to contribute support for a wider range of ioproxy options to the JPEG support. > On Jan 22, 2020, at 5:52 AM, Etienne Sandré-Chardonnal > <etienne.san...@m4x.org> wrote: > > Hi, > > We currently can use materials whose texture images are stored inside the > material library file, without extracting the image to disk. For this we > provide custom std::istream pointers to our image reader. > > Currently, it seems that if we switch to OIIO with ImageBuf and ImageCache, > we loose this feature as they are only able to read from a plain file. > > I have seen that subclassing IOProxy allows reading an image from a custom > stream, but it's not available to ImageBuf so no ImageCache is possible. > > I have also seen that stuff is coming in future releases: > https://github.com/OpenImageIO/oiio/issues/1930 > <https://github.com/OpenImageIO/oiio/issues/1930> > > Does this mean that we will be able to supply an IOProxy to ImageBuf, and > that this will work with ImageCache? This would be a perfect solution for us > with no loss of features when switching everything to OIIO. > > Larry, I have seen that JPG support is limited to memory buffers only. If you > need, I have written a libjpeg layer able to R/W with any std::iostream, so > it should be straightforward to make it work with an IOProxy. I would be > happy to give it if this helps. > > > > _______________________________________________ > Oiio-dev mailing list > Oiio-dev@lists.openimageio.org > http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org -- Larry Gritz l...@larrygritz.com
_______________________________________________ Oiio-dev mailing list Oiio-dev@lists.openimageio.org http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org