Re: what about rsvg_pixbuf_from_document()?



On Friday, April 26, 2002, at 11:06  PM, Kang Jeong-Hee wrote:

well, rsvg.h does provide rsvg_pixbuf_from_file() and the brothers now.
what about _from_document()? I mean, I want to use gnome-vfs as source of rsvg pixbuf, not file even if temporary.
I have a plan to make a browser engine, and it'll be slow to access to just make rsvg pixbuf.
if I could make rsvg pixbuf from document which read by gnome-vfs and free the memory, it'll be good, I think.

The rsvg_pixbuf_from_file calls are a convenience API. You can read in the rsvg data any way you like and parse it by doing an rsvg_handle_new, then doing rsvg_handle_write with each piece of data, rsvg_handle_close when done, and rsvg_handle_get_pixbuf to get the resulting pixbuf.

The various rsvg_pixbuf_from_file calls all use the rsvg_handle calls underneath. To use gnome-vfs as the source of the rsvg pixbuf, you would just make a function that's like rsvg_pixbuf_from_file_at_size but which uses gnome-vfs calls instead of fopen, fread, and fclose.

moreover, what about _from_chunk()?
at this moment libxml2 support chunk system in SAX parser.
is that impossible or hard to implement chunk system for svg file?
sorry if this is idiot asking. I'm not good at svg tech.

I don't think that's necessary. The librsvg calls already deal with the XML parsing. There may be some optimization possible by using the chunk system internally, but it should not be necessary to have clients worry about it at all.

    -- Darin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]