33#include "ramCanvas.hpp"
36int main(
int argc,
char *argv[]) {
37 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
38 mjr::ramCanvas3c8b aRamCanvas;
39 mjr::ramCanvas3c8b::colorType aColor(
"red");
43 fprintf(stderr,
"ERROR argument required!\n");
47 if((rRet=aRamCanvas.readTIFFfile(argv[1]))) {
48 fprintf(stderr,
"ERROR(%d) reading file %s\n", rRet, argv[1]);
55 mjr::ramCanvas3c8b::coordIntType width = aRamCanvas.getNumPixX();
56 mjr::ramCanvas3c8b::coordIntType height = aRamCanvas.getNumPixY();
60 mjr::ramCanvas3c8b bRamCanvas(width * magi, height * magi);
62 for(mjr::ramCanvas3c8b::coordIntType x = 0; x < bRamCanvas.getNumPixX(); x++) {
63 for(mjr::ramCanvas3c8b::coordIntType y = 0; y < bRamCanvas.getNumPixY(); y++) {
64 aColor = aRamCanvas.getPxColorInterpTrunc(x/magi, y/magi);
65 bRamCanvas.drawPointNC(x, y, aColor);
68 bRamCanvas.writeTIFFfile(
"test_interp_scale_trunc.tiff");
70 for(mjr::ramCanvas3c8b::coordIntType x = 0; x < bRamCanvas.getNumPixX(); x++) {
71 for(mjr::ramCanvas3c8b::coordIntType y = 0; y < bRamCanvas.getNumPixY(); y++) {
72 aColor = aRamCanvas.getPxColorInterpNear(x/magi, y/magi);
73 bRamCanvas.drawPointNC(x, y, aColor);
76 bRamCanvas.writeTIFFfile(
"test_interp_scale_near.tiff");
78 for(mjr::ramCanvas3c8b::coordIntType x = 0; x < bRamCanvas.getNumPixX(); x++) {
79 for(mjr::ramCanvas3c8b::coordIntType y = 0; y < bRamCanvas.getNumPixY(); y++) {
80 aColor = aRamCanvas.getPxColorInterpBLin(x/magr, y/magr);
81 bRamCanvas.drawPointNC(x, y, aColor);
84 bRamCanvas.writeTIFFfile(
"test_interp_scale_bil.tiff");
86 for(mjr::ramCanvas3c8b::coordIntType x = 0; x < bRamCanvas.getNumPixX(); x++) {
87 for(mjr::ramCanvas3c8b::coordIntType y = 0; y < bRamCanvas.getNumPixY(); y++) {
88 aColor = aRamCanvas.getPxColorInterpAvg4(x/magr, y/magr);
89 bRamCanvas.drawPointNC(x, y, aColor);
92 bRamCanvas.writeTIFFfile(
"test_interp_scale_avg4.tiff");
94 for(mjr::ramCanvas3c8b::coordIntType x = 0; x < bRamCanvas.getNumPixX(); x++) {
95 for(mjr::ramCanvas3c8b::coordIntType y = 0; y < bRamCanvas.getNumPixY(); y++) {
96 aColor = aRamCanvas.getPxColorInterpAvg9(x/magr, y/magr);
97 bRamCanvas.drawPointNC(x, y, aColor);
100 bRamCanvas.writeTIFFfile(
"test_interp_scale_avg9.tiff");
102 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
103 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])