Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_normal_preview_widget.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * SPDX-FileCopyrightText: 2015 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#ifndef KISNORMALPREVIEWWIDGET_H
9#define KISNORMALPREVIEWWIDGET_H
10
11#include <QLabel>
12
13/* This is a widget that takes an image of a normal semi-sphere, and inverts the channels based on the values
14 * of m_redChannel, m_greenChannel and m_blueChannel, this is used to give feedback on a set of normal-swizzles.
15 * setRedChannel, setGreenChannel and setBlueChannel automatically updates the image with the new channel configuration.
16 */
17
18class KisNormalPreviewWidget : public QLabel
19{
20 Q_OBJECT
21public:
22
23 KisNormalPreviewWidget(QWidget* parent = 0);
24 ~KisNormalPreviewWidget() override;
25
26public Q_SLOTS:
27 /* for the following functions 0=X+, 1=X-, 2=Y+, 3=Y-, 4=Z+ and 5=Z-*/
28 void setRedChannel(int index);
29 void setGreenChannel(int index);
30 void setBlueChannel(int index);
31
32private:
33
34 void updateImage();
35 QImage swizzleTransformPreview (QImage preview);
36 int previewTransform(int const horizontal, int const vertical, int const depth, int index, int maxvalue);
37
41 QString m_fileName;
42};
43
44#endif // KISNORMALPREVIEWWIDGET_H
QImage swizzleTransformPreview(QImage preview)
int previewTransform(int const horizontal, int const vertical, int const depth, int index, int maxvalue)
KisNormalPreviewWidget(QWidget *parent=0)