Hi Robert-

I need to convert a screen capture in GL_BGRA to GL_BGR for the windows 
clipboard (we're pasting GL_BGRA just fine now, but we want a 24-bit clipboard 
format) and I came across this post.

How would you use gluScaleImage to convert formats? It only takes one format 
parameter, and internally it uses that one format to compute the size of the 
before and after image? It seems suited only to scale the image, not change 
formats... Am I missing something?

Thanks-
Baker



robertosfield wrote:
> Hi Blake,
> 
> There isn't a convenience method built into osg::Image to do this, but
> you could easily use gluScaleImage to convert the data.  The new
> inbuilt glu lib within the OSG-3.x has the ability to work without a
> graphics context, this is enabled by passing in a PixelStorageModes
> structure in the gluScaleImage call.  See the implementation of
> osg::Image::scaleImage(..) for an example of how this is done.
> 
> Robert.
> 
> On Tue, Nov 1, 2011 at 12:40 AM, Blake Mason <> wrote:
> 
> > I have a osg::image with pixel format of GL_BGRA. I need to convert it to
> > GL_RGB so that I can write out any generic type of image with osgDB (i.e.,
> > jpg, png, tiff, etc). Is there an easy way to  convert the _data in the
> > image to be in some other format? I could obviously do this myself with a
> > simple loop, but I wanted to see if there was a simple OSG way.
> > 
> > writeImageFile is still commented out in the osgscreencapture.cpp example,
> > and I wonder if it's a similar problem.
> > _______________________________________________
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> > 
> _______________________________________________
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43741#43741





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to