00001 #ifndef IMAGEPROC_H
00002 #define IMAGEPROC_H
00003
00004
00005 #include "PSQt/GeoImage.h"
00006 #include "ndarray/ndarray.h"
00007 #include <stdint.h>
00008
00009 #include <QObject>
00010 #include <QPointF>
00011 #include <QMouseEvent>
00012
00013 namespace PSQt {
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class ImageProc : public QObject
00035 {
00036 Q_OBJECT
00037
00038 public:
00039
00040 typedef PSQt::GeoImage::raw_image_t raw_image_t;
00041
00042 ImageProc();
00043 virtual ~ImageProc();
00044
00045 public slots:
00046 void onImageIsUpdated(ndarray<GeoImage::raw_image_t,2>&);
00047 void onZoomIsChanged(int&, int&, int&, int&, float&, float&);
00048 void onCenterIsChanged(const QPointF&);
00049
00050
00051 void testSignalRHistIsFilled(ndarray<float, 1>&, const unsigned&, const unsigned&);
00052 void testSignalSHistIsFilled(float*, const float&, const float&, const unsigned&);
00053
00054
00055 signals:
00056 void rhistIsFilled(ndarray<float, 1>&, const unsigned&, const unsigned&);
00057 void shistIsFilled(float*, const float&, const float&, const unsigned&);
00058
00059
00060 private:
00061 inline const char* _name_(){return "ImageProc";}
00062 void evaluateRadialIndexes();
00063 void fillRadialHistogram();
00064 void fillSpectralHistogram(const float& amin=0, const float& amax=0, const unsigned& nbins=100);
00065 void getIntensityLimits(float& amin, float& amax);
00066 void getIntensityLimitsV1(float& amin, float& amax);
00067
00068 float m_rbin_width;
00069 bool m_image_is_set;
00070 bool m_center_is_set;
00071 bool m_zoom_is_set;
00072 bool m_rindx_is_set;
00073 bool m_rhist_is_set;
00074 bool m_shist_is_set;
00075
00076 unsigned m_ixmax;
00077 unsigned m_iymax;
00078 unsigned m_irmax;
00079 unsigned m_zirmin;
00080 unsigned m_zirmax;
00081
00082 int m_zxmin;
00083 int m_zymin;
00084 int m_zxmax;
00085 int m_zymax;
00086
00087 float m_amin;
00088 float m_amax;
00089 unsigned m_nbins;
00090
00091 QPointF m_center;
00092 ndarray<GeoImage::raw_image_t,2> m_nda_image;
00093 ndarray<unsigned,2> m_nda_rindx;
00094 ndarray<float, 1> m_nda_rhist;
00095
00096
00097
00098
00099
00100 float p_rsum[2000];
00101 unsigned p_rsta[2000];
00102 float p_ssta[2000];
00103 };
00104
00105
00106 }
00107
00108 #endif // IMAGEPROC_H
00109