#ifndef MBGL_UTIL_CLIP_IDS #define MBGL_UTIL_CLIP_IDS #include #include #include #include #include #include #include #include namespace mbgl { class Tile; struct ClipID { inline ClipID() {} inline ClipID(const std::string &mask_, const std::string &reference_) : mask(mask_), reference(reference_) {} std::bitset<8> mask; std::bitset<8> reference; inline bool operator==(const ClipID &other) const { return mask == other.mask && reference == other.reference; } inline ClipID& operator|=(const ClipID &other) { mask |= other.mask; reference |= other.reference; return *this; } }; class ClipIDGenerator { private: struct Leaf { Leaf(TileID, ClipID&); void add(const TileID &p); bool operator==(const Leaf &other) const; const TileID id; std::forward_list children; ClipID& clip; }; uint8_t bit_offset = 0; std::vector pool; public: void update(std::forward_list tiles); std::map getStencils() const; }; } // namespace mbgl #endif