implemented window function

This commit is contained in:
Damian Kowalski 2024-04-07 13:26:29 +02:00
parent d5dad0ee19
commit f8967f3893
1 changed files with 24 additions and 2 deletions

View File

@ -158,9 +158,31 @@ math::matrix<float> Transformation::getWindow(int x, int y, int size,
Channel channel, Channel channel,
Mode mode = RepeatEdge) Mode mode = RepeatEdge)
{ {
math::matrix<float> window(size,size); math::matrix<float> window(size, size);
int center = size / 2;
qDebug() << Q_FUNC_INFO << "Not implemented yet!"; for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
QRgb p = getPixel(x - center + i, y - center + j, mode);
switch (channel)
{
case RChannel:
window[i][j] = qRed(p);
break;
case GChannel:
window[i][j] = qGreen(p);
break;
case BChannel:
window[i][j] = qBlue(p);
break;
case LChannel:
window[i][j] = qGray(p);
break;
}
}
}
return window; return window;
} }