Porytiles
Loading...
Searching...
No Matches
palette_builder.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <compare>
5#include <cstddef>
6#include <optional>
7#include <vector>
8
14
15namespace porytiles {
16
24 std::size_t source_group_index;
25 std::size_t palette_index;
26 std::size_t target_slot;
29
30 auto operator<=>(const PrefilledDestinationConflictDetail &) const = default;
31 bool operator==(const PrefilledDestinationConflictDetail &) const = default;
32};
33
41 std::size_t source_group_index;
44 std::size_t ref_palette_index;
46
47 auto operator<=>(const PrefilledSourceConflictDetail &) const = default;
48 bool operator==(const PrefilledSourceConflictDetail &) const = default;
49};
50
58 std::size_t source_group_index;
61 std::size_t source_final_slot;
62 std::size_t ref_palette_index;
64 std::size_t ref_final_slot;
65
66 auto operator<=>(const PostResolutionMismatchDetail &) const = default;
67 bool operator==(const PostResolutionMismatchDetail &) const = default;
68};
69
80 std::size_t source_group_index;
88
89 auto operator<=>(const FirstWriterWinsDetail &) const = default;
90 bool operator==(const FirstWriterWinsDetail &) const = default;
91};
92
101 std::vector<PrefilledDestinationConflictDetail> prefilled_destination_conflict_details;
102 std::vector<PrefilledSourceConflictDetail> prefilled_source_conflict_details;
103 std::vector<FirstWriterWinsDetail> first_writer_wins_details;
104 std::vector<PostResolutionMismatchDetail> post_resolution_mismatch_details;
105
106 [[nodiscard]] std::size_t total() const
107 {
110 }
111};
112
165[[nodiscard]] std::array<std::optional<Palette<Rgba32, palette::max_size>>, palette::num_palettes>
167 const std::vector<PackedPalette> &packed_palettes,
168 const std::array<std::optional<Palette<Rgba32, palette::max_size>>, palette::num_palettes> &prefilled_palettes,
169 const ColorIndexMap<Rgba32> &color_map,
170 const Rgba32 &default_slot_zero,
171 const std::vector<IndirectLink> &indirect_links,
172 AlignmentFailureCounts *failure_counts = nullptr);
173
174} // namespace porytiles
Represents a 32-bit RGBA color.
Definition rgba32.hpp:21
constexpr std::size_t num_palettes
Definition palette.hpp:21
std::array< std::optional< Palette< Rgba32, palette::max_size > >, palette::num_palettes > build_all_output_palettes(const std::vector< PackedPalette > &packed_palettes, const std::array< std::optional< Palette< Rgba32, palette::max_size > >, palette::num_palettes > &prefilled_palettes, const ColorIndexMap< Rgba32 > &color_map, const Rgba32 &default_slot_zero, const std::vector< IndirectLink > &indirect_links, AlignmentFailureCounts *failure_counts=nullptr)
Builds all output palettes from packed palettes and Indirect links in a single call.
Detailed records of alignment failures during Indirect link application and chain resolution.
std::vector< PrefilledDestinationConflictDetail > prefilled_destination_conflict_details
std::vector< PostResolutionMismatchDetail > post_resolution_mismatch_details
std::vector< PrefilledSourceConflictDetail > prefilled_source_conflict_details
std::vector< FirstWriterWinsDetail > first_writer_wins_details
Detail record for a single first-writer-wins conflict during Indirect link application.
bool operator==(const FirstWriterWinsDetail &) const =default
auto operator<=>(const FirstWriterWinsDetail &) const =default
Detail record for a post-resolution slot mismatch.
bool operator==(const PostResolutionMismatchDetail &) const =default
auto operator<=>(const PostResolutionMismatchDetail &) const =default
Detail record for a single prefilled destination conflict during Indirect chain resolution.
bool operator==(const PrefilledDestinationConflictDetail &) const =default
auto operator<=>(const PrefilledDestinationConflictDetail &) const =default
Detail record for a single prefilled source conflict during Indirect link application.
bool operator==(const PrefilledSourceConflictDetail &) const =default
auto operator<=>(const PrefilledSourceConflictDetail &) const =default