11#include "ui_fitshistogramui.h"
14#include <QUndoCommand>
20class histogramUI :
public QDialog,
public Ui::FITSHistogramUI
28class FITSHistogram :
public QDialog
32 friend class histDrawArea;
37 enum { RED_CHANNEL, GREEN_CHANNEL, BLUE_CHANNEL };
39 void constructHistogram();
43 m_Constructed =
false;
46 void applyFilter(FITSScale ftype);
48 double getBinWidth(
int channel = 0)
50 return binWidth[channel];
53 QVector<uint32_t> getCumulativeFrequency(
int channel = 0)
const;
55 double getJMIndex()
const;
64 void showEvent(QShowEvent *
event)
override;
65 void driftMouseOverLine(QMouseEvent *
event);
73 void constructHistogram();
77 histogramUI * ui {
nullptr };
78 FITSTab * tab {
nullptr };
80 QVector<QVector<uint32_t>> cumulativeFrequency;
81 QVector<QVector<double>> intensity;
82 QVector<QVector<double>> frequency;
83 QVector<QVector<QWidget *>> rgbWidgets;
84 QVector<ctkRangeSlider *> sliders;
85 QVector<QDoubleSpinBox *> minBoxes, maxBoxes;
87 QVector<double> FITSMin;
88 QVector<double> FITSMax;
89 QVector<double> sliderScale, sliderTick;
90 QVector<int> numDecimals;
92 QVector<QCPGraph *> graphs;
93 QVector<double> binWidth;
94 uint16_t binCount { 0 };
98 FITSScale type { FITS_AUTO };
99 bool isGUISynced {
false};
100 bool m_Constructed {
false };
101 QCustomPlot * customPlot {
nullptr };
107 FITSHistogramCommand(QWidget * parent, FITSHistogram * inHisto, FITSScale newType,
const QVector<double> &lmin,
const QVector<double> &lmax);
108 virtual ~FITSHistogramCommand();
110 virtual void redo()
override;
111 virtual void undo()
override;
112 virtual QString text()
const;
115 bool calculateDelta(
const uint8_t * buffer);
118 FITSImage::Statistic stats;
119 FITSHistogram * histogram {
nullptr };
121 QVector<double> min, max;
123 unsigned char * delta {
nullptr };
124 unsigned long compressedBytes { 0 };
125 FITSTab * tab {
nullptr };
The FITSTab class holds information on the current view (drawing area) in addition to the undo/redo s...
QDialog(QWidget *parent, Qt::WindowFlags f)
virtual bool event(QEvent *e)
QObject * parent() const const