示例#1
0
    void ColorCorrection::dataToFrontend() {
      auto _tuning = dataModel()->tunings().current();

      setAllChannels();

      if (!_tuning) return;

      setUsed(_tuning->colorCorrection().isUsed());
    }
void ImageProcessSystem::automaticColorCorrection()
{
	if(colorCorrection())
	{
		updateMat();
		updateToolBar();
#ifdef DEBUG
		imshow("result",resultMat.get());
#else
		updateDisplayImage();
#endif
	}
}
示例#3
0
    void ColorCorrection::setUsed(bool _isUsed) {
      auto _tuning = dataModel()->tunings().current();

      if (!_tuning) return;

      this->locked([&] {
        auto& _colorCorrection = _tuning->colorCorrection();
        _colorCorrection.setUsed(_isUsed);

        ui_->chkIsUsed->setChecked(_isUsed);
        ui_->btnAll->setEnabled(_isUsed);
        ui_->btnRed->setEnabled(_isUsed);
        ui_->btnGreen->setEnabled(_isUsed);
        ui_->btnBlue->setEnabled(_isUsed);
        ui_->graph->setEnabled(_isUsed);
        ui_->params->setEnabled(_isUsed);
        emit dataModelChanged();
      });
    }
示例#4
0
    void ColorCorrection::setChannel(proj::Channel _channel) {
      if (!dataModel()) return;

      auto _tuning = dataModel()->tunings().current();

      if (!_tuning) return;

      this->locked([&] {
        ui_->btnAll->setChecked(_channel == Channel::ALL);
        ui_->btnRed->setChecked(_channel == Channel::RED);
        ui_->btnGreen->setChecked(_channel == Channel::GREEN);
        ui_->btnBlue->setChecked(_channel == Channel::BLUE);

        auto *_colorCorrection = &_tuning->colorCorrection();
        ui_->graph->setChannel(_channel);
        ui_->graph->setDataModel(_colorCorrection);
        ui_->params->setChannel(_channel);
        ui_->params->setDataModel(_colorCorrection->correction(_channel));
      });
    }
void ImageProcessSystem::interactiveColorCorrectionParametersChanged(int value)
{
	InteractiveColorCorrectionWidget *widget=(InteractiveColorCorrectionWidget *)interactiveOptionWidget;
	double data1=widget->redSlider->value()*0.01;
	double data4=widget->yellowSlider->value()*0.01;
	double brightness=widget->brightnessSlider->value();
	blueMeans=(int)(brightness/(0.3*data1*data4+0.59*data4+0.11));
	greenMeans=(int)(data4*blueMeans);
	redMeans=(int)(data1*greenMeans);
	widget->updateShowCurrentNumberLabel();
	if(colorCorrection())
	{
		interactiveHasProduceResult=true;
		BasisOperation::mat2QImage(resultMat.get(),resultImage);
		ImageLabel->setParameters(&resultImage,ui.pixelValueLabel);
		ImageLabel->displayImage(resultImage);
	}
	else
	{
		QMessageBox::information(this,"Information","this picture is ok!");
	}
}