2023-09-26 00:02:27 -04:00
|
|
|
#include <algorithm>
|
2023-09-25 23:37:58 -04:00
|
|
|
#include "pfd_utils.h"
|
|
|
|
|
|
|
|
|
|
namespace satdump
|
|
|
|
|
{
|
2023-09-26 00:02:27 -04:00
|
|
|
std::vector<std::string> get_file_formats(std::string default_ext)
|
2023-09-25 23:37:58 -04:00
|
|
|
{
|
|
|
|
|
std::vector<std::string> saveopts = {
|
|
|
|
|
"PNG Files", "*.png",
|
|
|
|
|
"JPEG 2000 Files", "*.j2k",
|
|
|
|
|
"JPEG Files", "*.jpg *.jpeg"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
for (auto it = saveopts.begin() + 1, lim = saveopts.end(); it != lim; it += 2)
|
|
|
|
|
{
|
|
|
|
|
if (it->substr(2, 3) == default_ext)
|
|
|
|
|
{
|
|
|
|
|
std::rotate(saveopts.begin(), it - 1, it);
|
|
|
|
|
std::rotate(saveopts.begin() + 1, it, it + 1);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return saveopts;
|
|
|
|
|
}
|
2023-09-26 00:02:27 -04:00
|
|
|
}
|