From 6e2c2a6b2d9a00684f12536dd47c5940177af216 Mon Sep 17 00:00:00 2001 From: Joshua Moerman Date: Mon, 24 Oct 2011 17:01:27 +0200 Subject: [PATCH] going to test vibrancy --- main.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/main.cpp b/main.cpp index b6b5cdf..ecee783 100644 --- a/main.cpp +++ b/main.cpp @@ -89,7 +89,8 @@ int main(int argc, char* argv[]) { } Attractor& myAttractor = *my_attractor_ptr; - myAttractor.projector->canvas = new PNG(width, height, 2); + PNG* output = new PNG(width, height, 2); + myAttractor.projector->canvas = output; myAttractor.init_range(); LogInfo("\nRendering\n"); @@ -114,22 +115,25 @@ int main(int argc, char* argv[]) { LogMoreInfo("Average iterations per second: %f\n\n", totalIterations/totalTime); // saving output - char filename[256]; - time_t t = time(0); - struct tm* lt = localtime(&t); - int r = rand() % 10; - sprintf(filename, (output_path+"attractor_%04d-%02d-%02d_%02d-%02d-%02d-%01d").c_str(), lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec, r); + for(int vibrancy = -3; vibrancy <= 5; ++vibrancy){ + char filename[256]; + time_t t = time(0); + struct tm* lt = localtime(&t); + int r = vibrancy + 3; + output->v = vibrancy; + sprintf(filename, (output_path+"attractor_%04d-%02d-%02d_%02d-%02d-%02d-%01d").c_str(), lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec, r); - start = clock(); - myAttractor.projector->canvas->output_file(filename); - end = clock(); - - totalTime = ((double)(end-start)/(double)(CLOCKS_PER_SEC)); + start = clock(); + myAttractor.projector->canvas->output_file(filename); + end = clock(); - LogInfo("Total clock time for writing png: %f\n", totalTime); + totalTime = ((double)(end-start)/(double)(CLOCKS_PER_SEC)); - { - std::string path(filename); + LogInfo("Total clock time for writing png: %f\n", totalTime); + } + + if(0){ + std::string path; path += ".stf"; std::ofstream file(path.c_str());