21 #include <unordered_map>
66 static constexpr
int theAtlasSize = 2048;
100 DtAtlasSlot pack(
const std::string& key,
const uint8_t* rgba,
101 int srcWidth = -1,
int srcHeight = -1 );
106 const DtAtlasSlot* find(
const std::string& key )
const;
122 void overwrite(
const std::string& key,
const uint8_t* rgba,
123 int srcWidth = -1,
int srcHeight = -1 );
135 std::vector<uint8_t>& rgba,
136 int& widthOut,
int& heightOut )
const;
145 const std::unordered_map<std::string, DtAtlasSlot>& slotIndex()
const;
201 std::map<std::pair<int,int>, std::unique_ptr<DtTextureAtlas>>
myAtlases;
int slotWidth() const
Return the individual slot width in pixels.
Definition: DtTextureAtlas.h:154
DtDe & myDe
Definition: DtTextureAtlas.h:200
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
std::unordered_map< std::string, DtAtlasSlot > mySlotIndex
Maps packing key to DtAtlasSlot for O(1) lookup.
Definition: DtTextureAtlas.h:171
Interface for a texture. Used to pass in a texture to vrvGraphics.
Definition: DtTextureInterface.h:26
std::vector< AtlasPage > myPages
All atlas pages, in allocation order.
Definition: DtTextureAtlas.h:170
std::vector< uint8_t > myPixels
CPU-side pixel buffer; theAtlasSize * theAtlasSize * 4 bytes (RGBA).
Definition: DtTextureAtlas.h:163
Definition: DtTextureAtlas.h:161
Contains makVrv::DtTextureInterface class.
std::map< std::pair< int, int >, std::unique_ptr< DtTextureAtlas > > myAtlases
Definition: DtTextureAtlas.h:201
Contains makVrv::DtVirtualBaseClass class.
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
Packs bitmaps into a series of 2048×2048 RGBA atlas pages.
Definition: DtTextureAtlas.h:62
int mySlotHeight
Height of each symbol slot in pixels.
Definition: DtTextureAtlas.h:169
DtDe & myDe
Engine context; not owned.
Definition: DtTextureAtlas.h:159
std::unique_ptr< DtTextureInterface > myTexture
Owned GPU texture for this page.
Definition: DtTextureAtlas.h:164
UV sub-rect identifying one symbol's location within an atlas page.
Definition: DtTextureAtlas.h:34
int mySlotWidth
Width of each symbol slot in pixels.
Definition: DtTextureAtlas.h:168
Per-DtDe manager that auto-creates and caches texture atlases by slot size.
Definition: DtTextureAtlas.h:180
int slotHeight() const
Return the individual slot height in pixels.
Definition: DtTextureAtlas.h:148
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76