From 59d6931b59cd7d2d5e818c4ee066571aa9418794 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 29 Mar 2012 08:27:21 +0000 Subject: [PATCH] Added int packing parameter to Image::readPixels(..) --- include/osg/Image | 2 +- src/osg/Image.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/osg/Image b/include/osg/Image index febe09037..bb4555ec7 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -170,7 +170,7 @@ class OSG_EXPORT Image : public BufferData * Create memory for storage if required, reuse existing pixel coords if possible. */ virtual void readPixels(int x,int y,int width,int height, - GLenum pixelFormat,GLenum type); + GLenum pixelFormat, GLenum type, int packing=1); /** Read the contents of the current bound texture, handling compressed pixelFormats if present. diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index 16837ad0c..4fdee2e49 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -918,9 +918,9 @@ void Image::setImage(int s,int t,int r, } void Image::readPixels(int x,int y,int width,int height, - GLenum format,GLenum type) + GLenum format, GLenum type, int packing) { - allocateImage(width,height,1,format,type); + allocateImage(width,height,1,format,type, packing); glPixelStorei(GL_PACK_ALIGNMENT,_packing); glPixelStorei(GL_PACK_ROW_LENGTH,_rowLength);