Class that is internally used to load an image from a file or from memory.
More...
#include <TGUI/Loading/ImageLoader.hpp>
|
static std::unique_ptr< std::uint8_t[]> | loadFromFile (const String &filename, Vector2u &imageSize) |
| Loads an image from a file.
|
|
static std::unique_ptr< std::uint8_t[]> | loadFromMemory (const std::uint8_t *data, std::size_t dataSize, Vector2u &imageSize) |
| Loads an image from memory (data in memory should contain the entire file, not just the pixels)
|
|
Class that is internally used to load an image from a file or from memory.
◆ loadFromFile()
static std::unique_ptr< std::uint8_t[]> tgui::ImageLoader::loadFromFile |
( |
const String & | filename, |
|
|
Vector2u & | imageSize ) |
|
staticnodiscard |
Loads an image from a file.
- Parameters
-
filename | The file to load |
imageSize | Output parameter that will contain the width and height of the image if loaded successfully |
- Returns
- RGBA array of pixels of loaded image (4 * imageSize.x * imageSize.y bytes), or nullptr if loading failed
◆ loadFromMemory()
static std::unique_ptr< std::uint8_t[]> tgui::ImageLoader::loadFromMemory |
( |
const std::uint8_t * | data, |
|
|
std::size_t | dataSize, |
|
|
Vector2u & | imageSize ) |
|
staticnodiscard |
Loads an image from memory (data in memory should contain the entire file, not just the pixels)
- Parameters
-
data | Pointer to the file in memory |
dataSize | Amount of bytes of the file in memory |
imageSize | Output parameter that will contain the width and height of the image if loaded successfully |
- Returns
- RGBA array of pixels of loaded image (4 * imageSize.x * imageSize.y bytes), or nullptr if loading failed
The documentation for this struct was generated from the following file: