35#include "ramCanvas.hpp"
36#include "MRMathIVL.hpp"
39typedef mjr::ramCanvas3c8b::colorType ct;
40typedef ct::csIntType cit;
44 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
45 const int NUMITR = 1024;
46 const int IMXSIZ = 7680/2;
47 const int IMYSIZ = 7680/2;
50 mjr::ramCanvas3c8b theRamCanvasA(IMXSIZ, IMYSIZ, -2.75, 2.75, -2.75, 2.75);
51 mjr::ramCanvas3c8b theRamCanvasE(IMXSIZ, IMYSIZ, -2.75, 2.75, -2.75, 2.75);
52 mjr::ramCanvas3c8b theRamCanvasK(IMXSIZ, IMYSIZ, -2.75, 2.75, -2.75, 2.75);
53 mjr::ramCanvas3c8b theRamCanvasL(IMXSIZ, IMYSIZ, -2.75, 2.75, -2.75, 2.75);
54 mjr::ramCanvas3c8b theRamCanvasM(IMXSIZ, IMYSIZ, -2.75, 2.75, -2.75, 2.75);
55 mjr::ramCanvas3c8b theRamCanvasN(IMXSIZ, IMYSIZ, -2.75, 2.75, -2.75, 2.75);
57 for(
int y=0;y<theRamCanvasA.getNumPixY();y++) {
58 for(
int x=0;x<theRamCanvasA.getNumPixX();x++) {
59 std::complex<double> c = theRamCanvasA.int2real(x, y);
60 std::complex<double> z(0.0, 0.0);
61 std::complex<double> zL(0.0, 0.0);
63 while( ((std::abs(std::real(z))<LIM) || (std::abs(std::imag(z))<LIM)) && (count<NUMITR) ) {
70 theRamCanvasA.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>(count*500)));
72 if(std::abs(std::real(z))<std::abs(std::imag(z)))
73 theRamCanvasE.drawPoint(x, y, ct(
"red"));
75 theRamCanvasE.drawPoint(x, y, ct(
"blue"));
77 theRamCanvasK.drawPoint(x, y, ct::csCColdeRainbow::c(
static_cast<cit
>((std::arg(z)+3.14)*255)));
79 if(std::abs(std::real(z))<std::abs(std::imag(z)))
80 theRamCanvasL.drawPoint(x, y, ct::csCCu0R::c(mjr::math::ivl::clamp(
static_cast<cit
>(std::abs(std::real(z))*15), ct::csCCu0R::numC-1)));
82 theRamCanvasL.drawPoint(x, y, ct::csCCu0B::c(mjr::math::ivl::clamp(
static_cast<cit
>(std::abs(std::imag(z))*15), ct::csCCu0B::numC-1)));
84 if(std::abs(std::real(zL)) < LIM)
85 theRamCanvasM.drawPoint(x, y, ct::csCCfractalYB::c(std::abs(std::real(zL))/LIM));
86 else if(std::abs(std::imag(zL)) < LIM)
87 theRamCanvasM.drawPoint(x, y, ct::csCCfractalYR::c(std::abs(std::imag(zL))/LIM));
89 theRamCanvasM.drawPoint(x, y,
"white");
91 if(std::abs(std::real(zL)) < LIM)
92 theRamCanvasN.drawPoint(x, y, ct::csCCdiag01::c(std::abs(std::real(zL))/LIM));
93 else if(std::abs(std::imag(zL)) < LIM)
94 theRamCanvasN.drawPoint(x, y, ct::csCCdiag10::c(std::abs(std::imag(zL))/LIM));
96 theRamCanvasN.drawPoint(x, y,
"white");
100 theRamCanvasA.writeTIFFfile(
"mandelbrot_biomorphA.tiff");
101 theRamCanvasE.writeTIFFfile(
"mandelbrot_biomorphE.tiff");
102 theRamCanvasK.writeTIFFfile(
"mandelbrot_biomorphK.tiff");
103 theRamCanvasL.writeTIFFfile(
"mandelbrot_biomorphL.tiff");
104 theRamCanvasM.writeTIFFfile(
"mandelbrot_biomorphM.tiff");
105 theRamCanvasN.writeTIFFfile(
"mandelbrot_biomorphN.tiff");
106 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
107 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])