Changeset 495
- Timestamp:
- Jul 13, 2005, 7:45:47 PM (17 years ago)
- Location:
- libcaca/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/bitmap.c
r464 r495 46 46 #include <limits.h> 47 47 #include <string.h> 48 #include <math.h>49 48 50 49 #include "caca.h" … … 339 338 340 339 for(i = 0; i < 4096; i++) 341 bitmap->gammatab[i] = 4096.0 * powf((float)i / 4096.0, 1.0 / gammaval);340 bitmap->gammatab[i] = 4096.0 * caca_powf((float)i / 4096.0, 1.0 / gammaval); 342 341 } 343 342 -
libcaca/trunk/src/caca.h
r487 r495 318 318 int caca_rand(int, int); 319 319 unsigned int caca_sqrt(unsigned int); 320 float caca_powf(float x, float y); 320 321 /* @} */ 321 322 -
libcaca/trunk/src/math.c
r298 r495 79 79 } 80 80 81 82 /** 83 * \brief powf substitute (x^y) 84 * \param x The value to be raised 85 * \param y The power to raise x of. 86 * \return \p x raised to the power of \p y 87 */ 88 89 float caca_powf(float x, float y) 90 { 91 int i=((int)y); 92 float r=x; 93 94 if(((int)y)==1 || ((int)x)==1) 95 return x; 96 97 i--; 98 while(i--) 99 { 100 r*=x; 101 } 102 return r; 103 }
Note: See TracChangeset
for help on using the changeset viewer.