casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ColorHistogram.qo.h
Go to the documentation of this file.
00001 //# Copyright (C) 2005
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This library is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU Library General Public License as published by
00006 //# the Free Software Foundation; either version 2 of the License, or (at your
00007 //# option) any later version.
00008 //#
00009 //# This library is distributed in the hope that it will be useful, but WITHOUT
00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012 //# License for more details.
00013 //#
00014 //# You should have received a copy of the GNU Library General Public License
00015 //# along with this library; if not, write to the Free Software Foundation,
00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00017 //#
00018 //# Correspondence concerning AIPS++ should be addressed as follows:
00019 //#        Internet email: aips2-request@nrao.edu.
00020 //#        Postal address: AIPS++ Project Office
00021 //#                        National Radio Astronomy Observatory
00022 //#                        520 Edgemont Road
00023 //#                        Charlottesville, VA 22903-2475 USA
00024 //#
00025 
00026 #ifndef COLORHISTOGRAM_QO_H
00027 #define COLORHISTOGRAM_QO_H
00028 
00029 #include <QtGui/QMainWindow>
00030 #include <casa/aipstype.h>
00031 #include <casa/Arrays/Vector.h>
00032 #include <display/QtViewer/ColorHistogram.ui.h>
00033 
00034 namespace casa {
00035 
00036 class BinPlotWidget;
00037 class QtDisplayData;
00038 class ColorHistogramScale;
00039 class WCPowerScaleHandler;
00040 class ColorTransferWidget;
00041 
00047 class ColorHistogram : public QMainWindow
00048 {
00049     Q_OBJECT
00050 
00051 public:
00052     ColorHistogram(QWidget *parent = 0);
00053     void setDisplayData( QtDisplayData* img );
00054     ~ColorHistogram();
00055 
00056 private slots:
00057         void resetIntensityRange();
00058         void acceptRange();
00059         void cancelRange();
00060         void colorsChanged();
00061         void invertColorMap( int invert );
00062         void powerCyclesChangedSlider(int value );
00063         void powerCyclesChangedLineEdit( const QString& str );
00064         void histogramColorModeChanged( bool useColors );
00065 
00066 private:
00067         void updateColorMap( bool invertChanged = false);
00068         void resetColorLookups();
00069         void resetPowerCycles( float powerCycles);
00070         Vector<uInt> computeScaledIntensities(const std::vector<float>& intensities );
00071         ColorHistogram( const ColorHistogram& other );
00072         ColorHistogram operator=( const ColorHistogram& other );
00073 
00074         QtDisplayData* displayData;
00075     Ui::ColorHistogramClass ui;
00076     BinPlotWidget* histogram;
00077     WCPowerScaleHandler* powerScaler;
00078     ColorHistogramScale* colorScale;
00079     ColorTransferWidget* colorTransferWidget;
00080     double minIntensity;
00081     double maxIntensity;
00082     const int COLOR_MAX;
00083     const int SLIDER_MIN;
00084     const int SLIDER_MAX;
00085     int SCALE_LIMIT;
00086 };
00087 
00088 }
00089 #endif // COLORHISTOGRAM_QO_H