64 if (str ==
"best_fusion") {
67 if (str ==
"backtracking") {
70 if (str ==
"overload_and_remove") {
75 std::string lower_str = str;
76 std::ranges::transform(
77 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
80 if (lower_str ==
"best-fusion") {
83 if (lower_str ==
"best_fusion") {
86 if (lower_str ==
"bestfusion") {
90 if (lower_str ==
"backtracking") {
94 if (lower_str ==
"overload-and-remove") {
97 if (lower_str ==
"overload_and_remove") {
100 if (lower_str ==
"overloadandremove") {
121 return "best_fusion";
123 return "backtracking";
125 return "overload_and_remove";
127 panic(
"unhandled PackingStrategyType value");
146 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.