Shkyera Engine
Easy to use, game engine for Python
|
A class for working with images and textures. More...
#include <Image.hpp>
Public Member Functions | |
Image (size_t width, size_t height) | |
Constructor for creating an image with the specified width and height. More... | |
Image (std::filesystem::path path) | |
Constructor for loading an image from a file. More... | |
void | load (std::filesystem::path path) |
Load an image from a file. More... | |
void | save (std::filesystem::path path) const |
Save the image to a file in PNG format. More... | |
void | updateTextureId () |
Update the OpenGL texture ID associated with the image. More... | |
uint64_t | getTextureId () const |
Get the OpenGL texture ID associated with the image. More... | |
Static Public Attributes | |
static Image | ICON_CONSOLE_TOTAL = Image("resources/icons/console/total.png") |
static Image | ICON_CONSOLE_ERROR = Image("resources/icons/console/error.png") |
static Image | ICON_CONSOLE_INFO = Image("resources/icons/console/info.png") |
static Image | ICON_CONSOLE_VERBOSE = Image("resources/icons/console/verbose.png") |
static Image | ICON_CONSOLE_SUCCESS = Image("resources/icons/console/success.png") |
static Image | ICON_COMPONENT_TRANSFORM = Image("resources/icons/components/transform.png") |
static Image | ICON_COMPONENT_SCRIPT = Image("resources/icons/components/script.png") |
static Image | ICON_COMPONENT_SHAPE = Image("resources/icons/components/shape.png") |
static Image | ICON_FILES_FOLDER = Image("resources/icons/files/folder.png") |
static Image | ICON_FILES_PYTHON = Image("resources/icons/files/python.png") |
static Image | ICON_FILES_IMAGE = Image("resources/icons/files/image.png") |
static Image | ICON_FILES_TEXT = Image("resources/icons/files/text.png") |
static Image | ICON_BUTTON_PLAY = Image("resources/icons/buttons/play.png") |
static Image | ICON_BUTTON_STOP = Image("resources/icons/buttons/stop.png") |
Private Attributes | |
uint8_t * | _data |
The image pixel data. More... | |
int | _width |
The width of the image. More... | |
int | _height |
The height of the image. More... | |
int | _components |
The number of color components. More... | |
bool | _wasAssignedTextureId |
Flag indicating if the texture ID has been assigned. More... | |
uint64_t | _textureId |
The OpenGL texture ID. More... | |
A class for working with images and textures.
shkyera::Image::Image | ( | size_t | width, |
size_t | height | ||
) |
Constructor for creating an image with the specified width and height.
width | The width of the image. |
height | The height of the image. |
shkyera::Image::Image | ( | std::filesystem::path | path | ) |
Constructor for loading an image from a file.
path | The path to the image file. |
uint64_t shkyera::Image::getTextureId | ( | ) | const |
Get the OpenGL texture ID associated with the image.
void shkyera::Image::load | ( | std::filesystem::path | path | ) |
Load an image from a file.
path | The path to the image file. |
void shkyera::Image::save | ( | std::filesystem::path | path | ) | const |
Save the image to a file in PNG format.
path | The path to the output file. |
void shkyera::Image::updateTextureId | ( | ) |
Update the OpenGL texture ID associated with the image.
|
private |
The number of color components.
|
private |
The image pixel data.
|
private |
The height of the image.
|
private |
The OpenGL texture ID.
|
private |
Flag indicating if the texture ID has been assigned.
|
private |
The width of the image.
|
static |