Created
September 21, 2011 16:26
-
-
Save connors511/1232542 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (i = 0; i < LENGTH(iImage->Pixels); i++) | |
{ | |
pixel = pos = 0; | |
for (row = -(m - 1)/2.0; row <= (m - 1)/2.0; row++) | |
{ | |
for (col = -(m - 1)/2.0; col <= (m - 1)/2.0; col++) | |
{ | |
pos = i + row * iImage->Width + col; | |
if (pos >= 0 && pos <= lastPixel) // Check for top and bottom | |
{ | |
if (i % iImage->Width == 0 && (pos + 1) % iImage->Width != 0) // check left | |
{ | |
pixel += F[row][col] * iImage->Pixels[pos]; | |
} | |
else if ( (i + 1) % iImage->Width == 0 && pos % iImage->Width != 0) // check right | |
{ | |
pixel += F[row][col] * iImage->Pixels[pos]; | |
} | |
} | |
} | |
} | |
oImage->Pixels[i] = pixel / normalization; | |
return TRUE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment