Re: [osg-users] get a Texel from an osg::Image

2008-07-11 Thread Jeremy Moles
On Fri, 2008-07-11 at 11:17 +, ka Ming wrote: > Hi, > is there any possibility to get, for example the rgb value, out of an > osg::Image. > data() returns only an unsigned char* > I need or I want an vec3 or with alpha value a vec4 as retrun value. > Is there any solution. > ming osgWidget has

Re: [osg-users] get a Texel from an osg::Image

2008-07-11 Thread David Spilling
Ming, So long as you know that the image format is GL_RGBA8, and 2D, you can do something like: osg::Vec4 returnColour(int row, int col) { unsigned char* pSrc = (unsigned char*) image->data(row,col); float r = (float) *pSrc++/255.0f; float g = (float) *pSrc++/255.0f;

[osg-users] get a Texel from an osg::Image

2008-07-11 Thread ka Ming
Hi, is there any possibility to get, for example the rgb value, out of an osg::Image. data() returns only an unsigned char* I need or I want an vec3 or with alpha value a vec4 as retrun value. Is there any solution. ming __ Gesendet