implemented window function
This commit is contained in:
parent
d5dad0ee19
commit
f8967f3893
@ -159,8 +159,30 @@ math::matrix<float> Transformation::getWindow(int x, int y, int size,
|
||||
Mode mode = RepeatEdge)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user