Hi Mahendra,


On Fri, Sep 24, 2010 at 2:46 PM, Mahendra G.R <mahen...@mahendragr.com> wrote:
> code:
>
>
> (float&)image->data(0,0,0)[0] = 0.33
>                                       [1] = 0.56
>                                       [2] = .83
>
> and printing them back casting to float.  what am i doing wrong?

This is really a C++ question.  If you want to access the each colour
components then you'd be best casting the data pointer to a (float*)
then use this to access the components.

float* pixel = static_cast<float*>(image->data(i,j,k));
pixel[0] = r;
pixel[1] = g;
pixel[2] = b;

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

Reply via email to