Krita Source Code Documentation
Loading...
Searching...
No Matches
KisResourceThumbnailCache.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023 Sharaf Zaman <shzam@sdf.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef __KISRESOURCETHUMBNAILCACHE_H_
8#define __KISRESOURCETHUMBNAILCACHE_H_
9
10#include <QImage>
11#include <QScopedPointer>
12
13#include "kritaresources_export.h"
14
15class QModelIndex;
16
17class KRITARESOURCES_EXPORT KisResourceThumbnailCache
18{
19public:
22
24
25 QImage getImage(const QModelIndex &index,
26 const QSize size = QSize(-1, -1),
27 Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
28 Qt::TransformationMode transformMode = Qt::FastTransformation);
29
30private:
32 friend class KisResourceLocator;
33 friend class KisStorageModel;
34
35 /*
36 * Check if we have the original image in the cache.
37 */
38 QImage originalImage(const QString &storageLocation, const QString &resourceType, const QString &filename) const;
39 void insert(const QString &storageLocation,
40 const QString &resourceType,
41 const QString &filename,
42 const QImage &image);
43 void insert(const QPair<QString, QString> &key, const QImage &image);
44
45 void remove(const QString &storageLocation, const QString &resourceType, const QString &filename);
46 void remove(const QPair<QString, QString> &key);
47
48private:
49 struct Private;
50 QScopedPointer<Private> m_d;
51};
52
53#endif // __KISRESOURCETHUMBNAILCACHE_H_
PythonPluginManager * instance
QScopedPointer< Private > m_d