QtiPlot  0.9.8.2
LineProfileTool.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : LineProfileTool.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke
6  Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de
7  Description : Plot tool for calculating intensity profiles of
8  image markers.
9 
10  ***************************************************************************/
11 
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the Free Software *
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
27  * Boston, MA 02110-1301 USA *
28  * *
29  ***************************************************************************/
30 #ifndef LINE_PROFILE_TOOL_H
31 #define LINE_PROFILE_TOOL_H
32 
33 #include "PlotToolInterface.h"
34 
35 #include <QWidget>
36 
37 class QPoint;
38 class QImage;
39 class ImageWidget;
40 class ApplicationWindow;
41 
61 class LineProfileTool : public QWidget, public PlotToolInterface
62 {
63  Q_OBJECT
64 
65  public:
67  LineProfileTool(Graph *graph, ApplicationWindow *app, int average_pixels);
68  void calculateLineProfile(const QPoint &start, const QPoint &end);
69 
70  virtual int rtti() const {return PlotToolInterface::Rtti_LineProfileTool;};
71 
72  signals:
77  void statusText(const QString&);
78 
79  protected:
80  double averageImagePixel(const QImage &image, int px, int py, bool moreHorizontal);
83  virtual void paintEvent(QPaintEvent *e);
88  virtual void mousePressEvent(QMouseEvent *e);
91  virtual void mouseMoveEvent(QMouseEvent *e);
94  virtual void mouseReleaseEvent(QMouseEvent *e);
95 
96  private:
104  QPoint d_op_start;
106  QPoint d_op_dp;
107 };
108 
109 #endif // ifndef LINE_PROFILE_TOOL_H
110