48 virtual bool loadImage(
const std::string& path,
int* width =
nullptr,
49 int* height =
nullptr) = 0;
101 static void setInstance(std::shared_ptr<IImageService> service);
114 static std::shared_ptr<IImageService>
instance();
123 static std::shared_ptr<IImageService> instance_;
137 bool loadImage(
const std::string& ,
int* width =
nullptr,
138 int* height =
nullptr)
override
Abstract interface for image loading operations.
virtual bool getImageDimensions(const std::string &path, int *width, int *height) const =0
Get dimensions of a loaded image.
virtual void unloadImage(const std::string &path)=0
Unload a specific image and free resources.
virtual bool isImageLoaded(const std::string &path) const =0
Check if an image is already loaded/cached.
virtual ~IImageService()=default
virtual void clearCache()=0
Clear all cached images and free resources.
virtual bool loadImage(const std::string &path, int *width=nullptr, int *height=nullptr)=0
Load an image from disk.
Singleton accessor for the image service.
static bool hasInstance()
Check if an image service has been set.
static std::shared_ptr< IImageService > instance()
Get the image service instance.
static void setInstance(std::shared_ptr< IImageService > service)
Set the image service implementation.
No-op implementation for headless/testing scenarios.
void unloadImage(const std::string &) override
Unload a specific image and free resources.
bool isImageLoaded(const std::string &) const override
Check if an image is already loaded/cached.
bool loadImage(const std::string &, int *width=nullptr, int *height=nullptr) override
Load an image from disk.
void clearCache() override
Clear all cached images and free resources.
bool getImageDimensions(const std::string &, int *width, int *height) const override
Get dimensions of a loaded image.