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