54#include "ramCanvas.hpp"
58 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
59 const int NUMITR = 1024;
60 const int CSIZE = 7680;
61 const int LASTMAX = 4;
62 mjr::ramCanvas3c8b theRamCanvas(CSIZE, CSIZE, -2.2, 0.8, -1.5, 1.5);
63 theRamCanvas.clrCanvasToBlack();
65 long int countPERIOD1 = 0;
66 long int countPERIOD2 = 0;
67 long int countMAXCOUNT = 0;
68 long int countBOUND = 0;
69 long int countCYCORLIM = 0;
70 long int countREFLCT = 0;
72 bool doPERIOD1 =
true;
73 bool doPERIOD2 =
true;
75 bool doCYCORLIM =
true;
78 bool doStatusPrint =
false;
80 std::vector<std::complex<double>> lastZs(LASTMAX);
81 for(
int y=0;y<theRamCanvas.getNumPixY();y++) {
82 for(
int x=0;x<theRamCanvas.getNumPixX();x++) {
84 double cr = theRamCanvas.int2realX(x);
85 double ci = theRamCanvas.int2realY(y);
86 std::complex<double> c(cr, ci), z(0, 0);
87 double p = std::abs(c-0.25);
88 if(doPERIOD1 && (cr <= p-2.0*p*p+0.25)) {
89 theRamCanvas.drawPoint(x, y,
"blue");
92 if(doPERIOD2 && (std::abs(c+1.0) <= 0.25)) {
93 theRamCanvas.drawPoint(x, y,
"green");
96 if(doREFLCT && (!(theRamCanvas.getPxColor(std::conj(c)).isBlack()))) {
98 theRamCanvas.drawPoint(x, y, theRamCanvas.getPxColor(std::conj(c)));
101 for(count=0; ; count++) {
105 theRamCanvas.drawPoint(x, y,
"white");
109 if(doBOUND && (std::norm(z)>4.0)) {
111 theRamCanvas.drawPoint(x, y, mjr::ramCanvas3c8b::colorType(
static_cast<mjr::ramCanvas3c8b::colorChanType
>((5*count+50)%256), 0, 0));
115 if(doCYCORLIM && (count>LASTMAX) && std::any_of(lastZs.begin(), lastZs.end(), [&z](std::complex<double> zl){return std::abs(zl-z)<0.0001;}) ) {
116 theRamCanvas.drawPoint(x, y,
"yellow");
121 lastZs[count%LASTMAX] = z;
128 if( doStatusPrint && (((y%(CSIZE/32))==0) || (y==(CSIZE-1))) ) {
129 std::cout <<
"LINE: " << y <<
"/" << CSIZE << std::endl;
130 std::cout <<
" countPERIOD1: " << countPERIOD1 << std::endl;
131 std::cout <<
" countPERIOD2: " << countPERIOD2 << std::endl;
132 std::cout <<
" countMAXCOUNT: " << countMAXCOUNT << std::endl;
133 std::cout <<
" countBOUND: " << countBOUND << std::endl;
134 std::cout <<
" countCYCORLIM: " << countCYCORLIM << std::endl;
135 std::cout <<
" countREFLCT: " << countREFLCT << std::endl;
138 theRamCanvas.writeTIFFfile(
"mandelbrot_bm_cplx_hyper.tiff");
139 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
140 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])