Porytiles
Loading...
Searching...
No Matches
color_set_builder.cpp
Go to the documentation of this file.
1
#include "
porytiles2/domain/services/color_set_builder.hpp
"
2
3
#include <map>
4
5
#include "
porytiles2/domain/models/color_set.hpp
"
6
#include "
porytiles2/domain/models/rgba32.hpp
"
7
#include "
porytiles2/xcut/panic/panic.hpp
"
8
9
namespace
porytiles2
{
10
11
// ColorSet
12
// ColorSetBuilder::build(const NormalizedPal<Rgba32> &pal, const std::map<Rgba32, unsigned int> &color_index_map) const
13
// {
14
// /*
15
// * Set a ColorSet based on a given palette. Each bit in the ColorSet represents if the color at the given index
16
// in
17
// * the supplied color map was present in the palette. E.g., suppose the color map has 12 unique colors. The
18
// supplied
19
// * palette has two colors in it, which correspond to index 2 and index 11. The ColorSet bitset would be:
20
// * 0010 0000 0001
21
// */
22
// ColorSet color_set{};
23
// for (const auto &color : pal.colors()) {
24
// if (!color_index_map.contains(color)) {
25
// panic(format_->format("color_index_map did not contain requested color: {}", FormatParam{color}));
26
// }
27
// color_set.set(color_index_map.at(color));
28
// }
29
// return color_set;
30
// }
31
32
}
// namespace porytiles2
color_set.hpp
color_set_builder.hpp
porytiles2
Definition
app_config.hpp:10
panic.hpp
rgba32.hpp
Porytiles2
lib
domain
services
color_set_builder.cpp
Generated by
1.9.8