casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ColorHistogram.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 
26 #ifndef COLORHISTOGRAM_QO_H
27 #define COLORHISTOGRAM_QO_H
28 
29 #include <QMainWindow>
30 #include <casa/aipstype.h>
31 #include <casa/Arrays/Vector.h>
32 #include <display/QtViewer/ColorHistogram.ui.h>
33 
34 namespace casa {
35 
36  class BinPlotWidget;
37  class QtDisplayData;
38  class ColorHistogramScale;
39  class WCPowerScaleHandler;
40  class ColorTransferWidget;
41 
47  class ColorHistogram : public QMainWindow {
48  Q_OBJECT
49 
50  public:
51  ColorHistogram(QWidget *parent = 0);
52  void setDisplayData( QtDisplayData* img );
54 
55  private slots:
56  void resetIntensityRange();
57  void acceptRange();
58  void cancelRange();
59  void colorsChanged();
60  void invertColorMap( int invert );
62  void powerCyclesChangedLineEdit( const QString& str );
63  void histogramColorModeChanged( bool useColors );
64  void logScaleChanged ( int logScaleAmount );
65 
66  private:
67  void updateColorMap( bool invertChanged = false);
68  void resetColorLookups();
69  void resetPowerCycles( float powerCycles);
70  casacore::Vector<casacore::uInt> computeScaledIntensities(const std::vector<float>& intensities );
71  ColorHistogram( const ColorHistogram& other );
72  ColorHistogram operator=( const ColorHistogram& other );
73 
75  Ui::ColorHistogramClass ui;
80  double minIntensity;
81  double maxIntensity;
82  int logScale;
83  const int COLOR_MAX;
84  const int SLIDER_MIN;
85  const int SLIDER_MAX;
87  };
88 
89 }
90 #endif // COLORHISTOGRAM_QO_H
ColorHistogramScale * colorScale
ColorHistogram operator=(const ColorHistogram &other)
void powerCyclesChangedLineEdit(const QString &str)
void logScaleChanged(int logScaleAmount)
Overrides QwtLinearColorMap in order to provide QwtPlot color lookups based on a casa ColormapDefinit...
Displays a histogram that allows the user to set the color scale for an image.
ColorTransferWidget * colorTransferWidget
Ui::ColorHistogramClass ui
BinPlotWidget * histogram
void histogramColorModeChanged(bool useColors)
Display a histogram of intensity vs count.
void powerCyclesChangedSlider(int value)
void resetPowerCycles(float powerCycles)
void updateColorMap(bool invertChanged=false)
ColorHistogram(QWidget *parent=0)
casacore::Vector< casacore::uInt > computeScaledIntensities(const std::vector< float > &intensities)
void setDisplayData(QtDisplayData *img)
Linear, logarithmic and exponential scaling of data for the WorldCanvas.
QtDisplayData * displayData
void invertColorMap(int invert)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
WCPowerScaleHandler * powerScaler