hi,

Am 29.05.10 15:38, schrieb Osman Hancer:
> osgImg->setImage(cvImg->width,cvImg->height, 3,
>                       GL_RGB, GL_RGB, 
> GL_UNSIGNED_BYTE,(BYTE*)(cvImg->imageData),osg::Image::AllocationMode::NO_DELETE
>         ,1);

I think there's something wrong with this line of code. Reading my code
which copies a IplImage into an osg-image looks like this:

osgImg->setImage(
                        cvImg->width, //s
                        cvImg->height, //t
                        1, //r
                        3,
                        GL_BGR,
                        GL_UNSIGNED_BYTE,
                        (unsigned char*)(cvImg->imageData),
                        osg::Image::NO_DELETE
                        );
                
osgImg->setOrigin( (cvImg->origin == IPL_ORIGIN_BL) ?           
        osg::Image::TOP_LEFT : osg::Image::BOTTOM_LEFT);

Notice the third and fourth parameter. The fourth parameter takes care
of your three-bytes-per-pixel-issue, the third parameter is only useful,
if you are using 3D-textures.

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

Reply via email to