LineProfileTool.h
Go to the documentation of this file.
/***************************************************************************
File : LineProfileTool.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke
Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de
Description : Plot tool for calculating intensity profiles of
image markers.
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef LINE_PROFILE_TOOL_H
#define LINE_PROFILE_TOOL_H
#include "PlotToolInterface.h"
#include <QWidget>
class QPoint;
class QImage;
class ImageWidget;
class ApplicationWindow;
class LineProfileTool : public QWidget, public PlotToolInterface
{
Q_OBJECT
public:
LineProfileTool(Graph *graph, ApplicationWindow *app, int average_pixels);
void calculateLineProfile(const QPoint &start, const QPoint &end);
virtual int rtti() const {return PlotToolInterface::Rtti_LineProfileTool;};
signals:
void statusText(const QString&);
protected:
double averageImagePixel(const QImage &image, int px, int py, bool moreHorizontal);
virtual void paintEvent(QPaintEvent *e);
virtual void mousePressEvent(QMouseEvent *e);
virtual void mouseMoveEvent(QMouseEvent *e);
virtual void mouseReleaseEvent(QMouseEvent *e);
private:
ApplicationWindow *d_app;
int d_average_pixels;
ImageWidget *d_target;
QPoint d_op_start;
QPoint d_op_dp;
};
#endif // ifndef LINE_PROFILE_TOOL_H
LineProfileTool::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *e)
Mouse movements need to be monitored for updating the line during operation.
Definition: LineProfileTool.cpp:191
LineProfileTool::d_target
ImageWidget * d_target
The image to operate on.
Definition: LineProfileTool.h:101
LineProfileTool::LineProfileTool
LineProfileTool(Graph *graph, ApplicationWindow *app, int average_pixels)
Standard constructor.
Definition: LineProfileTool.cpp:42
Graph
A 2D-plotting widget.
Definition: Graph.h:123
LineProfileTool::paintEvent
virtual void paintEvent(QPaintEvent *e)
Draw line during operation.
Definition: LineProfileTool.cpp:176
LineProfileTool::averageImagePixel
double averageImagePixel(const QImage &image, int px, int py, bool moreHorizontal)
Definition: LineProfileTool.cpp:155
LineProfileTool::d_app
ApplicationWindow * d_app
Definition: LineProfileTool.h:97
LineProfileTool::statusText
void statusText(const QString &)
LineProfileTool::d_average_pixels
int d_average_pixels
Number of image pixels over which to average.
Definition: LineProfileTool.h:99
ImageWidget
Definition: ImageWidget.h:37
ApplicationWindow
QtiPlot's main window.
Definition: ApplicationWindow.h:133
LineProfileTool
Plot tool for calculating intensity profiles of image markers along a line.
Definition: LineProfileTool.h:61
LineProfileTool::calculateLineProfile
void calculateLineProfile(const QPoint &start, const QPoint &end)
Definition: LineProfileTool.cpp:65
LineProfileTool::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *e)
Mouse releases end line selection and cause the profile to be displayed.
Definition: LineProfileTool.cpp:205
PlotToolInterface.h
PlotToolInterface
Definition: PlotToolInterface.h:60
PlotToolInterface::Rtti_LineProfileTool
Definition: PlotToolInterface.h:72
LineProfileTool::d_op_dp
QPoint d_op_dp
Difference between current and start position during operation.
Definition: LineProfileTool.h:106
LineProfileTool::d_op_start
QPoint d_op_start
Mouse position where an operation started.
Definition: LineProfileTool.h:104
LineProfileTool::rtti
virtual int rtti() const
Definition: LineProfileTool.h:70
LineProfileTool::mousePressEvent
virtual void mousePressEvent(QMouseEvent *e)
Pressing the left mouse button starts line selection.
Definition: LineProfileTool.cpp:183