ImageTexturesCache

Search for usage in LXR

ImageTexturesCache Class Reference

#include <KQuickAddons/ImageTexturesCache>

Public Member Functions

QSharedPointer< QSGTextureloadTexture (QQuickWindow *window, const QImage &image)
 
QSharedPointer< QSGTextureloadTexture (QQuickWindow *window, const QImage &image, QQuickWindow::CreateTextureOptions options)
 

Detailed Description

Helps to manage textures by creating images and reference counts them.

Use this class as a factory for textures, when creating them from a QImage instance. Keeps track of all the created textures in a map between the QImage::cacheKey() and the cached texture until it gets de-referenced.

See also
ManagedTextureNode

Definition at line 28 of file imagetexturescache.h.

Constructor & Destructor Documentation

◆ ImageTexturesCache()

ImageTexturesCache::ImageTexturesCache ( )

Definition at line 18 of file imagetexturescache.cpp.

◆ ~ImageTexturesCache()

ImageTexturesCache::~ImageTexturesCache ( )

Definition at line 23 of file imagetexturescache.cpp.

Member Function Documentation

◆ loadTexture() [1/2]

QSharedPointer< QSGTexture > ImageTexturesCache::loadTexture ( QQuickWindow * window,
const QImage & image )

Definition at line 55 of file imagetexturescache.cpp.

◆ loadTexture() [2/2]

QSharedPointer< QSGTexture > ImageTexturesCache::loadTexture ( QQuickWindow * window,
const QImage & image,
QQuickWindow::CreateTextureOptions options )
Returns
the texture for a given window and image.

If image id is the same as one already provided before, we will not create a new texture, and will instead return a shared pointer to the existing texture.

Definition at line 27 of file imagetexturescache.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.