Browse Source

going to test vibrancy

master
Joshua Moerman 13 years ago
parent
commit
6e2c2a6b2d
  1. 32
      main.cpp

32
main.cpp

@ -89,7 +89,8 @@ int main(int argc, char* argv[]) {
} }
Attractor& myAttractor = *my_attractor_ptr; 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(); myAttractor.init_range();
LogInfo("\nRendering\n"); LogInfo("\nRendering\n");
@ -114,22 +115,25 @@ int main(int argc, char* argv[]) {
LogMoreInfo("Average iterations per second: %f\n\n", totalIterations/totalTime); LogMoreInfo("Average iterations per second: %f\n\n", totalIterations/totalTime);
// saving output // saving output
char filename[256]; for(int vibrancy = -3; vibrancy <= 5; ++vibrancy){
time_t t = time(0); char filename[256];
struct tm* lt = localtime(&t); time_t t = time(0);
int r = rand() % 10; struct tm* lt = localtime(&t);
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); 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(); start = clock();
myAttractor.projector->canvas->output_file(filename); myAttractor.projector->canvas->output_file(filename);
end = clock(); end = clock();
totalTime = ((double)(end-start)/(double)(CLOCKS_PER_SEC));
LogInfo("Total clock time for writing png: %f\n", totalTime); totalTime = ((double)(end-start)/(double)(CLOCKS_PER_SEC));
{ LogInfo("Total clock time for writing png: %f\n", totalTime);
std::string path(filename); }
if(0){
std::string path;
path += ".stf"; path += ".stf";
std::ofstream file(path.c_str()); std::ofstream file(path.c_str());