Add get_save_path().
This commit is contained in:
parent
4f124a2896
commit
8d096ee2ce
41
rotation.cpp
41
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;
|
||||
|
|
Loading…
Reference in a new issue