Fwd: Convolution
Bart Coppens
kde at bartcoppens.be
Wed May 25 22:03:51 CEST 2005
On Wednesday 25 May 2005 21:54, Boudewijn Rempt wrote:
> I've got blur working now; it has more or less the same problem as the old
> convolution painter except it now has it on all four sides. The problem is
> that the default pixel of a paint device is invisble black. The black is
> picked up when the matrix tries to read beyond the edge of the paint
> device.
>
> Anyway, my code still doesn't work when there are negative values in the
> matrix -- the results are very electric, but not good enough.
So I had almost the same fix for it. Only, I divide by kernel[0].factor
instead of kernelSum, and I still add the offset to it. Also, I kept the int
sums[depth], instead of float. I don't see the use in making it float, since
we only add QUANTUM*int to it. (I did set it with memset(&sums, 0, depth *
sizeof(int));, though, instead of just depth).
More information about the kimageshop
mailing list