void QQuickDrag::setThreshold(qreal value) { if (_threshold != value) { _threshold = value; emit thresholdChanged(); } }
void Normalization::setThreshold(double threshold) { if(this->threshold != threshold){ this->threshold = threshold; emit thresholdChanged(threshold); } }
void ThresholdPanel::setThreshold(int low, int high) { if (low != getLow() || high != getHigh()) { lowSlider->setValue(low); highSlider->setValue(high); emit thresholdChanged(low, high); } }
void ColorDetector::setThreshold(int threshold) { if (m_threshold != threshold) { m_threshold = threshold; emit thresholdChanged(threshold); process(); } }
void Filter::setThreshold(int c, int t) { if (t == mThreshold[c]) return; mThreshold[c] = t; for (int i = 0; i < 256; i++) mLUT[c][i] = i > t ? 255 : 0; emit thresholdChanged(c, t); emit parametersChanged(); }
void QCompressor::setThreshold(double threshold) { QMutexLocker mutexLocker(&_mutex); _threshold = threshold; emit thresholdChanged(_threshold); }
void FrequencyAnalyzer::setThreshold(qreal value) { d_func()->threshold = value; emit thresholdChanged(value); }
bool ThresholdItem::eventFilter(QObject *object, QEvent *event) { if (object != plot()->canvas()) return false; QwtScaleMap xMap = plot()->canvasMap(QwtPlot::xBottom); switch (event->type()) { case QEvent::MouseButtonPress: { int currentValue = qBound(0, (int) xMap.invTransform(((QMouseEvent*)event)->x()), MAX_COLOR_VALUE); draggingValue = -1; for (int i = 0;i < _thresholds.size();++i) if (_thresholds[i] - currentValue >= -2 && _thresholds[i] - currentValue <= 2) { draggingValue = _thresholds[i]; break; } break; } case QEvent::MouseButtonDblClick: { int currentValue = qBound(0, (int) xMap.invTransform(((QMouseEvent*)event)->x()), MAX_COLOR_VALUE); draggingValue = -1; if (((QMouseEvent*)event)->button() == Qt::LeftButton) { int i = 0; for (;i < _thresholds.size();++i) if (_thresholds[i] >= currentValue) { _thresholds.insert(i, currentValue); draggingValue = currentValue; plot()->replot(); emit thresholdChanged(_thresholds); break; } if (i == _thresholds.size()) { _thresholds.push_back(currentValue); draggingValue = currentValue; plot()->replot(); emit thresholdChanged(_thresholds); } } else if (((QMouseEvent*)event)->button() == Qt::RightButton) { int i = 0; for (;i < _thresholds.size();++i) if (_thresholds[i] - currentValue >= -2 && _thresholds[i] - currentValue <= 2) { _thresholds.remove(i); plot()->replot(); emit thresholdChanged(_thresholds); break; } } break; } case QEvent::MouseMove: { int currentValue = qBound(0, (int) xMap.invTransform(((QMouseEvent*)event)->x()), MAX_COLOR_VALUE); int i = 0; for (;i < _thresholds.size();++i) if (_thresholds[i] == draggingValue) break; if (i != _thresholds.size()) { _thresholds[i] = currentValue; draggingValue = currentValue; } plot()->replot(); emit thresholdChanged(_thresholds); break; } case QEvent::MouseButtonRelease: { draggingValue = -1; break; } default: break; } return false; }
void ChromaCommand::setThreshold(float start) { this->threshold = start; emit thresholdChanged(this->threshold); }
void Defect::setThreshold(const qreal &threshold) { m_threshold = threshold; Q_EMIT thresholdChanged(); }
void ThresholdPanel::refreshThreshold() { emit thresholdChanged(getLow(), getHigh()); }
void ThresholdPanel::updateThreshold(int low, int high) { emit thresholdChanged(low, high); }
void ThresholdPanel::setHigh(int high) { highSlider->setValue(high); emit thresholdChanged(getLow(), getHigh()); }
void ThresholdPanel::setLow(int low) { lowSlider->setValue(low); emit thresholdChanged(getLow(), getHigh()); }
ToBlackAndWhiteDialog::ToBlackAndWhiteDialog(const MyImage& image, const Area& area, QWidget *parent) : QDialog(parent), ui(new Ui::ToBlackAndWhiteDialog), _area(area) { ui->setupUi(this); _image = image.getImage(); changing = false; single = true; black = true; singleThreshold = 0; thresholdItem = new ThresholdItem(); plot = new BasicStatisticPlot( ImageAlgorithm::getStatistic(image.getImage(), ImageAlgorithm::Green)); ui->widget_2->layout()->addWidget(plot); plot->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); thresholdItem->attach(plot); QVector<int> thresholds; thresholds.push_back(0); thresholdItem->setThresholds(thresholds); connect(thresholdItem, SIGNAL(thresholdChanged(QVector<int>)), this, SLOT(multipleChanged(QVector<int>))); xPlotPicker = new XPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::VLineRubberBand, QwtPicker::AlwaysOn, plot->canvas()); xPlotPicker->setRubberBandPen(QColor(0, 0, 255, 160)); xPlotPicker->setTrackerPen(QColor(0, 0, 255, 160)); xPlotPicker->setEnabled(true); connect(xPlotPicker, SIGNAL(pressAt(int)), this, SLOT(singleChanged(int))); connect(ui->thresholdSpinBox, SIGNAL(valueChanged(int)), this, SLOT(singleChanged(int))); marker = new QwtPlotMarker(); marker->setValue(0.0, 0.0); marker->setLineStyle(QwtPlotMarker::VLine); marker->setLabelAlignment(Qt::AlignRight | Qt::AlignBottom); marker->setLinePen(QPen(Qt::green, 0, Qt::DashDotLine)); marker->attach(plot); connect(ui->thresholdsEdit, SIGNAL(textEdited(QString)), this, SLOT(multipleTextChanged(QString))); connect(ui->blackButton, SIGNAL(toggled(bool)), this, SLOT(startWithBlack(bool))); connect(ui->whiteButton, SIGNAL(toggled(bool)), this, SLOT(startWithWhite(bool))); resetPreview(); }