Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
shkyera::Image Class Reference

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
 
Imageoperator= (const Image &other)=delete
 
 Image (Image &&other) noexcept
 
Imageoperator= (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 constgetData () 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.
 

Detailed Description

A class for working with images and textures.

Constructor & Destructor Documentation

◆ Image() [1/3]

shkyera::Image::Image ( const std::filesystem::path &  path)

Constructor for loading an image from a file.

Parameters
pathThe path to the image file.

◆ Image() [2/3]

shkyera::Image::Image ( const Image other)
delete

◆ Image() [3/3]

shkyera::Image::Image ( Image &&  other)
noexcept

Member Function Documentation

◆ getChannels()

int shkyera::Image::getChannels ( ) const

◆ getData()

uint8_t const * shkyera::Image::getData ( ) const

◆ getHeight()

int shkyera::Image::getHeight ( ) const

◆ getWidth()

int shkyera::Image::getWidth ( ) const

◆ load()

void shkyera::Image::load ( const std::filesystem::path &  path)

Load an image from a file.

Parameters
pathThe path to the image file.

◆ operator=() [1/2]

Image & shkyera::Image::operator= ( const Image other)
delete

◆ operator=() [2/2]

Image & shkyera::Image::operator= ( Image &&  other)
noexcept

◆ save()

void shkyera::Image::save ( const std::filesystem::path &  path) const

Save the image to a file in PNG format.

Parameters
pathThe path to the output file.

Member Data Documentation

◆ _components

int shkyera::Image::_components
private

The number of color components.

◆ _data

uint8_t* shkyera::Image::_data
private

The image pixel data.

◆ _height

int shkyera::Image::_height
private

The height of the image.

◆ _width

int shkyera::Image::_width
private

The width of the image.

◆ ICON_BUTTON_PLAY

std::filesystem::path shkyera::Image::ICON_BUTTON_PLAY = "resources/icons/buttons/play.png"
static

◆ ICON_BUTTON_STOP

std::filesystem::path shkyera::Image::ICON_BUTTON_STOP = "resources/icons/buttons/stop.png"
static

◆ ICON_COMPONENT_SCRIPT

std::filesystem::path shkyera::Image::ICON_COMPONENT_SCRIPT = "resources/icons/components/script.png"
static

◆ ICON_COMPONENT_SHAPE

std::filesystem::path shkyera::Image::ICON_COMPONENT_SHAPE = "resources/icons/components/shape.png"
static

◆ ICON_COMPONENT_TRANSFORM

std::filesystem::path shkyera::Image::ICON_COMPONENT_TRANSFORM = "resources/icons/components/transform.png"
static

◆ ICON_CONSOLE_ERROR

std::filesystem::path shkyera::Image::ICON_CONSOLE_ERROR = "resources/icons/console/error.png"
static

◆ ICON_CONSOLE_INFO

std::filesystem::path shkyera::Image::ICON_CONSOLE_INFO = "resources/icons/console/info.png"
static

◆ ICON_CONSOLE_SUCCESS

std::filesystem::path shkyera::Image::ICON_CONSOLE_SUCCESS = "resources/icons/console/success.png"
static

◆ ICON_CONSOLE_TOTAL

std::filesystem::path shkyera::Image::ICON_CONSOLE_TOTAL = "resources/icons/console/total.png"
static

◆ ICON_CONSOLE_VERBOSE

std::filesystem::path shkyera::Image::ICON_CONSOLE_VERBOSE = "resources/icons/console/verbose.png"
static

◆ ICON_FILES_AUDIO

std::filesystem::path shkyera::Image::ICON_FILES_AUDIO = "resources/icons/files/audio.png"
static

◆ ICON_FILES_FOLDER

std::filesystem::path shkyera::Image::ICON_FILES_FOLDER = "resources/icons/files/folder.png"
static

◆ ICON_FILES_IMAGE

std::filesystem::path shkyera::Image::ICON_FILES_IMAGE = "resources/icons/files/image.png"
static

◆ ICON_FILES_PYTHON

std::filesystem::path shkyera::Image::ICON_FILES_PYTHON = "resources/icons/files/python.png"
static

◆ ICON_FILES_TEXT

std::filesystem::path shkyera::Image::ICON_FILES_TEXT = "resources/icons/files/text.png"
static

The documentation for this class was generated from the following files: