Ketchup Engine
Loading...
Searching...
No Matches
ImageManager Class Reference

#include <ImageManager.h>

Collaboration diagram for ImageManager:
Collaboration graph

Public Types

using MapKey = std::string
 
using StorageMap = std::unordered_map< MapKey, Image * >
 

Static Public Member Functions

static void Load (MapKey k, Texture *tex, int x=0, int y=0, int w=0, int h=0)
 Creates an Image using the Texture and dimensions specified and associates it with Key k.
 
static Image * Get (MapKey k)
 Gets the Image associated with the given MapKey.
 

Private Member Functions

 ImageManager ()=default
 
 ImageManager (const ImageManager &)=delete
 
ImageManageroperator= (const ImageManager &)=delete
 
 ~ImageManager ()
 

Static Private Member Functions

static ImageManagerInstance ()
 
static void Free ()
 

Private Attributes

StorageMap m_images
 

Static Private Attributes

static ImageManagerp_instance
 

Friends

class ImageManagerAttorney
 

Member Typedef Documentation

◆ MapKey

using ImageManager::MapKey = std::string

◆ StorageMap

using ImageManager::StorageMap = std::unordered_map<MapKey, Image*>

Constructor & Destructor Documentation

◆ ImageManager() [1/2]

ImageManager::ImageManager ( )
privatedefault

◆ ImageManager() [2/2]

ImageManager::ImageManager ( const ImageManager )
privatedelete

◆ ~ImageManager()

ImageManager::~ImageManager ( )
private

Member Function Documentation

◆ Free()

void ImageManager::Free ( )
staticprivate

◆ Get()

Image * ImageManager::Get ( MapKey  k)
static

Gets the Image associated with the given MapKey.

Haru, 3/8/2023.

Parameters
kThe MapKey (string).
Returns
A pointer to the Image.

◆ Instance()

ImageManager * ImageManager::Instance ( )
staticprivate

◆ Load()

void ImageManager::Load ( MapKey  k,
Texture *  tex,
int  x = 0,
int  y = 0,
int  w = 0,
int  h = 0 
)
static

Creates an Image using the Texture and dimensions specified and associates it with Key k.

Haru, 3/8/2023.

Parameters
kA MapKey (string) to associate the Image with.
texThe Texture from which to create the Image
x(Optional) The desired top-left x coordinate. Default to 0.
y(Optional) The desired top-left y coordinate. Default to 0.
w(Optional) The desired width in pixels. Defaults to the width of the Texture.
h(Optional) The desired height in pixels. Defaults to the height of the Texture.

◆ operator=()

ImageManager & ImageManager::operator= ( const ImageManager )
privatedelete

Friends And Related Function Documentation

◆ ImageManagerAttorney

friend class ImageManagerAttorney
friend

Member Data Documentation

◆ m_images

StorageMap ImageManager::m_images
private

◆ p_instance

ImageManager * ImageManager::p_instance
staticprivate

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