Commits

Fredrik Lundh committed 50ad683

Added pow() method to ImageMath.

Comments (0)

Files changed (1)

 #define MOD_I(type, v1, v2) ((v2)!=0)?(v1)%(v2):0
 #define MOD_F(type, v1, v2) ((v2)!=0.0F)?fmod((v1),(v2)):0.0F
 
+#define POW_F(type, v1, v2) powf(v1, v2) /* EDOM handling */
+
 #define DIFF_I(type, v1, v2) abs((v1)-(v2))
 #define DIFF_F(type, v1, v2) fabs((v1)-(v2))
 
 BINOP(mul_F, MUL, FLOAT32)
 BINOP(div_F, DIV_F, FLOAT32)
 BINOP(mod_F, MOD_F, FLOAT32)
+BINOP(pow_F, POW_F, FLOAT32)
 BINOP(diff_F, DIFF_F, FLOAT32)
 
 BINOP(min_F, MIN, FLOAT32)
     install(d, "mod_F", mod_F);
     install(d, "min_F", min_F);
     install(d, "max_F", max_F);
+    install(d, "pow_F", pow_F);
 
     install(d, "eq_F", eq_F);
     install(d, "ne_F", ne_F);