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 theRamCanvas(BSIZ, BSIZ, -1, 1, -1, 1);
44 double x=0.0, y=0.0, xNew, yNew;
46 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};
52 for(uint64_t i=0;i<1000000000ul;i++) {
54 xNew = a[0] + a[1]*x + a[2]*x*x + a[3]*x*y + a[4]*y + a[5]*y*y;
55 yNew = a[6] + a[7]*x + a[8]*x*x + a[9]*x*y + a[10]*y + a[11]*y*y;
56 theRamCanvas.incPxChan(xNew, yNew);
57 if(theRamCanvas.getPxColor(xNew, yNew).getC0() > maxII) {
58 maxII = theRamCanvas.getPxColor(xNew, yNew).getC0();
60 std::cout <<
"ITER(): " << i <<
" MAXS: " << maxII <<
" EXIT: Maximum image intensity reached" << std::endl;
64 if((i % 10000000) == 0)
65 std::cout <<
"ITER: " << i <<
" MAXS: " << maxII << std::endl;
70 theRamCanvas.writeRAWfile(
"sprott2d.mrw");
73 theRamCanvas.applyHomoPixTfrm(&mjr::ramCanvas1c16b::colorType::tfrmStdPow, 1/p);
74 maxII =
static_cast<uint64_t
>(65535.0 * std::pow(
static_cast<double>(maxII)/65535.0, 1/p));
82 mjr::ramCanvas3c8b anotherRamCanvas(BSIZ, BSIZ);
83 mjr::ramCanvas3c8b::colorType bColor;
84 for(
int yi=0;yi<theRamCanvas.getNumPixY();yi++)
85 for(
int xi=0;xi<theRamCanvas.getNumPixX();xi++)
86 anotherRamCanvas.drawPoint(xi, yi, bColor.cmpRGBcornerDGradiant(
static_cast<mjr::ramCanvas3c8b::csIntType
>(theRamCanvas.getPxColor(xi, yi).getC0() * 1275 / maxII),
"0RYBCW"));
88 anotherRamCanvas.writeTIFFfile(
"sprott2d.tiff");
89 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
90 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])