Merge pull request #51 from kir19890817/fix-compile-for-ubuntu-20
fix: compile
This commit is contained in:
commit
160a8cc3e8
@ -20,7 +20,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
# 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
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++1z
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QCollator>
|
#include <QCollator>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
@ -473,7 +474,7 @@ void MainWindow::init_table_widget()
|
|||||||
void MainWindow::on_horizontalSlider_contrast_sliderMoved(int value)
|
void MainWindow::on_horizontalSlider_contrast_sliderMoved(int value)
|
||||||
{
|
{
|
||||||
float valueToPercentage = float(value)/ui->horizontalSlider_contrast->maximum(); //[0, 1.0]
|
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_image->setContrastGamma(percentageToGamma);
|
||||||
ui->label_contrast->setText(QString("Contrast(%) ") + QString::number(int(valueToPercentage * 100.)));
|
ui->label_contrast->setText(QString("Contrast(%) ") + QString::number(int(valueToPercentage * 100.)));
|
||||||
|
Loading…
Reference in New Issue
Block a user