summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets/separations/screenwidget.h
blob: ae2d7368514bfdd266fd29abe7620d90693d33e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef SCREENWIDGET_H
#define SCREENWIDGET_H

#include <QColor>
#include <QFrame>
#include <QImage>
#include <QSize>

class QGridLayout;
class QLabel;
class QPushButton;
class QWidget;

class ScreenWidget : public QFrame
{
    Q_OBJECT
public:
    enum Separation { Cyan, Magenta, Yellow };

    ScreenWidget(QWidget *parent, QColor initialColor, const QString &name,
                 Separation mask, const QSize &labelSize);
    void setImage(QImage &image);
    QImage* image();

signals:
    void imageChanged();

public slots:
    void setColor();
    void invertImage();

private:
    void createImage();

    bool inverted;
    QColor paintColor;
    QImage newImage;
    QImage originalImage;
    QLabel *imageLabel;
    QLabel *nameLabel;
    QPushButton *colorButton;
    QPushButton *invertButton;
    Separation maskColor;
};

#endif