From Marcin Prus and Robert Osfield, moved the key parts of the .dds plugins computeRowWidthInBytes implementation into the osg::Image::computeImageSizeInBytes(..) to

address bugs in the computation of image size.
This commit is contained in:
Robert Osfield
2013-05-28 14:14:45 +00:00
parent d024444140
commit 47f574429a
4 changed files with 48 additions and 50 deletions

View File

@@ -365,7 +365,7 @@ class OSG_EXPORT Image : public BufferData
static unsigned int computeNumComponents(GLenum pixelFormat);
static unsigned int computePixelSizeInBits(GLenum pixelFormat,GLenum type);
static unsigned int computeRowWidthInBytes(int width,GLenum pixelFormat,GLenum type,int packing);
static unsigned int computeImageSizeInBytes(int width,int height, int depth, GLenum pixelFormat,GLenum type,int packing);
static unsigned int computeImageSizeInBytes(int width,int height, int depth, GLenum pixelFormat, GLenum type, int packing = 1, int slice_packing = 1, int image_packing = 1);
static int computeNearestPowerOfTwo(int s,float bias=0.5f);
static int computeNumberOfMipmapLevels(int s,int t = 1, int r = 1);