Merge pull request #51 from kir19890817/fix-compile-for-ubuntu-20

fix: compile
This commit is contained in:
Yonghye Kwon 2022-02-17 19:29:16 +09:00 committed by GitHub
commit 160a8cc3e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -20,7 +20,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
CONFIG += c++11
CONFIG += c++1z
SOURCES += \
main.cpp \

View File

@ -8,6 +8,7 @@
#include <QShortcut>
#include <QCollator>
#include <iomanip>
#include <cmath>
using std::cout;
using std::endl;
@ -473,7 +474,7 @@ void MainWindow::init_table_widget()
void MainWindow::on_horizontalSlider_contrast_sliderMoved(int value)
{
float valueToPercentage = float(value)/ui->horizontalSlider_contrast->maximum(); //[0, 1.0]
float percentageToGamma = pow(1/(valueToPercentage + 0.5), 7.);
float percentageToGamma = std::pow(1/(valueToPercentage + 0.5), 7.);
ui->label_image->setContrastGamma(percentageToGamma);
ui->label_contrast->setText(QString("Contrast(%) ") + QString::number(int(valueToPercentage * 100.)));