|
NWengine 0.9
|
Represents an image asset. More...
#include <Image.h>
Public Member Functions | |
| Image ()=default | |
| Default constructor for Image. | |
| Image (const std::string &x, uint8 *buf, int ch, int w, int h, bool a) | |
| Constructor for Image. | |
| Asset * | LoadFromFile (const char *path, void *output) override |
| Loads an image from a file. | |
| void | Clean () override |
| Cleans up the image asset. | |
Public Member Functions inherited from Asset | |
| virtual Asset * | GetFromCache (void *identifier) |
| Get the asset from the cache based on the identifier. | |
| virtual Asset * | LoadFromFileOrGetFromCache (void *identifier, const char *path, void *data) |
| Load the asset from file or get it from the cache based on the identifier and file path. | |
| virtual Asset * | LoadFromBuffer (void *buffer, void *data) |
| Load the asset from a buffer. | |
| virtual Asset * | LoadFromBufferOrGetFromCache (void *identifier, void *buffer, void *data) |
| Load the asset from a buffer or get it from the cache based on the identifier. | |
Public Attributes | |
| std::string | path = "" |
| uint8 * | pixelBuffer = nullptr |
| int | channels = 0 |
| int | width = 0 |
| int | height = 0 |
| bool | alpha = 0 |
Public Attributes inherited from Asset | |
| int | _usageCounter = 0 |
Represents an image asset.
Constructor for Image.
| x | The file path of the image. |
| buf | The pixel buffer of the image. |
| ch | The number of color channels in the image. |
| w | The width of the image. |
| h | The height of the image. |
| a | Indicates whether the image has an alpha channel. |
Loads an image from a file.
| path | The file path of the image. |
| output | The output buffer. |
Reimplemented from Asset.
| bool Image::alpha = 0 |
Indicates whether the image has an alpha channel.
| int Image::channels = 0 |
The number of color channels in the image.
| int Image::height = 0 |
The height of the image.
| std::string Image::path = "" |
The file path of the image.
| uint8* Image::pixelBuffer = nullptr |
The pixel buffer of the image.
| int Image::width = 0 |
The width of the image.