3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/renderer/ImageResourceManager.h"
7#include "mc/client/renderer/texture/AtlasParameters.h"
8#include "mc/client/renderer/texture/ParsedAtlasData.h"
9#include "mc/client/renderer/texture/TextureAtlasStatus.h"
10#include "mc/deps/core/resource/ResourceLocation.h"
11#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
12#include "mc/deps/core/utility/NonOwnerPointer.h"
13#include "mc/deps/core_graphics/MipMapSupport.h"
14#include "mc/deps/core_graphics/TextureAtlas.h"
28namespace Json {
class Value; }
31namespace mce {
class Color; }
40 using SourceImageBuffers = ::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>;
42 using TextureAtlasTiles = ::std::vector<::TextureAtlasTile>;
44 using StatusCallback = ::std::function<void(::TextureAtlasStatus
const&)>;
46 using ImageAtlasFinishedCallback = ::std::function<void()>
const;
48 using RuntimeImageGenerators = ::std::vector<::std::weak_ptr<::RuntimeImageGeneratorInfo>>;
50 using SourceImagesSignature = void(::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>
const&);
55 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AtlasItemManager>> mAtlasItemManager;
56 ::ll::TypedStorage<8, 240, ::ParsedAtlasData> mParsedAtlasData;
57 ::ll::TypedStorage<4, 4, ::AtlasParameters> mAtlasParameters;
58 ::ll::TypedStorage<8, 16, ::std::set<::ResourceLocation>> mResources;
59 ::ll::TypedStorage<8, 64, ::ImageResourceManager> mResourceManager;
60 ::ll::TypedStorage<8, 24, ::std::vector<::mce::FileWatcherHandle>> mFileWatcherHandle;
61 ::ll::TypedStorage<8, 24, ::std::vector<::std::weak_ptr<::RuntimeImageGeneratorInfo>>> mRuntimeImageGenerators;
62 ::ll::TypedStorage<8, 88, ::cg::TextureAtlas> mTextureAtlas;
63 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager>>
64 mPBRTextureDataManager;
74 virtual ~TextureAtlas() ;
81 ::ResourceLocation
const& metaFile,
82 ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager> pbrTextureDataManager
85 MCAPI
void _addElementCollection(
86 ::ResourcePackManager& resourcePackManager,
87 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
88 ::Json::Value
const& texture,
89 ::ParsedAtlasNode& newNode,
92 ::mce::Color
const& mipFadeColor,
96 MCAPI ::TextureAtlasTile* _addTile(
97 ::std::vector<::TextureAtlasTile>& textureAtlasTiles,
99 float fadePerMipAmount,
100 ::ParsedAtlasNodeElement& element
103 MCAPI
void _calculateAtlasTilesDimensions(
104 ::AbstractTextureAccessor& textureAccessor,
105 ::std::vector<::TextureAtlasTile>& textureAtlasTiles,
106 uint maxTileDimension
109 MCAPI ::TextureAtlasResourceCallbacks _createAtlas(
110 ::Json::Value
const& root,
111 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
112 ::std::function<
void()> imageAtlasFinishedCallback,
113 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
114 ::cg::MipMapSupport mipMapSupport,
115 ::ResourcePackManager& resourcePackManager,
116 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
117 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
118 outCopyOfSourceImages
121 MCAPI ::std::vector<::TextureAtlasTile> _generateAtlasTileList();
123 MCAPI
void _loadAtlasNodes(
124 ::ResourcePackManager& resourcePackManager,
125 ::Json::Value
const& root,
126 ::std::vector<::ParsedAtlasNode>& atlasNodes,
127 ::std::shared_ptr<::mce::TextureGroup> textureGroup
130 MCAPI
void _loadRuntimeImageAtlasNodes(::std::vector<::ParsedAtlasNode>& atlasNodes);
132 MCAPI
bool _readNode(
133 ::ResourcePackManager& resourcePackManager,
134 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
135 ::Json::Value
const& jsonNode,
136 ::ParsedAtlasNode& node,
140 MCAPI
void addRuntimeImageGenerator(::std::weak_ptr<::RuntimeImageGeneratorInfo> info);
142 MCAPI ::TextureAtlasResourceCallbacks createAtlasFromJson(
143 ::Json::Value
const& json,
144 ::ResourcePackManager& resourcePackManager,
145 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
146 ::std::function<
void()> imageAtlasFinishedCallback,
147 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
148 ::cg::MipMapSupport mipMapSupport,
149 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
150 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
151 outCopyOfSourceImages
154 MCAPI ::TextureAtlasResourceCallbacks createAtlasFromList(
155 ::std::string
const& atlasName,
156 ::std::vector<::std::string>
const& textures,
157 ::ResourcePackManager& resourcePackManager,
158 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
159 ::std::function<
void()> imageAtlasFinishedCallback,
160 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
161 ::cg::MipMapSupport mipMapSupport,
162 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
163 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
164 outCopyOfSourceImages
167 MCAPI uint getColorMipCount()
const;
169 MCAPI ::ResourceLocation
const& getPathFromName(::std::string
const& name)
const;
171 MCAPI ::TextureAtlasItem
const& getTextureItem(::std::string
const& textureName)
const;
173 MCAPI ::TextureAtlasItemTextureSetTranslation
const& getTextureItemTextureSetTranslation(
int index)
const;
175 MCAPI uint64 getUsedMemory()
const;
177 MCAPI ::TextureAtlasResourceCallbacks loadMetaFile(
178 ::ResourcePackManager& resourcePackManager,
179 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
180 ::std::function<
void()> imageAtlasFinishedCallback,
181 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
182 ::cg::MipMapSupport mipMapSupport,
183 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
184 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
185 outCopyOfSourceImages
188 MCAPI ::TextureAtlasResourceCallbacks recreateAtlas(
189 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
190 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
191 ::std::function<
void()> imageAtlasFinishedCallback,
192 ::cg::MipMapSupport mipMapSupport,
193 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
194 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
195 outCopyOfSourceImages
203 ::ResourceLocation
const& metaFile,
204 ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager> pbrTextureDataManager
Definition AbstractTextureAccessor.h:5
Definition AtlasItemManager.h:5
Definition EnableNonOwnerReferences.h:7
Definition ResourcePackManager.h:35
Definition TextureAtlasItem.h:5
Definition TextureAtlasTile.h:5
Definition TextureAtlas.h:5
static MCAPI void ** $vftable()
Definition ImageBuffer.h:16
Definition TextureSetImageContainer.h:20
Definition FileWatcherHandle.h:12
Definition TextureGroup.h:7
Definition PBRTextureDataManager.h:7
Definition ParsedAtlasNodeElement.h:5
Definition ParsedAtlasNode.h:5
Definition RuntimeImageGeneratorInfo.h:5
Definition TextureAtlasItemTextureSetTranslation.h:5
Definition TextureAtlasResourceCallbacks.h:5