Isis Developer Reference
StretchTool.h
Go to the documentation of this file.
1#ifndef StretchTool_h
2#define StretchTool_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12// This is the only include allowed in this file!
13#include "Tool.h"
14
15class QComboBox;
16class QPushButton;
17class QLineEdit;
18class QRect;
19class QToolButton;
20
21namespace Isis {
22 class AdvancedStretchDialog;
23 class Cube;
24 class CubeViewport;
25 class Histogram;
26 class Statistics;
27 class Stretch;
28 class ViewportBuffer;
29
85 class StretchTool : public Tool {
86 Q_OBJECT
87
88 public:
89 StretchTool(QWidget *parent);
91 void addTo(QMenu *menu);
92
103
104 static Stretch stretchBuffer(ViewportBuffer *buffer, QRect rect);
105 static Stretch stretchBand(CubeViewport *cvp, StretchBand band);
106
107 static Statistics statsFromCube(Cube *cube, int band);
108 static Statistics statsFromBuffer(ViewportBuffer *buffer, QRect rect);
109 static Histogram histFromCube(Cube *cube, int band,
110 double min, double max);
112 static Histogram histFromBuffer(ViewportBuffer *buffer, QRect rect,
113 double min, double max);
115
123 QString menuName() const {
124 return "&View";
125 }
126
127 signals:
133
142 void warningSignal(std::string &pStr, const std::string pExStr);
143
144 public slots:
145 void stretchGlobal();
149 void stretchRegional();
151
152 protected:
154 QWidget *createToolBarWidget(QStackedWidget *parent);
155 void updateTool();
156 void stretchRequested(MdiCubeViewport *cvp, int bandId);
157
158 protected slots:
159 void mouseButtonRelease(QPoint p, Qt::MouseButton s);
160 void saveStretchToCube();
161 void deleteFromCube();
162 void loadStretchFromCube();
164 void screenPixelsChanged();
165 void updateHistograms();
166 void rubberBandComplete();
168
169 private slots:
170 void stretchChanged();
171 void advancedStretchChanged();
172 void changeStretch();
173 void showAdvancedDialog();
174 void setStretchAcrossBands();
175 void setStretchAllViewports();
176 void stretchBandChanged(int);
177
178 private:
179 void stretchRect(CubeViewport *cvp, QRect rect);
180
181 private:
182 AdvancedStretchDialog *m_advancedStretch;
183
184 QToolButton *m_copyButton;
185 QToolButton *m_globalButton;
186 QToolButton *m_stretchRegionalButton;
187 QPushButton *m_flashButton;
188
189 QAction *m_stretchGlobal;
190 QAction *m_stretchRegional;
191 QAction *m_stretchManual;
192 QAction *m_copyBands;
193
194 QComboBox *m_stretchBandComboBox;
195
196 QLineEdit *m_stretchMinEdit;
197 QLineEdit *m_stretchMaxEdit;
198
199 StretchBand m_stretchBand;
200
202 Stretch *m_preGlobalStretches;
203
204 Stretch *m_chipViewportStretch;
205 };
206};
207
208#endif
Advanced Stretch Dialog.
Definition AdvancedStretchDialog.h:30
IO Handler for Isis Cubes.
Definition Cube.h:168
Widget to display Isis cubes for qt apps.
Definition CubeViewport.h:122
Container of a cube histogram.
Definition Histogram.h:74
Cube display widget for certain Isis MDI applications.
Definition MdiCubeViewport.h:39
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:94
Pixel value mapper.
Definition Stretch.h:58
Stretch image edit tool.
Definition StretchTool.h:85
void updateAdvStretchDialogforAll(void)
Update the streches and corresponding histograms for all the colors Red, Green and Blue for Stretch A...
Definition StretchTool.cpp:379
static Statistics statsFromBuffer(ViewportBuffer *buffer, QRect rect)
This method will calculate and return the statistics for a given region and viewport buffer.
Definition StretchTool.cpp:1484
void stretchGlobal()
Does a global stretch for the active viewport.
Definition StretchTool.cpp:1111
void stretchRegional()
Does a regional stretch for the active viewport.
Definition StretchTool.cpp:1158
static Histogram histFromCube(Cube *cube, int band, double min, double max)
This method will calculate and return the histogram for a given cube and band.
Definition StretchTool.cpp:1519
void screenPixelsChanged()
This is called when the visible area changes.
Definition StretchTool.cpp:747
StretchBand
Enum to store the bands.
Definition StretchTool.h:96
@ Gray
Gray Band.
Definition StretchTool.h:97
@ Green
Green Band.
Definition StretchTool.h:99
@ Blue
Blue Band.
Definition StretchTool.h:100
@ All
All Bands.
Definition StretchTool.h:101
@ Red
Red Band.
Definition StretchTool.h:98
void rubberBandComplete()
This method is called when the RubberBandTool is complete.
Definition StretchTool.cpp:1189
static Statistics statsFromCube(Cube *cube, int band)
This method will calculate and return the statistics for a given cube and band.
Definition StretchTool.cpp:1461
void stretchRequested(MdiCubeViewport *cvp, int bandId)
The cube viewport requested a stretch at this time, give it to the viewport.
Definition StretchTool.cpp:848
~StretchTool()
Destructor.
Definition StretchTool.cpp:94
static Histogram histFromBuffer(ViewportBuffer *buffer)
Given a viewport buffer, this calculates a histogram.
Definition StretchTool.cpp:1541
QAction * toolPadAction(ToolPad *pad)
Adds the stretch action to the toolpad.
Definition StretchTool.cpp:111
StretchTool(QWidget *parent)
StretchTool constructor.
Definition StretchTool.cpp:48
void updateHistograms()
This updates the visible histograms in the advanced stretch, if present.
Definition StretchTool.cpp:331
void deleteFromCube()
Deletes a saved stretch from the cube.
Definition StretchTool.cpp:527
void addTo(QMenu *menu)
Adds the stretch action to the given menu.
Definition StretchTool.cpp:131
void setCubeViewport(CubeViewport *)
This updates the advanced stretch to use the given viewport.
Definition StretchTool.cpp:757
void enableRubberBandTool()
This method enables the RubberBandTool.
Definition StretchTool.cpp:1282
void stretchGlobalAllViewports()
Does a global stretch for all the viewports.
Definition StretchTool.cpp:1145
QString menuName() const
This let's Tool know which Menu the actions this class has should be added to.
Definition StretchTool.h:123
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
This method will call a global stretch if the right mouse button is released.
Definition StretchTool.cpp:1258
static Stretch stretchBuffer(ViewportBuffer *buffer, QRect rect)
This method computes the stretch over a region using the viewport buffer.
Definition StretchTool.cpp:1388
void saveStretchToCube()
Saves a strech to the cube.
Definition StretchTool.cpp:593
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget to add to the tool bar.
Definition StretchTool.cpp:145
void stretchGlobalAllBands()
This resets the stretch across all bands.
Definition StretchTool.cpp:1122
void updateTool()
Updates the stretch tool.
Definition StretchTool.cpp:795
void stretchChipViewport(Stretch *, CubeViewport *)
when a viewport is stretched, send the stretch and the viewport associated with it to any ChipViewpor...
void loadStretchFromCube()
Restores a saved stretch from the cube.
Definition StretchTool.cpp:407
static Stretch stretchBand(CubeViewport *cvp, StretchBand band)
This method computes the stretch over the entire cube.
Definition StretchTool.cpp:1418
void warningSignal(std::string &pStr, const std::string pExStr)
Shows a warning.
Base class for the Qisis tools.
Definition Tool.h:67
Definition ToolPad.h:14
Reads and stores visible DN values.
Definition ViewportBuffer.h:63
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16