34#include "ramCanvas.hpp"
38 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
40 const int XSIZ = 7680/1;
41 const int YSIZ = 4320/1;
43 mjr::ramCanvas1c16b::colorType aColor;
45 mjr::ramCanvas1c16b theRamCanvas(XSIZ, YSIZ, -19, 19, 3, 47);
47 double distToGo = 80000.0;
49 double idealJumpDist = 0.12;
51 double maxMovDelta = idealJumpDist / 2.0;
52 double minMovDelta = idealJumpDist / 6.0;
55 double minTdelta = 0.000001;
56 double maxTdelta = 0.01;
57 double tDeltaZeroThresh = 0.00000001;
58 double maxNumBisect = 10;
65 double curMaxTdelta, curMinTdelta, tDelta, dist, Xdelta, Ydelta, Zdelta, movDelta;
66 int numBisect, doneBisecting;
68 for(
int i=0; i<10; i++) {
73 std::cout <<
"y: " << y << std::endl;
78 while (dist < distToGo) {
80 tDelta = (maxTdelta + tDelta) / 2;
81 if (tDelta > maxTdelta) {
84 curMaxTdelta = maxTdelta;
85 curMinTdelta = minTdelta;
89 while (!(doneBisecting)) {
91 Xdelta = a * (y - x) * tDelta;
92 Ydelta = (x * (b - z) - y) * tDelta;
93 Zdelta = (x * y - c * z) * tDelta;
94 movDelta = sqrt (fabs (Xdelta * Xdelta + Ydelta * Ydelta + Zdelta * Zdelta));
95 if (numBisect > maxNumBisect) {
98 if (movDelta > maxMovDelta) {
99 if (fabs (tDelta - curMinTdelta) < tDeltaZeroThresh) {
102 curMaxTdelta = tDelta;
103 tDelta = (tDelta + curMinTdelta) / 2;
104 if (tDelta < minTdelta) {
108 }
else if (movDelta < minMovDelta) {
109 if (fabs (tDelta - curMaxTdelta) < tDeltaZeroThresh) {
112 curMinTdelta = tDelta;
113 tDelta = (curMaxTdelta + tDelta) / 2;
114 if (tDelta > maxTdelta) {
127 theRamCanvas.drawPoint(x, z, theRamCanvas.getPxColor(x, z).tfrmAdd(aColor));
129 if(theRamCanvas.getPxColor(x, z).getC0() > maxII)
130 maxII = theRamCanvas.getPxColor(x, z).getC0();
134 theRamCanvas.writeRAWfile(
"lorenz_fuz.mrw");
137 theRamCanvas.applyHomoPixTfrm(&mjr::ramCanvas1c16b::colorType::tfrmStdPow, 1.0 / p);
138 maxII =
static_cast<uint64_t
>(65535.0 * std::pow(
static_cast<double>(maxII) / 65535.0, 1.0 / p));
146 mjr::ramCanvas3c8b anotherRamCanvas(XSIZ, YSIZ);
147 mjr::ramCanvas3c8b::colorType bColor;
148 for(
int yi=0;yi<theRamCanvas.getNumPixY();yi++)
149 for(
int xi=0;xi<theRamCanvas.getNumPixX();xi++) {
150 anotherRamCanvas.drawPoint(xi, yi, bColor.cmpRGBcornerDGradiant(
static_cast<mjr::ramCanvas3c8b::csIntType
>(theRamCanvas.getPxColor(xi, yi).getC0() * 1275 / maxII),
"0RYBCW"));
151 if( (anotherRamCanvas.getPxColor(xi, yi).getC0() > 0) && (anotherRamCanvas.getPxColor(xi, yi).getC0() < 255) )
152 anotherRamCanvas.getPxColorRefNC(xi, yi).setC0(255);
155 anotherRamCanvas.writeTIFFfile(
"lorenz_fuz.tiff");
157 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
158 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])