File indexing completed on 2024-05-12 04:33:22

0001 /*
0002  * SPDX-FileCopyrightText: 2007-2008 Kare Sars <kare.sars@iki .fi>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  */
0006 
0007 #ifndef GAMMA_DISP_H
0008 #define GAMMA_DISP_H
0009 
0010 // Qt includes
0011 
0012 #include <QWidget>
0013 
0014 /**
0015  *@author Kåre Särs
0016  *
0017  * This is the widget that displays the gamma table.
0018  */
0019 
0020 namespace KSaneIface
0021 {
0022 
0023 class GammaDisp : public QWidget
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028 
0029     /**
0030     * Create a gamma display.
0031     * \param parent parent widget
0032     * \param brightness the brightness value
0033     * \param contrast the contrast value
0034     * \param gamma the gamma value
0035     * \param maxValue the maximum value
0036     */
0037     GammaDisp(QWidget *parent, int *brightness, int *contrast, int *gamma, int maxValue);
0038     ~GammaDisp() override {}
0039 
0040     QSize sizeHint() const override;
0041     QSize minimumSizeHint() const override;
0042 
0043     void setColor(const QColor &color);
0044 
0045 protected:
0046 
0047     void paintEvent(QPaintEvent *) override;
0048     void resizeEvent(QResizeEvent *) override;
0049 
0050 private:
0051 
0052     int    *m_brightness;
0053     int    *m_contrast;
0054     int    *m_gamma;
0055     QColor  m_gammaColor;
0056     int     m_maxValue;
0057 };
0058 
0059 }  // NameSpace KSaneIface
0060 
0061 #endif // GAMMA_DISP_H
0062