1 #include "LinearStretchType.h" 7 #include <QTableWidget> 10 #include "HistogramWidget.h" 25 const QString &name,
const QColor &color)
35 QGridLayout *sliderLayout =
new QGridLayout();
36 sliderLayout->setColumnStretch(1, 10);
38 QLabel *minHistLabel =
new QLabel(
"Min DN");
48 connect(
p_startEdit, SIGNAL(textChanged(
const QString &)),
50 sliderLayout->addWidget(minHistLabel, 0, 0);
54 QLabel *maxHistLabel =
new QLabel(
"Max DN");
65 connect(
p_endEdit, SIGNAL(textChanged(
const QString &)),
67 sliderLayout->addWidget(maxHistLabel, 1, 0);
71 sliderWidget->setLayout(sliderLayout);
101 if(newStretch.
Pairs() >= 2) {
102 double inMin = newStretch.
Input(0);
103 double inMax = newStretch.
Input(1);
111 interpretted.
AddPair(inMin, 0);
112 interpretted.
AddPair(inMax, 255);
123 interpretted.
AddPair(inMin, 0);
124 interpretted.
AddPair(inMax, 255);
175 if(value >=
p_endEdit->text().toDouble()) {
181 int valuePos = (int)(percentage * 1000.0);
216 p_endEdit->setText(QString::number(value));
225 double value =
p_endEdit->text().toDouble();
227 if(value <= p_startEdit->text().
toDouble()) {
233 int valuePos = (int)(percentage * 1000.0);
243 newStretch.
AddPair(value, 255);
QSlider * p_endSlider
Line end pt slider.
void startEditChanged(const QString &)
A new start point was typed in.
void endSliderMoved(int)
This is called when the end point slider moves.
~LinearStretchType()
Destructor.
double Input(const int index) const
Returns the value of the input side of the stretch pair at the specified index.
double Minimum() const
Returns the absolute minimum double found in all data passed through the AddData method.
QLineEdit * p_endEdit
Line end pt edit.
void startSliderMoved(int)
This is called when the start point slider moves.
double BestMaximum(const double percent=99.5) const
This method returns the better of the absolute maximum or the Chebyshev maximum.
virtual Stretch getStretch()
Returns the current stretch object.
void stretchChanged()
Emitted when a new Stretch object is available.
Stretch * p_stretch
Current stretch pairs stored here.
double toDouble(const QString &string)
Global function to convert from a string to a double.
int Pairs() const
Returns the number of stretch pairs.
bool p_editOverride
This is used to let the edits be changed without updating the stretch.
void endEditChanged(const QString &)
A new end point was typed in.
double Maximum() const
Returns the absolute maximum double found in all data passed through the AddData method.
void AddPair(const double input, const double output)
Adds a stretch pair to the list of pairs.
double BestMinimum(const double percent=99.5) const
This method returns the better of the absolute minimum or the Chebyshev minimum.
void CopyPairs(const Stretch &other)
Copies the stretch pairs from another Stretch object, but maintains special pixel values...
Container of a cube histogram.
bool p_sliderOverride
This is used to let the edits be changed to where sliders cant go.
QString Text() const
Converts stretch pair to a string.
double BinSize() const
Returns the size of an individual bin.
QLineEdit * p_startEdit
Line start pt edit.
Namespace for ISIS/Bullet specific routines.
This is the base class for advanced stretches.
QSlider * p_startSlider
Line start pt slider.
virtual void setStretch(Stretch)
Given an arbitrary stretch, this will re-interpret it, as best as possible, into a linear stretch...
LinearStretchType(const Histogram &, const Stretch &, const QString &name, const QColor &color)
This constructs a linear stretch type.
Histogram * p_cubeHist
Visible area histogram.
QGridLayout * p_mainLayout
Main layout.