calamares/src/libcalamaresui/utils/ImageRegistry.h
Adriaan de Groot 3480988f53 REUSE: SPDX tagging of application library and main
- CC0-1.0 for the uninteresting version-headers
- GPL-3.0-or-later for the services

- add SPDX identifiers to Calamares C++ libraries and application sources
- add SPDX identifiers to Calamares QML (panels and slideshow)
- the `qmldir` is a list of names of things in the directory,
  so CC0-1.0 it as "uninteresting"
- QRC files are lists of names of things in the directory,
  so CC0-1.0 them as well
2020-08-26 02:05:46 +02:00

42 lines
1.2 KiB
C++

/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* SPDX-FileCopyrightText: 2012 Christian Muehlhaeuser <muesli@tomahawk-player.org>
* SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef IMAGE_REGISTRY_H
#define IMAGE_REGISTRY_H
#include <QPixmap>
#include "DllMacro.h"
#include "utils/CalamaresUtilsGui.h"
class UIDLLEXPORT ImageRegistry
{
public:
static ImageRegistry* instance();
explicit ImageRegistry();
QIcon icon( const QString& image, CalamaresUtils::ImageMode mode = CalamaresUtils::Original );
QPixmap pixmap( const QString& image,
const QSize& size,
CalamaresUtils::ImageMode mode = CalamaresUtils::Original,
qreal opacity = 1.0,
QColor tint = QColor( 0, 0, 0, 0 ) );
private:
qint64 cacheKey( const QSize& size, qreal opacity, QColor tint );
void putInCache( const QString& image,
const QSize& size,
CalamaresUtils::ImageMode mode,
qreal opacity,
const QPixmap& pixmap,
QColor tint );
};
#endif // IMAGE_REGISTRY_H