calamares/src/libcalamaresui/utils/ImageRegistry.h
Adriaan de Groot 1cd9b93a22 REUSE: Giant boilerplate cleanup
- point to main Calamares site in the 'part of' headers instead
  of to github (this is the "this file is part of Calamares"
  opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
  this is the 3-paragraph summary of the GPL-3.0-or-later, which has
  a meaning entirely covered by the SPDX tag.
2020-08-26 02:28:38 +02:00

42 lines
1.2 KiB
C++

/* === This file is part of Calamares - <https://calamares.io> ===
*
* 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