File indexing completed on 2024-12-08 07:19:38

0001 /*
0002  * SPDX-FileCopyrightText: 2009 Kare Sars <kare dot sars at iki dot fi>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  */
0006 
0007 #ifndef KSANE_GAMMA_OPTION_H
0008 #define KSANE_GAMMA_OPTION_H
0009 
0010 #include "baseoption.h"
0011 
0012 namespace KSaneCore
0013 {
0014 
0015 class GammaOption : public BaseOption
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     GammaOption(const SANE_Handle handle, const int index);
0021 
0022     void readValue() override;
0023 
0024     QVariant maximumValue() const override;
0025     QVariant value() const override;
0026     int valueSize() const override;
0027     QString valueAsString() const override;
0028 
0029 public Q_SLOTS:
0030     bool setValue(const QVariant & value) override;
0031 
0032 private:
0033     void calculateGTwriteData();
0034     void calculateBCGwriteData();
0035 
0036     int             m_brightness;
0037     int             m_contrast;
0038     int             m_gamma;
0039     QVector<int>    m_gammaTable;
0040     int             m_gammaTableMax;
0041 };
0042 
0043 }  // namespace KSane
0044 
0045 #endif // KSANE_GAMMA_OPTION_H