From bacc1b3567e0cf6bff2862e31bccb981e4f243c3 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Fri, 13 Nov 2015 15:11:43 +0100 Subject: [PATCH] [TASK] Add small histogramm for original image, too. --- imageviewer-qt4.cpp | 12 ++++++++++-- imageviewer-qt4.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/imageviewer-qt4.cpp b/imageviewer-qt4.cpp index b6ee12f..8024af7 100644 --- a/imageviewer-qt4.cpp +++ b/imageviewer-qt4.cpp @@ -196,6 +196,7 @@ void ImageViewer::analyzeImage() { QString result = QString("Intensity: Average: %1, Variance: %2").arg(working_copy->getIntensityAverage()).arg(working_copy->getIntensityVariance()); stats->setText(result); histogramm_label->setPixmap(QPixmap::fromImage(*(working_copy->getHistogrammImage()))); + original_histogramm_label->setPixmap(QPixmap::fromImage(*(original->getHistogrammImage()))); } } @@ -368,6 +369,11 @@ void ImageViewer::generateControlPanels() { task_tab2 = new QVBoxLayout(); task_tab_widget2->setLayout(task_tab2); + original_histogramm_label = new QLabel(); + original_histogramm_label->setBackgroundRole(QPalette::Base); + original_histogramm_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + original_histogramm_label->setScaledContents(false); + histogramm_label = new QLabel(); histogramm_label->setBackgroundRole(QPalette::Base); histogramm_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); @@ -377,7 +383,7 @@ void ImageViewer::generateControlPanels() { stats->setText("Intensity will be shown here."); analyze_image = new QPushButton(); - analyze_image->setText("Analyze image"); + analyze_image->setText("Update image statistics, redraw histogramms."); QObject::connect(analyze_image, SIGNAL(clicked()), this, SLOT(analyzeImage())); brightness_slider = new QSlider(Qt::Horizontal); @@ -401,7 +407,9 @@ void ImageViewer::generateControlPanels() { QObject::connect(automatic_robust_contrast, SIGNAL(clicked()), this, SLOT(robustAutomaticContrastAdaption())); task_tab2->addWidget(stats); - task_tab2->addWidget(new QLabel("Histogramm")); + task_tab2->addWidget(new QLabel("Histogramm of original image")); + task_tab2->addWidget(original_histogramm_label); + task_tab2->addWidget(new QLabel("Histogramm of working copy")); task_tab2->addWidget(histogramm_label); task_tab2->addWidget(analyze_image); task_tab2->addWidget(new QLabel("Brightness")); diff --git a/imageviewer-qt4.h b/imageviewer-qt4.h index 48df285..5e61efd 100644 --- a/imageviewer-qt4.h +++ b/imageviewer-qt4.h @@ -88,6 +88,7 @@ class ImageViewer : public QMainWindow { QVBoxLayout* task_tab2; QLabel* stats; + QLabel* original_histogramm_label; QLabel* histogramm_label; QPushButton* analyze_image;