kstars
fitshistogram.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef FITSHISTOGRAM
00019 #define FITSHISTOGRAM
00020
00021 #include "ui_fitshistogramui.h"
00022
00023 #include <QUndoCommand>
00024 #include <QPixmap>
00025 #include <QMouseEvent>
00026 #include <QPaintEvent>
00027 #include <QDialog>
00028 #include <QVarLengthArray>
00029
00030 #define CIRCLE_DIM 16
00031
00032 const int INITIAL_MAXIMUM_WIDTH = 1024;
00033
00034 class FITSViewer;
00035 class QPixmap;
00036
00037
00038 class histogramUI : public QDialog, public Ui::FITSHistogramUI
00039 {
00040 Q_OBJECT
00041
00042 public:
00043 histogramUI(QDialog *parent=0);
00044
00045 };
00046
00047 class FITSHistogram : public QDialog
00048 {
00049 Q_OBJECT
00050
00051 friend class histDrawArea;
00052
00053 public:
00054 FITSHistogram(QWidget *parent);
00055 ~FITSHistogram();
00056
00057 void constructHistogram(int hist_width, int hist_height);
00058 void updateHistogram();
00059 int findMax(int hist_width);
00060 int type;
00061 int napply;
00062 double histFactor;
00063 double fits_min, fits_max;
00064
00065 private:
00066
00067 double binSize;
00068 histogramUI *ui;
00069 int histogram_height, histogram_width;
00070 QVarLengthArray<int, INITIAL_MAXIMUM_WIDTH> histArray;
00071 FITSViewer * viewer;
00072
00073 public slots:
00074 void applyScale();
00075 void updateBoxes(int lowerLimit, int upperLimit);
00076 void updateIntenFreq(int x);
00077
00078
00079 };
00080
00081 class FITSHistogramCommand : public QUndoCommand
00082 {
00083 public:
00084 FITSHistogramCommand(QWidget * parent, FITSHistogram *inHisto, int newType, int lmin, int lmax);
00085 virtual ~FITSHistogramCommand();
00086
00087 virtual void redo();
00088 virtual void undo();
00089 virtual QString text() const;
00090
00091
00092 private:
00093 FITSHistogram *histo;
00094 int type;
00095 int min, max;
00096 float *buffer;
00097 FITSViewer *viewer;
00098 };
00099
00100
00101 #endif