From 4d64e4cd434426234a5c313c151cd79b6afc299e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juha=20Vehvil=C3=A4inen?= Date: Sat, 6 Jul 2002 17:50:18 +0000 Subject: *** empty log message *** svn path=/trunk/Framestein/; revision=27 --- Plugins/shuffle.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Plugins/shuffle.c (limited to 'Plugins/shuffle.c') diff --git a/Plugins/shuffle.c b/Plugins/shuffle.c new file mode 100644 index 0000000..0604595 --- /dev/null +++ b/Plugins/shuffle.c @@ -0,0 +1,42 @@ +#include +#include "plugin.h" + +void perform_effect(_frame f, _args a) +{ + int i, o=1000, x1, y1, x2, y2, range=10; + char *t; + pixel8 *p1, *p2; + pixel32 dot; + byte pixelsize=f.pixelformat/8; + + if(f.pixelformat>32) return; + + if(a.s) + { + o = atoi(a.s); + if(o==0) o=1000; + + if(t = strstr(a.s, " ")) + if((range = atoi(t+1))==0) return; + } + + for(i=0; i=f.width) x2=f.width-1; + if(y2<0) y2=0; + if(y2>=f.height) y2=f.height-1; + + p1 = scanline(f, y1); + p2 = scanline(f, y2); + + memcpy(&dot, &p2[x2*pixelsize], pixelsize); + memcpy(&p2[x2*pixelsize], &p1[x1*pixelsize], pixelsize); + memcpy(&p1[x1*pixelsize], &dot, pixelsize); + } +} -- cgit v1.2.1