From 845b6fe40c93cfa5dab26448181faf6525dff435 Mon Sep 17 00:00:00 2001 From: Dawid Kreft Date: Sun, 8 Mar 2020 13:01:03 +0100 Subject: [PATCH] =?UTF-8?q?Dodanie=20metody=20wyznaczaj=C4=85cej=20histogr?= =?UTF-8?q?am?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/histogram.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/core/histogram.cpp b/src/core/histogram.cpp index 1287666..26e8ee6 100644 --- a/src/core/histogram.cpp +++ b/src/core/histogram.cpp @@ -24,6 +24,20 @@ Histogram::~Histogram() void Histogram::generate(QImage* image) { + + qDebug() << Q_FUNC_INFO << "Not implemented yet!"; + for(int i = 0 ; i < image->height(); i++){ + for(int j = 0 ; j < image->width() ; j++){ + QColor *clrCurrent = new QColor( image->pixel(i,j) ); + R->insert(clrCurrent->red(),R->value(clrCurrent->red())+1); + G->insert(clrCurrent->green(),R->value(clrCurrent->green())+1); + B->insert(clrCurrent->blue(),R->value(clrCurrent->blue())+1); + L->insert(clrCurrent->alpha(),R->value(clrCurrent->alpha())+1); + } + } + + + qDebug() << Q_FUNC_INFO << "Not implemented yet!"; }