hello hao,
 following code frame mybe will help you:
 osg::Image* p_image ;
p_image= your image adress;
        int width  = p_image->s();
        int height = p_image->t();
        int totalbytes = width * height * 4;
// Directly copy osg image buffer to your memptr;
memptr= your allocated memory
        memcpy( memptr, p_image->data(), totalbytes );
do some image data related deal with
then
memcpy( p_image->data(), memptr, totalbytes );
p_image->dirty();
 cheers

Learned osg six months


2014-06-27 20:09 GMT+08:00 Hao Wang <[email protected]>:

> Hi,
>
> I use the Render to texture method to get a float image, then I need to
> process the image to make the data is in the range of 0-255, after that I
> want to display the image. But I don't know how to handle it,is there
> anyone know how do it? Thank you.
> Thank you!
>
> Cheers,
> Hao
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=59983#59983
>
>
>
>
>
> _______________________________________________
> 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

Reply via email to