diff --git a/rotation.cpp b/rotation.cpp index 24194df..2a86953 100644 --- a/rotation.cpp +++ b/rotation.cpp @@ -914,6 +914,20 @@ bool check_90(string const& path) // // Main // +string get_save_path(string const& base, unsigned int i) +{ + stringstream filename; + //filename << "/tmp/"; + filename << base << "_"; + + if (i < 100) + filename << "0"; + if (i < 10) + filename << "0"; + filename << i << ".ppm"; + + return filename.str(); +} int main(int argc, char* argv[]) { @@ -961,32 +975,9 @@ int main(int argc, char* argv[]) cout << "tiled: " << duration_ms_tiled.count() << " ms" << endl; cout << "speedup: " << (int) (((float) duration_ms.count() / duration_ms_tiled.count() - 1) * 100) << "%" << endl << endl; - // tile check - //tiled_img.print_tile(0); - //rotated_tiled.print_tile(0); + rotated->save(get_save_path("rotated", rotation)); + rotated_tiled->save(get_save_path("rotated_tiled", rotation)); - stringstream filename; -// filename << "/tmp/"; - filename << "rotated_"; - - stringstream filename_tiled; -// filename_tiled << "/tmp/"; - filename_tiled << "tiled_rotated_"; - - if (rotation < 100) - { - filename << "0"; - filename_tiled << "0"; - } - if (rotation < 10) - { - filename << "0"; - filename_tiled << "0"; - } - filename << rotation << ".ppm"; - filename_tiled << rotation << ".ppm"; - rotated.save(filename.str()); - rotated_tiled.save(filename_tiled.str()); } return 0;