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
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;
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
3 matches
Mail list logo