Support for JPEG compression is localized to the JPEG plugin. It's not part
of Image.

If you load a JPEG file, OSG's JPEG plugin uses the third party libjpeg,
under the hood, to decompress your data into an array of pixels. Then it
stores that raw pixel data in an Image and returns it to your app.

If you load the JPEG yourself, then you must also decompress it yourself
(using libjpeg or some equivalent functionality). Then call
Image::setImage() and pass in the uncompressed pixel data.

Hope that helps,
   -Paul


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike Greene
> Sent: Thursday, June 28, 2007 6:57 AM
> To: [email protected]
> Subject: [osg-users] OK,another way - Load osg::Image data 
> from array and not from file
> 
> Perhaps my question earlier this week was not as succinct as 
> it should have been.
> 
> I know I can load an osg::Image like this:
> 
> osg::Image*  klnFace = osgDB::readImageFile("b:\\image2.jpg");
> 
> But, how would I do it if I already had the jpeg information 
> loaded into a BYTE or unsigned character array?
> 
> Something like :
> 
> klnFace->getData();
> 
> where I somehow specify that the data is in jpeg compressed format.
> 
> 
> Mike Greene
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to