Re: That's not the Answer to Your Question



ooppss, I cliked the wrong button!

// img stored row-wise, i.e. img[row*width + col]

// horizontal pass
for row=0:height
for col=0:width-1
img[row][col] = 0.2f*img[row][col] + 0.2f*img[row][col+1];

// vertical pass
for col=0:width
for row=0:height-1
img[row][col] = 0.2f*img[row][col] + 0.2f*img[row+1][col];

this is plain vanilla C, piece of cake to re-create it.

Also, this is only an excerpt. Some obvious optimisation could be
perfomed, but due to storage requirements, the whole program has to be
written that way. This nevertheless clearly demonstrates the issue.

.


Quantcast