game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
async_image_loader.h File Reference
#include <QMutex>
#include <QObject>
#include <QPixmap>
#include <QRunnable>
#include <QSize>
#include <QString>
#include <QThreadPool>
#include <atomic>
#include <deque>
#include <functional>
#include <memory>
#include <unordered_map>
Include dependency graph for async_image_loader.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AsyncImageLoader
 Async image loader using QThreadPool. More...
class  ImageCache
 Thread-safe LRU cache for scaled images. More...
struct  ImageLoadRequest
 Request for loading an image asynchronously. More...
struct  ImageLoadResult
 Result of an async image load operation. More...

Functions

QString makeImageCacheKey (const QString &gameId, const QSize &size, const QString &imageType=QString())
 Generate cache key for an image at a specific size.
QSize quantizeSize (const QSize &size, int step=16)
 Round size to nearest quantization step for cache efficiency.

Function Documentation

◆ makeImageCacheKey()

QString makeImageCacheKey ( const QString & gameId,
const QSize & size,
const QString & imageType = QString() )
inline

Generate cache key for an image at a specific size.

Definition at line 201 of file async_image_loader.h.

References quantizeSize().

◆ quantizeSize()

QSize quantizeSize ( const QSize & size,
int step = 16 )
inline

Round size to nearest quantization step for cache efficiency.

E.g., with step=16: 147x223 → 144x224 This increases cache hit rate during smooth resize operations.

Definition at line 192 of file async_image_loader.h.

Referenced by makeImageCacheKey().