Call it what you like (bug, not optimal behavior, I don't care) but I would 
expect that in a code snippet

image->setPacking(4)
image->readPixels(,,,)

That the readPixels call would respect the the packing that you set in previous 
line.However Image::readPixels resets the packing to 1
That is a problem for me as I require a packing of 4.

A code inspection the shows that this is the case.
..
void    allocateImage (int s, int t, int r, GLenum pixelFormat, GLenum type, 
int packing=1)
..
void Image::readPixels(int x,int y,int width,int height,
                       GLenum format,GLenum type)
{
    allocateImage(width,height,1,format,type); <------ 'missing' default 
parameter  packing=1 causes 'allocateImage'  to set packing to 1

    glPixelStorei(GL_PACK_ALIGNMENT,_packing);

    glReadPixels(x,y,width,height,format,type,_data);
}


One solution would be to add a 'packing' parameter to readPixels.

Andrew

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=13798#13798





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to