52 if (str ==
"best_fusion") {
55 if (str ==
"backtracking") {
58 if (str ==
"overload_and_remove") {
63 std::string lower_str = str;
64 std::ranges::transform(
65 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
68 if (lower_str ==
"best-fusion") {
71 if (lower_str ==
"best_fusion") {
74 if (lower_str ==
"bestfusion") {
78 if (lower_str ==
"backtracking") {
82 if (lower_str ==
"overload-and-remove") {
85 if (lower_str ==
"overload_and_remove") {
88 if (lower_str ==
"overloadandremove") {
107 return "best_fusion";
109 return "backtracking";
111 return "overload_and_remove";
113 panic(
"unhandled PackingStrategyType value");
130 constexpr auto parse(std::format_parse_context &ctx)
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
std::optional< PackingStrategyType > packing_strategy_type_from_str(const std::string &str)
Parses a string into a PackingStrategyType with fuzzy matching.
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.
PackingStrategyType
Selects the palette packing algorithm to use during tileset compilation.
@ backtracking
DFS/BFS backtracking search (default).
@ best_fusion
Greedy weighted-cost packing (fast, no retries).
@ overload_and_remove
Greedy with overload-and-remove multi-start retries.