void MainWindow::resizeEvent(QResizeEvent *event)
{
	if (ui->startButton->isEnabled() == true)
	{
		updateOriginalImage();
		updateCurrentImage();
		event->accept();
	}
}
Example #2
0
void MainWindow::on_brightnessSpinBox_valueChanged(double arg1)
{
    ProcessSettings processSettings = m_imageManager.processSettings();
    processSettings.brightness = arg1;
    m_imageManager.setProcessSettings(processSettings);

    ui->brightnessSlider->setValue( arg1 * 100);

    updateCurrentImage();
}
Example #3
0
void MainWindow::on_gammaSlider_valueChanged(int value)
{
    ProcessSettings processSettings = m_imageManager.processSettings();
    processSettings.gamma = float(value) / 100;
    m_imageManager.setProcessSettings(processSettings);

    ui->gammaSpinBox->setValue( processSettings.gamma );

    updateCurrentImage();
}
Example #4
0
void MainWindow::on_brightnessSlider_valueChanged(int value)
{
    ui->brightnessSpinBox->setValue (float(value) / 100);

    ProcessSettings processSettings = m_imageManager.processSettings();
    processSettings.brightness = float(value) / 100;
    m_imageManager.setProcessSettings(processSettings);

    updateCurrentImage();
}
void MainWindow::update()
{
	updateStatus();
	if (updateImage)
		updateCurrentImage();
	unsigned int goodMuts = imageMutator.getGoodMutationCount();
	if (goodMuts - lastUpdate > (unsigned int)Constants::C_AUTOSAVE_SPEED)
	{
		lastUpdate = goodMuts;
		autosave();
	}
}
Example #6
0
void MainWindow::loadImage (QString imagePath)
{
    try
    {
        m_currentImage = m_imageManager.loadImage( imagePath );
        updateCurrentImage();

        ui->statusBar->showMessage(QString("Afbeelding geopend: ") + imagePath, 0);
    }
    catch( const std::exception& e)
    {
        ui->statusBar->showMessage(QString("Fout met openen afbeelding: ") + e.what(), 0);
    }
}
void MainWindow::loadImage()
{
	bool wasRunning = imageMutator.mutateIsOn;
	imageMutator.stopMutation();

	updateTimer.stop();

	fileopener.setAcceptMode(QFileDialog::AcceptOpen);
	fileopener.setFileMode(QFileDialog::ExistingFile);
	fileopener.setFilter(tr("Image Files(*.png *.jpg *.jpeg *.bmp *.gif *.pbm *.pgm *.ppm *.tiff *.xbm *.xpm)"));

	QString path;
	if (fileopener.exec())
	{
		path = fileopener.selectedFiles().at(0);
		autosaveFilename = path;
		autosaveFilename = autosaveFilename.remove(autosaveFilename.length()-3, 3) + QString("autosave.svg");
		incrementalFilename = path;
		incrementalFilename = incrementalFilename.remove(incrementalFilename.length()-3, 3);

		if (!imageMutator.loadImage(path))
		{
			QMessageBox::critical(this, tr("File Read Error"), tr("Errored while loading image"));
			return;
		}

		updateOriginalImage();
		updateCurrentImage();
		updateStatus();
		lastUpdate = 0;

		ui->startButton->setText(QString("S&tart"));
		ui->startButton->setEnabled(true);
		ui->loadSVGButton->setEnabled(true);
		ui->backgroundColorButton->setEnabled(true);
	}
	else if (wasRunning)
	{
		imageMutator.startMutation();
		updateTimer.start(Constants::C_UPDATE_SPEED);
	}
}