66 if (str ==
"biased") {
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 ==
"biased") {
87 if (lower_str ==
"optimal") {
114 panic(
"unhandled TileSharingPacking 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.
@ optimal
CSP-based globally optimal alignment (not yet implemented).
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
TileSharingPacking
Controls whether palette packing considers tile sharing shape group membership.
@ off
Packing ignores shape group membership (default).
@ optimal
Hard constraint rejecting sibling co-placement (not yet implemented).
@ biased
Soft penalty steers shape group siblings toward different palettes.
std::optional< TileSharingPacking > tile_sharing_packing_from_str(const std::string &str)
Parses a string into a TileSharingPacking with fuzzy matching.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.