Sure! Feel free to ask questions or to post "in progress" PR reviews. I'd rather you ask lots of questions along the way, than be "done" but turn out to need a lot of corrections.
Like I said, I think the main trick is in determining what resolution to say the image is. Perhaps just choose something arbitrary, like 2k x 2k, but also accept a resolution hint via the "open with config" option (ask me if you don't know what that means). Then you allocate a buffer and use libsvg (or whatever) to rasterize into the buffer and dole out the pixels as needed. If you want to really get fancy, especially if you want to support huge or arbitrary resolution, it might be fun to report that the image is TILED (with some reasonable tile size, like 128x128 or 256x256), and rasterize into each individual tile as its requested, rather than need to allocate one large buffer up front. I hope what I'm describing makes some sense. The tile size that seems right will be a compromise between memory (bigger tiles = more memory) versus speed (smaller tiles means you will have to rasterize more times to fill the image, if you catch my drift). This would be a great addition, BTW. I've always wanted an SVG reader (and PDF, too, would be super cool), but never had a pressing need to write it myself. > On Apr 11, 2017, at 3:35 PM, Andrew Wood <[email protected]> wrote: > > Thanks Larry! I was pretty sure that was the case, but figured it couldn't > hurt to ask. A brief googling seems to turn up "librsvg" as the preferred > library for reading svg files --I'll keep you posted if we end up > implementing that. > > On Tue, Apr 11, 2017 at 3:05 PM, Larry Gritz <[email protected] > <mailto:[email protected]>> wrote: > It does not currently. It's very much oriented to conceptualizing images as > rasters. > > It *could* read from a vector format. The reader would need to employ some > trickery, like perhaps it would need to take a hit about what resolution it > would want to rasterize the vector image into (or in the absence of such a > hint, choose a resolution). It just needs somebody to write the reader for it. > > > > > On Apr 11, 2017, at 12:51 PM, Andrew Wood <[email protected] > > <mailto:[email protected]>> wrote: > > > > Hey all! > > > > Does oiio support any vector formats? (for example svg, cgm). I didn't see > > any in the list of supported formats, but maybe I had missed one? > > > > thanks! > > Andrew > > -- > Larry Gritz > [email protected] <mailto:[email protected]> > > > _______________________________________________ > Oiio-dev mailing list > [email protected] <mailto:[email protected]> > http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org > <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org> > > _______________________________________________ > Oiio-dev mailing list > [email protected] > http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org -- Larry Gritz [email protected]
_______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
