Dodanie metody wyznaczającej histogram

This commit is contained in:
Dawid Kreft 2020-03-08 13:01:03 +01:00
parent 55cfe891ee
commit 845b6fe40c

View File

@ -24,6 +24,20 @@ Histogram::~Histogram()
void Histogram::generate(QImage* image) 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!"; qDebug() << Q_FUNC_INFO << "Not implemented yet!";
} }