43#include "ramCanvas.hpp"
47enum class whyStopMO { OUTSET,
53 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
54 const int CSIZE = 1080*2;
56 const int MAXITR = 2048;
57 mjr::ramCanvas1c16b inhRamCanvas (CSIZE*SCALE, CSIZE*SCALE, -2.0, 1.0, -1.5, 1.5);
58 mjr::ramCanvas1c16b incRamCanvas (CSIZE*SCALE, CSIZE*SCALE, -2.0, 1.0, -1.5, 1.5);
59 mjr::ramCanvas1c16b outhRamCanvas(CSIZE*SCALE, CSIZE*SCALE, -2.0, 1.0, -1.5, 1.5);
60 mjr::ramCanvas1c8b mRamCanvas (CSIZE*SCALE, CSIZE*SCALE, -2.0, 1.0, -1.5, 1.5);
61 std::complex<double>* theOrbit =
new std::complex<double>[MAXITR+1];
63 for(
int y=0;y<inhRamCanvas.getNumPixY();y++) {
64 if((y%((CSIZE*SCALE)/10))==0)
65 std::cout <<
"LINE: " << y <<
"/" << (CSIZE*SCALE) << std::endl;
66 for(
int x=0;x<inhRamCanvas.getNumPixX();x++) {
69 std::complex<double> z;
71 double cr = inhRamCanvas.int2realX(x);
72 double ci = inhRamCanvas.int2realY(y);
73 std::complex<double> c(cr, ci);
75 for(count=0; ; count++) {
78 if(count>=(MAXITR-1)) {
79 why = whyStopMO::MAXCOUNT;
83 why = whyStopMO::OUTSET;
88 if(why == whyStopMO::MAXCOUNT) {
89 mRamCanvas.drawPoint(x, y,
"white");
90 incRamCanvas.drawPoint(std::real(z), std::imag(z),
"white");
92 for(
int i=0; i<(count-1); i++) {
93 int cri = inhRamCanvas.real2intX(std::real(theOrbit[i]));
94 int cii = inhRamCanvas.real2intY(std::imag(theOrbit[i]));
95 if( !(inhRamCanvas.isCliped(cri, cii))) {
96 if(why == whyStopMO::OUTSET) {
97 outhRamCanvas.getPxColorRefNC(cri, cii).tfrmAdd(1);
99 inhRamCanvas.getPxColorRefNC(cri, cii).tfrmAdd(1);
105 outhRamCanvas.scaleDownMean(SCALE);
106 outhRamCanvas.autoHistStrech();
107 outhRamCanvas.writeTIFFfile(
"mandelbrot_orbits_out_h.tiff");
108 inhRamCanvas.scaleDownMean(SCALE);
109 inhRamCanvas.autoHistStrech();
110 inhRamCanvas.writeTIFFfile(
"mandelbrot_orbits_in_h.tiff");
111 mRamCanvas.scaleDownMax(SCALE);
112 mRamCanvas.writeTIFFfile(
"mandelbrot_orbits_m.tiff");
113 incRamCanvas.scaleDownMax(SCALE);
114 incRamCanvas.writeTIFFfile(
"mandelbrot_orbits_in_c.tiff");
115 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
116 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])