Removed log2 and replaced the places where is was used with a new Image::computeNumberOfMipmapLevels method.

This commit is contained in:
Robert Osfield
2007-10-01 08:50:58 +00:00
parent 69eddaa7bb
commit 7086aeeebc
9 changed files with 17 additions and 10 deletions

View File

@@ -234,6 +234,7 @@ class OSG_EXPORT Image : public Object
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);
static int computeNumberOfMipmapLevels(int s,int t = 1, int r = 1);
/** Precomputed mipmaps stuff. */
typedef std::vector< unsigned int > MipmapDataType;

View File

@@ -194,11 +194,6 @@ inline double RadiansToDegrees(double angle) { return angle*180.0/PI; }
inline float round(float v) { return v>=0.0f?floorf(v+0.5f):ceilf(v-0.5f); }
inline double round(double v) { return v>=0.0?floor(v+0.5):ceil(v-0.5); }
inline float log2(float v) { return logf(v) * static_cast<float>(INVLN_2); }
inline double log2(double v) { return log(v) * INVLN_2; }
inline float log2(int v) { return log2(static_cast<float>(v)); }
inline float log2(unsigned int v) { return log2(static_cast<float>(v)); }
#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MWERKS__)
inline bool isNaN(float v) { return _isnan(v)!=0; }
inline bool isNaN(double v) { return _isnan(v)!=0; }