#ifndef GRAPHICS_ATLAS_H_ #define GRAPHICS_ATLAS_H_ #include #include #include #include #include #include "UVRegion.h" #include "../typedefs.h" class ImageData; class Texture; class Atlas { Texture* texture; ImageData* image; std::unordered_map regions; public: Atlas(ImageData* image, std::unordered_map regions); ~Atlas(); bool has(std::string name) const; const UVRegion& get(std::string name) const; Texture* getTexture() const; ImageData* getImage() const; }; struct atlasentry { std::string name; std::shared_ptr image; }; class AtlasBuilder { std::vector entries; std::set names; public: AtlasBuilder() {} void add(std::string name, ImageData* image); bool has(std::string name) const; Atlas* build(uint extrusion, uint maxResolution=8192); }; #endif // GRAPHICS_ATLAS_H_