![]() |
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 (const std::filesystem::path &path) | |
Constructor for loading an image from a file. | |
Image (const Image &other)=delete | |
Image & | operator= (const Image &other)=delete |
Image (Image &&other) noexcept | |
Image & | operator= (Image &&other) noexcept |
void | load (const std::filesystem::path &path) |
Load an image from a file. | |
void | save (const std::filesystem::path &path) const |
Save the image to a file in PNG format. | |
uint8_t const * | getData () const |
int | getWidth () const |
int | getHeight () const |
int | getChannels () const |
Static Public Attributes | |
static std::filesystem::path | ICON_CONSOLE_TOTAL = "resources/icons/console/total.png" |
static std::filesystem::path | ICON_CONSOLE_ERROR = "resources/icons/console/error.png" |
static std::filesystem::path | ICON_CONSOLE_INFO = "resources/icons/console/info.png" |
static std::filesystem::path | ICON_CONSOLE_VERBOSE = "resources/icons/console/verbose.png" |
static std::filesystem::path | ICON_CONSOLE_SUCCESS = "resources/icons/console/success.png" |
static std::filesystem::path | ICON_COMPONENT_TRANSFORM = "resources/icons/components/transform.png" |
static std::filesystem::path | ICON_COMPONENT_SCRIPT = "resources/icons/components/script.png" |
static std::filesystem::path | ICON_COMPONENT_SHAPE = "resources/icons/components/shape.png" |
static std::filesystem::path | ICON_FILES_FOLDER = "resources/icons/files/folder.png" |
static std::filesystem::path | ICON_FILES_PYTHON = "resources/icons/files/python.png" |
static std::filesystem::path | ICON_FILES_IMAGE = "resources/icons/files/image.png" |
static std::filesystem::path | ICON_FILES_TEXT = "resources/icons/files/text.png" |
static std::filesystem::path | ICON_FILES_AUDIO = "resources/icons/files/audio.png" |
static std::filesystem::path | ICON_BUTTON_PLAY = "resources/icons/buttons/play.png" |
static std::filesystem::path | ICON_BUTTON_STOP = "resources/icons/buttons/stop.png" |
Private Attributes | |
uint8_t * | _data |
The image pixel data. | |
int | _width |
The width of the image. | |
int | _height |
The height of the image. | |
int | _components |
The number of color components. | |
A class for working with images and textures.
shkyera::Image::Image | ( | const std::filesystem::path & | path | ) |
Constructor for loading an image from a file.
path | The path to the image file. |
|
noexcept |
int shkyera::Image::getChannels | ( | ) | const |
int shkyera::Image::getHeight | ( | ) | const |
int shkyera::Image::getWidth | ( | ) | const |
Load an image from a file.
path | The path to the image file. |
Save the image to a file in PNG format.
path | The path to the output file. |
|
private |
The number of color components.
|
private |
The image pixel data.
|
private |
The height of the image.
|
private |
The width of the image.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |