66 if (str ==
"greedy") {
69 if (str ==
"optimal") {
74 std::string lower_str = str;
75 std::ranges::transform(
76 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
79 if (lower_str ==
"off") {
83 if (lower_str ==
"greedy") {
87 if (lower_str ==
"optimal") {
114 panic(
"unhandled TileSharingAlignment value");
133 constexpr auto parse(std::format_parse_context &ctx)
@ off
Skip primary loading entirely. Compile as a standalone secondary.
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
TileSharingAlignment
Controls palette slot alignment strategy for tile sharing deduplication.
@ greedy
Best-effort alignment via indirect link resolution.
@ off
Pure sequential fill with no sharing alignment (default).
@ optimal
CSP-based globally optimal alignment (not yet implemented).
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
std::optional< TileSharingAlignment > tile_sharing_alignment_from_str(const std::string &str)
Parses a string into a TileSharingAlignment with fuzzy matching.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.