game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
core::NullImageService Class Reference

No-op implementation for headless/testing scenarios. More...

#include <image_service.h>

Inheritance diagram for core::NullImageService:
Collaboration diagram for core::NullImageService:

Public Member Functions

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.
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 unloadImage (const std::string &) override
 Unload a specific image and free resources.
Public Member Functions inherited from core::IImageService
virtual ~IImageService ()=default

Detailed Description

No-op implementation for headless/testing scenarios.

Definition at line 134 of file image_service.h.

Member Function Documentation

◆ clearCache()

void core::NullImageService::clearCache ( )
inlineoverridevirtual

Clear all cached images and free resources.

Implements core::IImageService.

Definition at line 154 of file image_service.h.

◆ getImageDimensions()

bool core::NullImageService::getImageDimensions ( const std::string & path,
int * width,
int * height ) const
inlineoverridevirtual

Get dimensions of a loaded image.

Parameters
pathPath to the image
widthOutput parameter for width
heightOutput parameter for height
Returns
true if image is loaded and dimensions retrieved

Implements core::IImageService.

Definition at line 156 of file image_service.h.

◆ isImageLoaded()

bool core::NullImageService::isImageLoaded ( const std::string & path) const
inlineoverridevirtual

Check if an image is already loaded/cached.

Parameters
pathPath to check
Returns
true if image is cached

Implements core::IImageService.

Definition at line 147 of file image_service.h.

◆ loadImage()

bool core::NullImageService::loadImage ( const std::string & path,
int * width = nullptr,
int * height = nullptr )
inlineoverridevirtual

Load an image from disk.

Parameters
pathPath to the image file
widthOutput parameter for image width (optional)
heightOutput parameter for image height (optional)
Returns
true if loading succeeded, false otherwise

Implementations should cache the loaded image for subsequent calls.

Implements core::IImageService.

Definition at line 137 of file image_service.h.

◆ unloadImage()

void core::NullImageService::unloadImage ( const std::string & path)
inlineoverridevirtual

Unload a specific image and free resources.

Parameters
pathPath of the image to unload

Implements core::IImageService.

Definition at line 152 of file image_service.h.


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