From c2b02608d168e069d3031a9f6466aeefb1796231 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 22 Sep 2003 09:13:22 +0000 Subject: [PATCH] Renamed instance of variables called format to pixelFormat to make a clearer distinction between pixelFormat and internalTextureFormat. --- include/osg/Image | 18 +++++++++--------- src/osg/Image.cpp | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/osg/Image b/include/osg/Image index eb3f37e12..641566cc4 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -81,11 +81,11 @@ class SG_EXPORT Image : public Object /* allocated a pixel block of specified size and type.*/ void allocateImage(int s,int t,int r, - GLenum format,GLenum type, + GLenum pixelFormat,GLenum type, int packing=1); - /** set the image data and format. + /** set the image data and pixelFormat. * note, when the packing value is negative (the default is -1) this method assumes * a _packing width of 1 if the width is not a multiple of 4, * otherwise automatically sets to _packing to 4. If a positive @@ -93,7 +93,7 @@ class SG_EXPORT Image : public Object */ void setImage(int s,int t,int r, GLint internalTextureformat, - GLenum format,GLenum type, + GLenum pixelFormat,GLenum type, unsigned char *data, AllocationMode mode, int packing=1); @@ -101,10 +101,10 @@ class SG_EXPORT Image : public Object /** readPixels from screen at specified position and size, using glReadPixels. * Create memory for storage if required, reuse existing pixel coords if possible.*/ void readPixels(int x,int y,int width,int height, - GLenum format,GLenum type); + GLenum pixelFormat,GLenum type); - /** read the contents of the current bound texture, handling compressed formats if present. + /** read the contents of the current bound texture, handling compressed pixelFormats if present. * Create memory for storage if required, reuse existing pixel coords if possible.*/ void readImageFromCurrentTexture(unsigned int contextID=0); @@ -136,7 +136,7 @@ class SG_EXPORT Image : public Object void setInternalTextureFormat(GLint internalFormat); inline GLint getInternalTextureFormat() const { return _internalTextureFormat; } - void setPixelFormat(GLenum format); + void setPixelFormat(GLenum pixelFormat); inline GLenum getPixelFormat() const { return _pixelFormat; } inline GLenum getDataType() const { return _dataType; } @@ -201,9 +201,9 @@ class SG_EXPORT Image : public Object static bool isPackedType(GLenum type); - static unsigned int computeNumComponents(GLenum format); - static unsigned int computePixelSizeInBits(GLenum format,GLenum type); - static unsigned int computeRowWidthInBytes(int width,GLenum format,GLenum type,int packing); + 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 int computeNearestPowerOfTwo(int s,float bias=0.5f); // precomputed mipmaps stuff; diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index 0bfcd0909..4c0d81f05 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -137,9 +137,9 @@ bool Image::isPackedType(GLenum type) } } -unsigned int Image::computeNumComponents(GLenum format) +unsigned int Image::computeNumComponents(GLenum pixelFormat) { - switch(format) + switch(pixelFormat) { case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 3; case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): return 4; @@ -160,7 +160,7 @@ unsigned int Image::computeNumComponents(GLenum format) case(GL_LUMINANCE_ALPHA): return 2; default: { - notify(WARN)<<"error format = "<