summaryrefslogtreecommitdiff
path: root/mandel.cu
diff options
context:
space:
mode:
Diffstat (limited to 'mandel.cu')
-rw-r--r--mandel.cu9
1 files changed, 7 insertions, 2 deletions
diff --git a/mandel.cu b/mandel.cu
index 6d34802..c23f92f 100644
--- a/mandel.cu
+++ b/mandel.cu
@@ -1,10 +1,10 @@
#include <iostream>
#include <cassert>
-#include <cstdint>
#include <sys/time.h>
#include "mandel.h"
#include "lodepng.h"
#include "bmp.h"
+#include "cplx.h"
using namespace std;
@@ -34,6 +34,7 @@ Params mandel_default_params() {
par.cx = -0.5; par.cy = 0.0;
par.imgw = 3.5;
par.maxit = 512;
+ par.par1 = par.par2 = 0;
return par;
}
@@ -61,7 +62,7 @@ void mandel_free(Mandel *ctx) {
}
// These macros may assume that the parameters are simple variable names.
-#if 1
+#if 0
#define MANDEL_FUNCTION_REAL(a, b, a2, b2, x, y) (a2 - b2 + x)
#define MANDEL_FUNCTION_IMAG(a, b, a2, b2, x, y) (2 * a * b + y)
#endif
@@ -73,6 +74,10 @@ void mandel_free(Mandel *ctx) {
#define MANDEL_FUNCTION_REAL(a, b, a2, b2, x, y) (a2 * a - 3 * a * b * b + x)
#define MANDEL_FUNCTION_IMAG(a, b, a2, b2, x, y) (3 * a * a * b - b2 * b + y)
#endif
+#if 1
+#define MANDEL_FUNCTION_REAL(a, b, a2, b2, x, y) (par->par1 * 0.01 * complex_power<5>(a, b, a2, b2).x + (1.0 - par->par2 * 0.01) * complex_power<2>(a, b, a2, b2).x + x)
+#define MANDEL_FUNCTION_IMAG(a, b, a2, b2, x, y) (par->par1 * 0.01 * complex_power<5>(a, b, a2, b2).y + (1.0 - par->par2 * 0.01) * complex_power<2>(a, b, a2, b2).y + y)
+#endif
#define MANDEL_GENERIC(dst, ctx, par, ix, iy, idx) { \
const double x = (par).cx - (par).imgw / 2 + (par).imgw * (ix) / ((ctx).w-1); \