fix: compile

This commit is contained in:
Kirill Kondrashov 2022-01-29 08:10:34 +01:00
parent 4606381495
commit e642436651
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.)));