[osg-users] Get RGB Values from Texture

Robert Osfield robert.osfield at gmail.com
Wed Nov 15 08:32:01 PST 2017


HI Maximum,

The pixel format and data type of the data stored in osg::Image map to
the same set supported by OpenGL, and uses exactly the same GL enums
so you can read up on OpenGL docs and they 1:1 map to the OSG.

As the pixel format and data type can be a wide range you have to
check the type and then cast to the appropriate type and then access
the data.

Robert.

On 15 November 2017 at 15:52, Maxim Stere <osgforum at tevs.eu> wrote:
> Thanks that helped me out a lot, but now I have an additional question:
>
> How is the RGB actually stored in the image?
>
> From my Image I can now get the Raw Data, but what does it represent and how is it stored?
>
> Image->data(x,y,0)?   what does it return? How do I get the individual R, G and B values?
>
> Thank you!
> --Maxim
>
> ------------------------
> Thank you,
> --Maxim
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72389#72389
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list