|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Abstract interface for image loading operations. More...
#include <image_service.h>
Public Member Functions | |
| virtual | ~IImageService ()=default |
| virtual void | clearCache ()=0 |
| Clear all cached images and free resources. | |
| virtual bool | getImageDimensions (const std::string &path, int *width, int *height) const =0 |
| Get dimensions of a loaded image. | |
| virtual bool | isImageLoaded (const std::string &path) const =0 |
| Check if an image is already loaded/cached. | |
| virtual bool | loadImage (const std::string &path, int *width=nullptr, int *height=nullptr)=0 |
| Load an image from disk. | |
| virtual void | unloadImage (const std::string &path)=0 |
| Unload a specific image and free resources. | |
Abstract interface for image loading operations.
The Qt UI layer implements this interface using QPixmap for image loading. The business logic layer uses this interface without knowing about the underlying graphics API.
Definition at line 34 of file image_service.h.
|
virtualdefault |
|
pure virtual |
Clear all cached images and free resources.
Implemented in core::NullImageService, and QtImageService.
|
pure virtual |
Get dimensions of a loaded image.
| path | Path to the image |
| width | Output parameter for width |
| height | Output parameter for height |
Implemented in core::NullImageService, and QtImageService.
|
pure virtual |
Check if an image is already loaded/cached.
| path | Path to check |
Implemented in core::NullImageService, and QtImageService.
|
pure virtual |
Load an image from disk.
| path | Path to the image file |
| width | Output parameter for image width (optional) |
| height | Output parameter for image height (optional) |
Implementations should cache the loaded image for subsequent calls.
Implemented in core::NullImageService, and QtImageService.
|
pure virtual |
Unload a specific image and free resources.
| path | Path of the image to unload |
Implemented in core::NullImageService, and QtImageService.