Hello,
@Robert, Mahendra is ok :).
Btw, i gave GL_FLOAT as the type, i took Robert's suggestion and itseems
working, however, i'm getting values from 0-255 (converted?) and not the
actual float values stored.
this is what i'm exactly doing :
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?
Thanks,
Best regards.
On Fri, Sep 24, 2010 at 3:31 PM, Werner Modenbach <
[email protected]> wrote:
> Hi Mahendra G.R,
>
> what type does "image" have?
> If it is something like RGBA you try to assign a float to an unsigned byte.
> This will do implicit conversion.
>
> - Werner -
>
> On Friday 24 September 2010 15:21:37 Robert Osfield wrote:
> > Hi Mahendra? G.R?
> >
> > All you need to do is cast the data return type to float&.
> >
> > Robert.
> >
> > On Fri, Sep 24, 2010 at 2:04 PM, Mahendra G.R <[email protected]>
> wrote:
> > > Hello Guys,
> > >
> > > I have a small situation here, i'm trying to write float data into an
> > > image file using image->data(x,y,z)[0] = 0.352 (an example), but it
> > > automatically converts it into char, how can i prevent this?
> > >
> > > Thanks,
> > > Best regards
> > >
> > > --
> > > http://www.mahendragr.com
> > >
> > > _______________________________________________
> > > osg-users mailing list
> > > [email protected]
> > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> --
> TEXION Software Solutions
>
> TEXION GmbH - Rotter Bruch 26a - D 52068 Aachen - HRB 14999 Aachen
> Fon: +49 241 475757-0, Fax: +49 241 475757-29, web: http://www.texion.eu
>
> Geschäftsführer/Managing Director: Werner Modenbach
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
--
http://www.mahendragr.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org