File indexing completed on 2024-04-14 14:10:36

0001 /*
0002     SPDX-FileCopyrightText: 2015 Jasem Mutlaq <mutlaqja@ikarustech.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "fitscommon.h"
0010 #include "fitsdata.h"
0011 #include "fitshistogramcommand.h"
0012 #include "fitshistogramview.h"
0013 #include "ui_fitshistogramui.h"
0014 
0015 #include <QDialog>
0016 
0017 class QMouseEvent;
0018 
0019 class FITSTab;
0020 
0021 class histogramUI : public QDialog, public Ui::FITSHistogramUI
0022 {
0023         Q_OBJECT
0024 
0025     public:
0026         explicit histogramUI(QDialog * parent = nullptr);
0027 };
0028 
0029 class FITSHistogramEditor : public QDialog
0030 {
0031         Q_OBJECT
0032 
0033         friend class histDrawArea;
0034 
0035     public:
0036         explicit FITSHistogramEditor(QWidget * parent);
0037 
0038         //void createNonLinearHistogram();
0039         void setImageData(const QSharedPointer<FITSData> &data);
0040         void syncGUI();
0041         void applyFilter(FITSScale ftype);
0042 
0043     protected:
0044         void showEvent(QShowEvent * event) override;
0045 
0046     signals:
0047         void newHistogramCommand(FITSHistogramCommand *command);
0048 
0049     public slots:
0050         void applyScale();
0051         void resizePlot();
0052 
0053     private:
0054         histogramUI * ui { nullptr };
0055 
0056         QVector<QVector<QWidget *>> rgbWidgets;
0057         QVector<ctkRangeSlider *> sliders;
0058         QVector<QDoubleSpinBox *> minBoxes, maxBoxes;
0059 
0060         QVector<int> numDecimals;
0061         QVector<double> sliderScale, sliderTick;
0062 
0063         FITSScale type { FITS_AUTO };
0064         bool isGUISynced { false};
0065         bool m_Constructed { false };
0066         QSharedPointer<FITSData> m_ImageData;
0067 };