KSvg

imagetexturescache.h
1/*
2 SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef IMAGETEXTURESCACHE_H
8#define IMAGETEXTURESCACHE_H
9
10#include <QQuickWindow>
11#include <QSharedPointer>
12
13class QImage;
14class QSGTexture;
15class ImageTexturesCachePrivate;
16
17/**
18 * @class ImageTexturesCache imagetexturescache.h KQuickAddons/ImageTexturesCache
19 *
20 * @short Helps to manage textures by creating images and reference counts them.
21 *
22 * Use this class as a factory for textures, when creating them from a QImage
23 * instance. Keeps track of all the created textures in a map between the
24 * QImage::cacheKey() and the cached texture until it gets de-referenced.
25 *
26 * @see ManagedTextureNode
27 */
29{
30public:
33
34 /**
35 * @returns the texture for a given @p window and @p image.
36 *
37 * If @p image id is the same as one already provided before, we will not
38 * create a new texture, and will instead return a shared pointer to the existing texture.
39 */
41
43
44private:
46};
47
48#endif // IMAGETEXTURESCACHE_H
Helps to manage textures by creating images and reference counts them.
QSharedPointer< QSGTexture > loadTexture(QQuickWindow *window, const QImage &image, QQuickWindow::CreateTextureOptions options)
typedef CreateTextureOptions
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 10 2024 11:47:10 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.