37#include "ramCanvas.hpp"
41 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
42 const int BSIZ = 7680/8;
43 mjr::ramCanvas1c16b::colorType aColor;
45 mjr::ramCanvas1c16b theRamCanvas(BSIZ, BSIZ, -1, 1, -1, 1);
46 double x=0.0, y=0.0, xNew, yNew;
48 double a[12] = {-0.6599, -0.2, 1.1, 0.2, -0.81, 0.61, -0.7, 0.71, 0.7, 0.28, 0.19, 0.89};
54 for(uint64_t i=0;i<1000000000ul;i++) {
56 xNew = a[0] + a[1]*x + a[2]*x*x + a[3]*x*y + a[4]*y + a[5]*y*y;
57 yNew = a[6] + a[7]*x + a[8]*x*x + a[9]*x*y + a[10]*y + a[11]*y*y;
58 theRamCanvas.drawPoint(xNew, yNew, theRamCanvas.getPxColor(xNew, yNew).tfrmAdd(aColor));
59 if(theRamCanvas.getPxColor(xNew, yNew).getC0() > maxII) {
60 maxII = theRamCanvas.getPxColor(xNew, yNew).getC0();
62 std::cout <<
"ITER(): " << i <<
" MAXS: " << maxII <<
" EXIT: Maximum image intensity reached" << std::endl;
66 if((i % 10000000) == 0)
67 std::cout <<
"ITER: " << i <<
" MAXS: " << maxII << std::endl;
72 theRamCanvas.writeRAWfile(
"sprott2d.mrw");
75 theRamCanvas.applyHomoPixTfrm(&mjr::ramCanvas1c16b::colorType::tfrmStdPow, 1/p);
76 maxII =
static_cast<uint64_t
>(65535.0 * std::pow(
static_cast<double>(maxII)/65535.0, 1/p));
84 mjr::ramCanvas3c8b anotherRamCanvas(BSIZ, BSIZ);
85 mjr::ramCanvas3c8b::colorType bColor;
86 for(
int yi=0;yi<theRamCanvas.getNumPixY();yi++)
87 for(
int xi=0;xi<theRamCanvas.getNumPixX();xi++)
88 anotherRamCanvas.drawPoint(xi, yi, bColor.cmpRGBcornerDGradiant(
static_cast<mjr::ramCanvas3c8b::csIntType
>(theRamCanvas.getPxColor(xi, yi).getC0() * 1275 / maxII),
"0RYBCW"));
90 anotherRamCanvas.writeTIFFfile(
"sprott2d.tiff");
91 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
92 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])