47#include "ramCanvas.hpp"
48#include "MRMathSTR.hpp"
49#include "MRMathIVL.hpp"
53 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
54 const int IMXSIZ = 7680/4;
55 const int IMYSIZ = 7680/4;
65 const double h = -2.3;
67 mjr::ramCanvas1c64F xcanvas(IMXSIZ, IMYSIZ, -2, 2, -2, 2);
68 mjr::ramCanvas1c64F ycanvas(IMXSIZ, IMYSIZ, -2, 2, -2, 2);
69 for(
int itr=0; itr<n; itr++) {
70# pragma omp parallel for schedule(static,1)
71 for(
int yi=0;yi<xcanvas.getNumPixY();yi++) {
72 for(
int xi=0;xi<xcanvas.getNumPixX();xi++) {
75 x = xcanvas.int2realX(xi);
76 y = xcanvas.int2realY(yi);
78 x = xcanvas.getPxColorRefNC(xi, yi).getC0();
79 y = ycanvas.getPxColorRefNC(xi, yi).getC0();
80 double xNew = std::sin(a*y + e) - std::cos(b*x + f);
81 double yNew = std::sin(c*x + g) - std::cos(d*y + h);
85 xcanvas.drawPoint(xi, yi, x);
86 ycanvas.drawPoint(xi, yi, y);
89 std::cout <<
"ITR(" << itr <<
"): " <<
"DONE" << std::endl;
91 mjr::ramCanvas3c8b p1canvas(IMXSIZ, IMYSIZ);
92 mjr::ramCanvas3c8b p2canvas(IMXSIZ, IMYSIZ);
93 mjr::ramCanvas3c8b p3canvas(IMXSIZ, IMYSIZ);
94 mjr::ramCanvas3c8b p4canvas(IMXSIZ, IMYSIZ);
95# pragma omp parallel for schedule(static,1)
96 for(
int yi=0;yi<p1canvas.getNumPixY();yi++) {
97 for(
int xi=0;xi<p1canvas.getNumPixX();xi++) {
98 double x = xcanvas.getPxColorRefNC(xi, yi).getC0();
99 double y = ycanvas.getPxColorRefNC(xi, yi).getC0();
101 double r = mjr::math::ivl::wrapCO((x+2)/4, 1.0);
103 double b = mjr::math::ivl::wrapCO((y+2)/4, 1.0);
104 p1canvas.getPxColorRefNC(xi, yi).setChansRGB_dbl(r, g, b);
106 g = mjr::math::ivl::wrapCO((x+y+4)/8, 1.0);
107 p2canvas.getPxColorRefNC(xi, yi).setChansRGB_dbl(r, g, b);
109 p3canvas.drawPoint(xi, yi,
decltype(p1canvas)::colorType::csPLYgrey::c(g));
111 p4canvas.drawPoint(xi, yi,
decltype(p1canvas)::colorType::csCColdeFireRamp::c(r*r));
114 p1canvas.writeTIFFfile(
"peterdejongEAAO_00_c1.tiff", mjr::ramCanvasPixelFilter::ScaleDownMean<
decltype(p1canvas), 4>(p1canvas));
115 p2canvas.writeTIFFfile(
"peterdejongEAAO_00_c2.tiff", mjr::ramCanvasPixelFilter::ScaleDownMean<
decltype(p2canvas), 4>(p2canvas));
116 p3canvas.writeTIFFfile(
"peterdejongEAAO_00_c3.tiff", mjr::ramCanvasPixelFilter::ScaleDownMean<
decltype(p3canvas), 4>(p3canvas));
117 p4canvas.writeTIFFfile(
"peterdejongEAAO_00_c4.tiff", mjr::ramCanvasPixelFilter::ScaleDownMean<
decltype(p4canvas), 4>(p4canvas));
119 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
120 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])