Rhos filters a awesome! I'd like to add them to my QuadDraw program, next time I update it.
After tinkering with my slow blur code, failing to make it faster, I experimented with layers of _PUTIMAGE images with transparency instead, bypassing the slow POINT/PSET every pixel. Surprised it worked. Not a Gaussian blur, but it looks kind of decent, and is almost instant.
- Dav
After tinkering with my slow blur code, failing to make it faster, I experimented with layers of _PUTIMAGE images with transparency instead, bypassing the slow POINT/PSET every pixel. Surprised it worked. Not a Gaussian blur, but it looks kind of decent, and is almost instant.
- Dav
Code: (Select All)
SCREEN _NEWIMAGE(800, 600, 32)
FOR t = 1 TO 1000
size = RND * 255
x = RND * _WIDTH: y = RND * _HEIGHT
LINE (x, y)-(x + size, y + size), _RGB(RND * 255, RND * 255, RND * 255), BF
NEXT
FOR t = 1 TO 50000
PSET (RND * _WIDTH, RND * _HEIGHT), _RGB(RND * 255, RND * 255, RND * 255)
NEXT
PRINT "press a key to blur...";
SLEEP
BlurScreen 'a little blur...
BlurScreen '...a little more.
SUB BlurScreen
odisp% = _AUTODISPLAY: _DISPLAY
tmpback& = _COPYIMAGE(_DISPLAY)
_SETALPHA 50, , tmpback&
_PUTIMAGE (-1, 0), tmpback&: _PUTIMAGE (1, 0), tmpback&
_PUTIMAGE (0, -1), tmpback&: _PUTIMAGE (0, 1), tmpback&
_PUTIMAGE (-1, -1), tmpback&: _PUTIMAGE (1, -1), tmpback&
_PUTIMAGE (-1, 1), tmpback&: _PUTIMAGE (1, 1), tmpback&
_PUTIMAGE (0, 0), tmpback&
_FREEIMAGE tmpback&
IF odisp% = -1 THEN _AUTODISPLAY
END SUB