35#include "ramCanvas.hpp"
36#include "MRMathSTR.hpp"
39std::vector<std::array<double, 9>> params {
41 { -1.68661, -1.99168, 1.71743, -1.64958, 0.299086, -1.293460, -0.054505, -1.73135, 2.00},
42 { 1.50503, -1.44118, -1.23281, 1.78607, 1.709360, 1.794210, 1.893750, -1.38227, 2.10},
43 { 1.81390, 1.30705, -1.94400, -1.48629, 0.242144, 0.075625, -0.480636, -0.18518, 1.75},
44 { -1.93281, 1.23020, -1.95848, -1.34156, -0.357486, -0.541028, 0.627957, -1.06337, 2.00},
45 { 1.96082, -1.85272, -1.86495, -1.58137, -0.545130, -1.883680, -0.839783, -1.95953, 2.00},
46 { 1.89361, -1.81593, -1.28357, 1.75597, -1.109410, -1.820460, -0.068557, 1.12429, 2.00},
47 { -1.76096, -1.68857, -1.33290, 1.98759, -1.104940, 1.947970, -1.414330, 1.31909, 2.00},
48 { -1.80149, -1.95335, 1.89633, 1.41626, -1.047470, 0.446659, -0.148925, -1.66114, 1.75},
49 { -1.76161, 1.60748, 1.85472, -1.99701, -0.700920, 0.280207, 0.202521, -1.49941, 1.75},
50 { -1.88084, -1.93071, 1.85293, 1.87725, -1.941150, -0.449833, 1.273380, 1.73451, 1.75},
51 { 1.81220, -1.66034, -1.77919, 1.81528, -1.256080, -1.517980, -1.055310, 1.76863, 1.75},
52 { -1.90207, -1.56841, -1.59079, -1.71636, -1.586460, 1.792950, -1.161890, -1.14366, 1.50},
53 { 1.79278, -1.85710, 1.79287, 1.80201, -1.984930, 1.783520, 1.413990, -1.64555, 2.00},
54 { -1.76690, 1.99947, -1.90106, -1.77759, 0.643333, 1.904950, -1.890230, 0.46540, 2.00},
55 { -1.91813, -1.79012, -1.62624, 1.90787, 0.571077, 1.646480, 1.357700, 0.12230, 1.75},
56 { -1.92361, 1.79491, -1.95131, -1.64915, -1.204090, -1.681380, 1.620420, 1.86234, 1.75},
57 { 1.67219, -1.66621, -1.82146, 1.89902, -0.842709, 1.419750, 0.696557, -0.81644, 1.75},
58 { -2.20000, -1.97000, 2.20200, -2.30000, 0.000000, 0.000000, 0.000000, 0.00000, 1.75}
63 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
64 const int BSIZ = 7680;
65 mjr::ramCanvas1c16b::colorType aColor;
67 for(
decltype(params.size()) j=0; j<params.size(); ++j) {
68 mjr::ramCanvas1c16b theRamCanvas(BSIZ, BSIZ, -2, 2, -2, 2);
70 double a = params[j][0];
71 double b = params[j][1];
72 double c = params[j][2];
73 double d = params[j][3];
74 double e = params[j][4];
75 double f = params[j][5];
76 double g = params[j][6];
77 double h = params[j][7];
78 double p = params[j][8];
85 for(uint64_t i=0;i<10000000000ul;i++) {
86 double xNew = std::sin(a*y + e) - std::cos(b*x + f);
87 double yNew = std::sin(c*x + g) - std::cos(d*y + h);
88 theRamCanvas.drawPoint(x, y, theRamCanvas.getPxColor(x, y).tfrmAdd(aColor));
89 if(theRamCanvas.getPxColor(x, y).getC0() > maxII) {
90 maxII = theRamCanvas.getPxColor(x, y).getC0();
92 std::cout <<
"ITER(" << j <<
"): " << i <<
" MAXS: " << maxII <<
" EXIT: Maximum image intensity reached" << std::endl;
96 if((i % 10000000) == 0)
97 std::cout <<
"ITER(" << j <<
"): " << i <<
" MAXS: " << maxII << std::endl;
102 theRamCanvas.writeRAWfile(
"peterdejong_" + mjr::math::str::fmt_int(j, 2,
'0') +
".mrw");
105 theRamCanvas.applyHomoPixTfrm(&mjr::ramCanvas1c16b::colorType::tfrmStdPow, 1.0/p);
106 maxII =
static_cast<uint64_t
>(65535.0 * pow(
static_cast<double>(maxII)/65535.0, 1/p));
114 mjr::ramCanvas3c8b anotherRamCanvas(BSIZ, BSIZ);
115 mjr::ramCanvas3c8b::colorType bColor;
116 for(
int yi=0;yi<theRamCanvas.getNumPixY();yi++)
117 for(
int xi=0;xi<theRamCanvas.getNumPixX();xi++)
118 anotherRamCanvas.drawPoint(xi, yi, bColor.cmpRGBcornerDGradiant(
static_cast<mjr::ramCanvas3c8b::csIntType
>(theRamCanvas.getPxColor(xi, yi).getC0() * 1275 / maxII),
"0RYBCW"));
120 anotherRamCanvas.writeTIFFfile(
"peterdejong_" + mjr::math::str::fmt_int(j, 2,
'0') +
".tiff");
122 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
123 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])