Sorry for that silly question,
I just realized that I have to pass the required dimensions in 'options' in
osgDB::readImageFile(filename, options).


Da: [email protected] 
[mailto:[email protected]] Per conto di Gianluca Natale
Inviato: giovedì 10 gennaio 2013 11:47
A: OpenSceneGraph Users
Oggetto: [osg-users] about the OSG SVG plugin

Hi all,
I'm trying to use the OSG SVG plugin to read some .svg file, to be used as 
textures on some surfaces.

Since .svg is a 'vector' graphic format, it could be rasterized at any 
resolution.
So, I should be able to ask any desired size for the image read by the plugin.
I'm using following call:

osgDB::readImageFile(fileName)

but I don't see any way to pass such options to the reader.
Is that possible?

I took a quick look at implementation (ReaderWriterSVG.cpp), and found this in
virtual ReadResult readImage(const std::string& file, const 
osgDB::ReaderWriter::Options* options) const:

RsvgDimensionData dimensionData;
RsvgHandle* handle = rsvg_handle_new_from_file (fileName.c_str(), NULL);
rsvg_handle_get_dimensions( handle, &dimensionData);

So, it seems to me that there is no way to set the size of the image, since 
dimensions are gotten from the handle, whose constructor just takes the name of 
the file.
Is this a limitation of the plugin? So, how does the RsvgHandle choose those 
dimensions?

Thanks,
Gianluca




_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to