Freddix wrote: "I have found this : http://blog.ivank.net/fastest-gaussian-blur.html"
i don't know how far you got with this. i made my own attempt at converting the first algorythm into dbpro code. this is what i got, may it be helpful to your implementation:
note that this code, in it's current state, is unbearably slow. a 1024x1024 px image took me about 84 seconds with a radius of 2. i don't know if the other algorythms would be any faster, or if dbpro is just too slow for that.
if you try the code, it may look like the program froze, but that's just because it is so slow.
also, there may be bugs, because the code in the link uses the var statement to declare any variable, so i had to guess which are floats and which are ints
set display mode desktop width(),desktop height(),32
//set window layout 0,0,0
set window position 0,0
your_image$=""
load image your_image$,1
make memblock from image 1,1
make memblock from image 2,1
w=image width(1)
h=image height(1)
r=2
time=timer()
print "bluring..."
// source memblock nr, target memblock nr, width, height, radius, channel (0=alpha, 1=r, 2=g, 3=b)
gaussBlur_1(1,2,w,h,r,1)
gaussBlur_1(1,2,w,h,r,2)
gaussBlur_1(1,2,w,h,r,3)
print "took me ";((timer()-time)/1000);" seconds to finish"
wait key
make image from memblock 2,2
paste image 2,0,0
wait key
delete memblock 1
delete memblock 2
delete image 2
delete image 1
end
function gaussBlur_1(sclnr, tclnr, w, h, r, channel)
rs = ceil(r*2.57) // significant radius
for i=0 to h-1
for j=0 to w-1
v#=0
wsum#=0
for iy = i-rs to i+rs
for ix = j-rs to j+rs
x=min(w-1, max(0, ix))
y=min(h-1, max(0, iy))
dsq# = (ix-j)*(ix-j)+(iy-i)*(iy-i)
wght# = exp( -dsq# / (2*r*r) ) / (pi()*2*r*r)
v#=v#+getFromMemblockImage(sclnr,y*w+x,channel)*wght#
wsum#=wsum#+wght#
NEXT ix
NEXT iy
writeToMemblockImage(tclnr,i*w+j,round(v#/wsum#),channel)
next j
NEXT i
ENDFUNCTION
function writeToMemblockImage(memnr,index,v,channel)
index=12+index*4+channel
write memblock byte memnr,index,v
ENDFUNCTION
function getFromMemblockImage(memnr,index,channel)
index=12+index*4+channel
o=memblock byte(memnr,index)
ENDFUNCTION o
function round(f#)
o = int(f#+f#)-int(f#)
ENDFUNCTION o
Derek Darkly wrote: "I ain't no math whiz."
me neither