36#include "ramCanvas.hpp"
40 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
42 const std::string v =
"015";
43 const int width = 1920*2;
44 const int height = 1080*2;
45 const double aspect = 1.0*width/height;
46 mjr::ramCanvas3c8b theRamCanvas(width*1, height*1, -1.2*aspect, 1.2*aspect, -1.2, 1.2);
48 theRamCanvas.setDrawMode(mjr::ramCanvasRGB8b::drawModeType::ADDCLAMP);
50 for(
int k=0; k<n; k++) {
165 double x = (cos(11.0*std::numbers::pi*k/n))*(1.0-3.0/4.0*std::pow(cos(10.0*std::numbers::pi*k/n), 2));
166 double y = -((sin(17.0*std::numbers::pi*k/n))*(1.0-3.0/4.0*pow(cos(12.0*std::numbers::pi*k/n), 2)));
167 double s = 1.0/80.0+1.0/10.0*pow(sin(56.0*std::numbers::pi*k/n), 2) + .5;
168 double r = 255.0*(0.5+pow(sin(56.0*std::numbers::pi*k/n), 4))/7.0/54.0;
169 double g = 255.0*(0.5+pow(cos(42.0*std::numbers::pi*k/n), 2))/7.0/38.0;
170 double b = 255.0*(0.5+pow(sin(56.0*std::numbers::pi*k/n), 4))/7.0/48.0;
172 mjr::ramCanvasRGB8b::colorChanType ri =
static_cast<mjr::ramCanvasRGB8b::colorChanType
>(r);
173 mjr::ramCanvasRGB8b::colorChanType gi =
static_cast<mjr::ramCanvasRGB8b::colorChanType
>(g);
174 mjr::ramCanvasRGB8b::colorChanType bi =
static_cast<mjr::ramCanvasRGB8b::colorChanType
>(b);
176 theRamCanvas.drawCircle(x, y, s, mjr::ramCanvasRGB8b::colorType(ri, gi, bi));
179 double kernel[51*51];
181 theRamCanvas.computeConvolutionMatrixGausian(kernel, kSize, 20);
182 theRamCanvas.convolution(kernel, kSize);
184 theRamCanvas.autoHistStrech();
186 theRamCanvas.writeTIFFfile(
"circles_" + v +
"b.tiff");
188 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
189 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])