|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
#include <qt_image_service.h>
Public Member Functions | |
| QtImageService ()=default | |
| ~QtImageService () override=default | |
| void | clearCache () override |
| Clear all cached images and free resources. | |
| bool | getImageDimensions (const std::string &path, int *width, int *height) const override |
| Get dimensions of a loaded image. | |
| QPixmap | getPixmap (const std::string &path) |
| QPixmap | getScaledPixmap (const std::string &path, int maxWidth, int maxHeight) |
| bool | isImageLoaded (const std::string &path) const override |
| Check if an image is already loaded/cached. | |
| bool | loadImage (const std::string &path, int *width=nullptr, int *height=nullptr) override |
| Load an image from disk. | |
| void | unloadImage (const std::string &path) override |
| Unload a specific image and free resources. | |
| Public Member Functions inherited from core::IImageService | |
| virtual | ~IImageService ()=default |
Definition at line 18 of file qt_image_service.h.
|
default |
|
overridedefault |
|
overridevirtual |
Clear all cached images and free resources.
Implements core::IImageService.
Definition at line 77 of file qt_image_service.cpp.
|
overridevirtual |
Get dimensions of a loaded image.
| path | Path to the image |
| width | Output parameter for width |
| height | Output parameter for height |
Implements core::IImageService.
Definition at line 83 of file qt_image_service.cpp.
| QPixmap QtImageService::getPixmap | ( | const std::string & | path | ) |
Definition at line 104 of file qt_image_service.cpp.
Referenced by getScaledPixmap().
| QPixmap QtImageService::getScaledPixmap | ( | const std::string & | path, |
| int | maxWidth, | ||
| int | maxHeight ) |
Definition at line 137 of file qt_image_service.cpp.
References getPixmap().
|
overridevirtual |
Check if an image is already loaded/cached.
| path | Path to check |
Implements core::IImageService.
Definition at line 65 of file qt_image_service.cpp.
|
overridevirtual |
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.
Implements core::IImageService.
Definition at line 13 of file qt_image_service.cpp.
|
overridevirtual |
Unload a specific image and free resources.
| path | Path of the image to unload |
Implements core::IImageService.
Definition at line 71 of file qt_image_service.cpp.