TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicimageutils.h
Go to the documentation of this file.
1 #ifndef MUSICIMAGEUTILS_H
2 #define MUSICIMAGEUTILS_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2024 Greedysky Studio
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License along
19  * with this program; If not, see <http://www.gnu.org/licenses/>.
20  ***************************************************************************/
21 
22 #include "musicglobaldefine.h"
23 
27 namespace TTK
28 {
29  namespace Image
30  {
34  TTK_MODULE_EXPORT QPixmap roundedPixmap(const QPixmap &input, int ratioX, int ratioY);
38  TTK_MODULE_EXPORT QPixmap roundedPixmap(const QPixmap &input, const QSize &size, int ratioX, int ratioY);
42  TTK_MODULE_EXPORT QPixmap roundedPixmap(const QPixmap &input, const QRect &rect, int ratioX, int ratioY);
46  TTK_MODULE_EXPORT QPixmap roundedPixmap(const QPixmap &input, const QPixmap &mask, const QSize &size);
50  TTK_MODULE_EXPORT QBitmap generateMask(const QRect &rect, int ratioX, int ratioY);
51 
55  TTK_MODULE_EXPORT QByteArray generatePixmapData(const QPixmap &input);
56 
60  TTK_MODULE_EXPORT void fusionPixmap(QImage &back, const QImage &front, const QPoint &pt);
64  TTK_MODULE_EXPORT void fusionPixmap(QPixmap &back, const QPixmap &front, const QPoint &pt);
65 
69  TTK_MODULE_EXPORT unsigned int colorContrast(const unsigned int color);
73  TTK_MODULE_EXPORT QPixmap grayScalePixmap(const QPixmap &input, int radius = 0);
74 
78  template <typename T>
79  TTK_MODULE_EXPORT T reRenderValue(const T &key, const T &alpha, const T &value)
80  {
81  if(alpha < TTK_RN_MIN)
82  {
83  return TTK_RN_MIN;
84  }
85  else if(alpha > key)
86  {
87  return key;
88  }
89  return (key - alpha) * 1.0 / TTK_RN_MAX * value + alpha;
90  }
91 
95  TTK_MODULE_EXPORT void reRenderImage(int delta, const QImage *input, QImage *output);
96 
97  }
98 }
99 
100 #endif // MUSICIMAGEUTILS_H
#define TTK_MODULE_EXPORT
#define T(v)
Definition: http_parser.c:237
static constexpr wchar_t key[]
voidpf void uLong size
Definition: ioapi.h:136
TTK_MODULE_EXPORT QPixmap grayScalePixmap(const QPixmap &input, int radius=0)
#define TTK_RN_MAX
Definition: ttkglobal.h:359
TTK_MODULE_EXPORT QPixmap roundedPixmap(const QPixmap &input, int ratioX, int ratioY)
TTK_MODULE_EXPORT QByteArray generatePixmapData(const QPixmap &input)
TTK_MODULE_EXPORT T reRenderValue(const T &key, const T &alpha, const T &value)
TTK_MODULE_EXPORT QBitmap generateMask(const QRect &rect, int ratioX, int ratioY)
The namespace of the process utils.
Definition: ttkcompat.h:24
#define TTK_RN_MIN
Definition: ttkglobal.h:358
TTK_MODULE_EXPORT unsigned int colorContrast(const unsigned int color)
static unsigned char alpha[symbols+1]
Definition: rsecc.c:50
TTK_MODULE_EXPORT void reRenderImage(int delta, const QImage *input, QImage *output)
TTK_MODULE_EXPORT void fusionPixmap(QImage &back, const QImage &front, const QPoint &pt)