42#include "ramCanvas.hpp"
45std::vector<std::array<double, 11>> params {
47 { 0.900000, -0.220000, 2.0000000, 0.500000, 0.1, 0.1, 1e7, -1.410000, 0.370000, -1.380000, -0.350000 },
48 { 0.200000, 0.150000, 2.0000000, 0.650000, 0.1, 0.1, 1e7, -1.460000, 0.950000, -1.240000, -0.150000 },
49 { 0.900000, -0.601300, 2.0000000, 0.500000, 0.1, 0.1, 1e7, -1.240000, 0.470000, -1.560000, 0.550000 },
50 { -0.783671, -0.450251, 0.0756921, 1.908150, 0.1, 0.1, 1e8, -0.784949, 0.190357, 0.100000, 1.012020 },
51 { -0.667316, 0.789788, 1.1057300, 0.268078, 0.1, 0.1, 1e8, -0.903469, 1.087990, -0.708937, 0.319083 },
52 { -1.016430, -1.458560, 1.3230100, 0.604218, 0.1, 0.1, 1e8, -0.399636, 0.403479, -0.562466, 0.225223 },
53 { -0.254258, 0.925243, 0.7704410, -0.416270, 0.1, 0.1, 1e8, -0.888853, 0.939351, -0.734047, 0.346012 },
54 { -1.548590, -0.249840, -0.2864630, 1.508330, 0.1, 0.1, 1e8, -0.849159, 1.357350, -0.054140, 1.033830 },
55 { -0.769882, -0.743097, -1.0527500, 0.216079, 0.1, 0.1, 1e8, -0.864322, 1.141670, -0.394488, 0.686611 },
56 { -0.305249, -0.507228, -1.5821000, 0.919462, 0.1, 0.1, 1e8, -1.234830, 0.745791, 0.300000, 0.881405 },
57 { -1.754900, -0.904038, 0.9181340, 1.379920, 0.1, 0.1, 1e8, -0.821663, 1.448790, -2.112250, -0.100000 },
58 { -1.659840, -1.286440, 0.7102750, 1.097500, 0.1, 0.1, 1e8, -0.412856, 0.803154, -1.709030, -0.800778 },
59 { -1.733520, -0.647135, 0.5964760, 0.988405, 0.1, 0.1, 1e8, -0.700000, 1.800000, -0.312000, -0.273000 },
64 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
65 const int BSIZ = 480*8;
66 mjr::ramCanvas1c16b::colorType aColor;
69 for(
decltype(params.size()) j=0; j<params.size(); ++j) {
70 mjr::ramCanvas1c16b theRamCanvas(BSIZ, BSIZ, params[j][7], params[j][8], params[j][9], params[j][10]);
72 double a = params[j][0];
73 double b = params[j][1];
74 double c = params[j][2];
75 double d = params[j][3];
79 double x = params[j][4];
80 double y = params[j][5];
83 uint64_t maxItr =
static_cast<uint64_t
>(params[j][6]);
84 uint64_t iPrt = maxItr / 5;
86 for(itr=1;itr<maxItr;itr++) {
87 double xNew = x*x-y*y+a*x+b*y;
88 double yNew = 2*x*y+c*x+d*y;
89 if ( !theRamCanvas.isCliped(x, y)) {
91 theRamCanvas.drawPoint(x, y, theRamCanvas.getPxColor(x, y).tfrmAdd(aColor));
92 if(theRamCanvas.getPxColor(x, y).getC0() > maxII) {
93 maxII = theRamCanvas.getPxColor(x, y).getC0();
95 std::cout <<
"ITER(" << j <<
"): " << itr <<
" MAXS: " << maxII <<
" EXIT: Maximum intensity reached" << std::endl;
100 if((itr % iPrt) == 0)
101 std::cout <<
"ITER(" << j <<
"): " << itr <<
" MAXS: " << maxII <<
" INC: " << inCnt << std::endl;
105 std::cout <<
"ITER(" << j <<
"): " << itr <<
" MAXS: " << maxII <<
" INC: " << inCnt << std::endl;
108 theRamCanvas.applyHomoPixTfrm(&mjr::ramCanvas1c16b::colorType::tfrmLn1);
109 maxII =
static_cast<uint64_t
>(std::log(
static_cast<double>(maxII)));
112 mjr::ramCanvas3c8b anotherRamCanvas(BSIZ, BSIZ);
113 typedef mjr::ramCanvas3c8b::colorType::csCCfractal0RYBCW cs_t;
114 for(
int yi=0;yi<theRamCanvas.getNumPixY();yi++)
115 for(
int xi=0;xi<theRamCanvas.getNumPixX();xi++)
116 anotherRamCanvas.drawPoint(xi, yi, cs_t::c(theRamCanvas.getPxColor(xi, yi).getC0() /
static_cast<mjr::ramCanvas3c8b::csFltType
>(maxII)));
118 anotherRamCanvas.writeTIFFfile(
"tinkerbell_" + mjr::math::str::fmt_int(j, 2,
'0') +
".tiff");
120 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
121 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])