Porytiles
Loading...
Searching...
No Matches
shape_group_metadata.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <map>
5#include <vector>
6
10
11namespace porytiles {
12
34 std::map<PackableTile::Id, std::size_t> tile_id_to_group;
35
42 std::vector<std::vector<PackableTile::Id>> group_members;
43};
44
59 const std::vector<ShapeGroup<Rgba32>> &shape_groups, const std::vector<PackableTile::Id> &combined_index_to_id);
60
61} // namespace porytiles
ShapeGroupMetadata build_shape_group_metadata(const std::vector< ShapeGroup< Rgba32 > > &shape_groups, const std::vector< PackableTile::Id > &combined_index_to_id)
Builds ShapeGroupMetadata from shape groups and a combined-index-to-ID mapping.
Metadata that maps PackableTile IDs to shape group membership for sharing-aware packing.
std::map< PackableTile::Id, std::size_t > tile_id_to_group
Maps PackableTile::Id to its shape group index.
std::vector< std::vector< PackableTile::Id > > group_members
For each group, the list of PackableTile::Ids that belong to it.
A group of tiles that share the same canonical shape but have different color assignments.