Inheritance diagram for TextureSource:
Collaboration diagram for TextureSource:Public Member Functions | |
| TextureSource () | |
| virtual | ~TextureSource () |
| u32 | getTextureId (const std::string &name) |
| Generates a texture string into a standard texture. | |
| std::string | getTextureName (u32 id) |
| Returns name of existing texture by ID. | |
| video::ITexture * | getTexture (u32 id) |
| Returns existing texture by ID. | |
| video::ITexture * | getTexture (const std::string &name, u32 *id=nullptr) |
| Generates a texture string into a standard texture. | |
| video::ITexture * | addArrayTexture (const std::vector< std::string > &images, u32 *id=nullptr) |
| Generates texture string(s) into an array texture. | |
| bool | needFilterForMesh () const |
| Palette * | getPalette (const std::string &name) |
| Returns a palette from the given texture string. | |
| bool | isKnownSourceImage (const std::string &name) |
| Check if given image name exists. | |
| void | processQueue () |
| Fulfil texture requests from other threads. | |
| void | insertSourceImage (const std::string &name, video::IImage *img) |
| Inserts a source image. | |
| void | rebuildImagesAndTextures () |
| Rebuilds all textures (in case-source images have changed) | |
| video::SColor | getTextureAverageColor (const std::string &name) |
| Return average color of a texture string. | |
| core::dimension2du | getTextureDimensions (const std::string &image) |
| Return dimensions of a texture string (will avoid actually creating the texture) | |
| void | setImageCaching (bool enabled) |
| Enables or disables the caching of finished texture images. | |
Public Member Functions inherited from IWritableTextureSource | |
| IWritableTextureSource ()=default | |
| virtual | ~IWritableTextureSource ()=default |
Public Member Functions inherited from ITextureSource | |
| ITextureSource ()=default | |
| virtual | ~ITextureSource ()=default |
| video::ITexture * | getTextureForMesh (const std::string &image, u32 *id=nullptr) |
| Generates a texture string into a standard texture Filters will be applied to make the texture suitable for mipmapping and linear filtering during rendering. | |
Public Member Functions inherited from ISimpleTextureSource | |
| ISimpleTextureSource ()=default | |
| virtual | ~ISimpleTextureSource ()=default |
Private Member Functions | |
| video::IImage * | getOrGenerateImage (const std::string &name, std::set< std::string > &source_image_names) |
| void | rebuildTexture (video::IVideoDriver *driver, TextureInfo &ti) |
| u32 | processRequestQueued (const TextureRequest &req) |
| u32 | processRequest (const TextureRequest &req) |
| u32 | generateTexture (const std::string &name) |
| u32 | generateArrayTexture (const std::vector< std::string > &names) |
Private Attributes | |
| std::thread::id | m_main_thread |
| ImageSource | m_imagesource |
| bool | m_image_cache_enabled = false |
| std::unordered_map< std::string, ImageInfo > | m_image_cache |
| MutexedMap< std::string, bool > | m_source_image_existence |
| std::vector< TextureInfo > | m_textureinfo_cache |
| std::unordered_map< std::string, u32 > | m_name_to_id |
| std::mutex | m_textureinfo_cache_mutex |
| RequestQueue< TextureRequest, u32, std::thread::id, char > | m_get_texture_queue |
| std::vector< video::ITexture * > | m_texture_trash |
| std::unordered_map< std::string, Palette > | m_palettes |
| bool | mesh_filter_needed |
Additional Inherited Members | |
Static Public Attributes inherited from ITextureSource | |
| static constexpr const char * | FILTER_FOR_MESH = "^[applyfiltersformesh" |
| Filter needed for mesh-suitable textures, including leading ^. | |
| TextureSource::TextureSource | ( | ) |
References g_settings, Settings::getBool(), m_main_thread, m_name_to_id, m_textureinfo_cache, and mesh_filter_needed.
Here is the call graph for this function:
|
virtual |
References RenderingEngine::get_video_driver(), infostream, m_image_cache, m_texture_trash, and m_textureinfo_cache.
Here is the call graph for this function:
|
virtual |
Generates texture string(s) into an array texture.
Implements ITextureSource.
References getTexture(), and processRequestQueued().
Here is the call graph for this function:
|
private |
References errorstream, RenderingEngine::get_video_driver(), getOrGenerateImage(), m_name_to_id, m_textureinfo_cache, m_textureinfo_cache_mutex, porting::mt_snprintf(), sanity_check, and warningstream.
Referenced by processRequest().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
References RenderingEngine::get_video_driver(), getOrGenerateImage(), guiScalingCache(), infostream, m_main_thread, m_name_to_id, m_textureinfo_cache, m_textureinfo_cache_mutex, sanity_check, and warningstream.
Referenced by processRequest().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
References ImageSource::generateImage(), m_image_cache, m_image_cache_enabled, and m_imagesource.
Referenced by generateArrayTexture(), generateTexture(), getPalette(), getTextureAverageColor(), getTextureDimensions(), and rebuildTexture().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Returns a palette from the given texture string.
The pointer is valid until the texture source is destructed. Must be called from the main thread.
Implements ITextureSource.
References getOrGenerateImage(), m_main_thread, m_palettes, sanity_check, and warningstream.
Here is the call graph for this function:
|
virtual |
Generates a texture string into a standard texture.
Reimplemented from ITextureSource.
References getTexture(), and getTextureId().
Here is the call graph for this function:
|
virtual |
Returns existing texture by ID.
Implements ITextureSource.
References m_textureinfo_cache, and m_textureinfo_cache_mutex.
Referenced by addArrayTexture(), and getTexture().
Here is the caller graph for this function:
|
virtual |
Return average color of a texture string.
Implements ITextureSource.
References getOrGenerateImage(), imageAverageColor(), and m_main_thread.
Here is the call graph for this function:
|
virtual |
Return dimensions of a texture string (will avoid actually creating the texture)
Implements ITextureSource.
References getOrGenerateImage(), and m_main_thread.
Here is the call graph for this function:
|
virtual |
Generates a texture string into a standard texture.
Implements ITextureSource.
References m_name_to_id, m_textureinfo_cache_mutex, and processRequestQueued().
Referenced by getTexture().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Returns name of existing texture by ID.
Implements ITextureSource.
References errorstream, m_textureinfo_cache, and m_textureinfo_cache_mutex.
|
virtual |
Inserts a source image.
Must be called from the main thread. Takes ownership of img
Implements IWritableTextureSource.
References RenderingEngine::get_video_driver(), ImageSource::insertSourceImage(), m_imagesource, m_main_thread, m_source_image_existence, m_textureinfo_cache, m_textureinfo_cache_mutex, rebuildTexture(), sanity_check, MutexedMap< Key, Value >::set(), and verbosestream.
Here is the call graph for this function:
|
inlinevirtual |
Check if given image name exists.
Implements ITextureSource.
References MutexedMap< Key, Value >::get(), getTexturePath(), m_source_image_existence, and MutexedMap< Key, Value >::set().
Here is the call graph for this function:
|
inlinevirtual |
Implements ITextureSource.
References mesh_filter_needed.
|
virtual |
Fulfil texture requests from other threads.
Implements IWritableTextureSource.
References RequestQueue< Key, T, Caller, CallerData >::empty(), m_get_texture_queue, RequestQueue< Key, T, Caller, CallerData >::pop(), processRequest(), and RequestQueue< Key, T, Caller, CallerData >::pushResult().
Here is the call graph for this function:
|
private |
References errorstream, generateArrayTexture(), generateTexture(), TextureRequest::images, and TextureRequest::type.
Referenced by processQueue(), and processRequestQueued().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
References RequestQueue< Key, T, Caller, CallerData >::add(), errorstream, infostream, m_get_texture_queue, m_main_thread, TextureRequest::print(), and processRequest().
Referenced by addArrayTexture(), and getTextureId().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Rebuilds all textures (in case-source images have changed)
Implements IWritableTextureSource.
References RenderingEngine::get_video_driver(), infostream, m_image_cache, m_image_cache_enabled, m_textureinfo_cache, m_textureinfo_cache_mutex, rebuildTexture(), and sanity_check.
Here is the call graph for this function:
|
private |
References getOrGenerateImage(), guiScalingCache(), infostream, m_main_thread, m_texture_trash, TextureInfo::name, sanity_check, TextureInfo::sourceImages, TextureInfo::texture, TextureInfo::type, and warningstream.
Referenced by insertSourceImage(), and rebuildImagesAndTextures().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Enables or disables the caching of finished texture images.
This can be useful if you want to call getTextureAverageColor without duplicating work.
Reimplemented from ITextureSource.
References m_image_cache, and m_image_cache_enabled.
|
private |
Referenced by processQueue(), and processRequestQueued().
|
private |
Referenced by ~TextureSource(), getOrGenerateImage(), rebuildImagesAndTextures(), and setImageCaching().
|
private |
Referenced by getOrGenerateImage(), rebuildImagesAndTextures(), and setImageCaching().
|
private |
Referenced by getOrGenerateImage(), and insertSourceImage().
|
private |
|
private |
Referenced by TextureSource(), generateArrayTexture(), generateTexture(), and getTextureId().
|
private |
Referenced by getPalette().
|
private |
Referenced by insertSourceImage(), and isKnownSourceImage().
|
private |
Referenced by ~TextureSource(), and rebuildTexture().
|
private |
|
private |
|
private |
Referenced by TextureSource(), and needFilterForMesh().