diff options
author | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-06 17:50:18 +0000 |
---|---|---|
committer | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-06 17:50:18 +0000 |
commit | 4d64e4cd434426234a5c313c151cd79b6afc299e (patch) | |
tree | 5c23dd6acc65b869741d3bb9d33912d74bb7407d /Plugins/makesliders.c |
*** empty log message ***svn2git-root
svn path=/trunk/Framestein/; revision=27
Diffstat (limited to 'Plugins/makesliders.c')
-rw-r--r-- | Plugins/makesliders.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Plugins/makesliders.c b/Plugins/makesliders.c new file mode 100644 index 0000000..5c0b209 --- /dev/null +++ b/Plugins/makesliders.c @@ -0,0 +1,40 @@ +// +// makesliders: display slider values +// +// usage: makesliders 14 56 76 140 +// displays four sliders with given values +// + +#include <string.h> +#include "plugin.h" + +#define MAXVALS 128 + +void perform_effect(_frame f, _args a) +{ + pixel8 *p8; + char *t=a.s; + int val[MAXVALS], valcount=0, i, y, bitsperpixel=f.pixelformat / 8, col; + + if(!t) return; + + while(t && valcount<MAXVALS) + { + val[valcount++] = atoi(t); + t = strstr(t, " "); + if(t) t++; + } + + memset(f.bits, 0, f.height*f.lpitch); + col = rand()%256; + + for(i=0; i<f.width; i++) + { + y = val[(int)(i / (float)f.width * (float)valcount)]; + if(y>=0 && y<f.height) + { + p8 = scanline(f, y); + memset(p8+i*bitsperpixel, 200, bitsperpixel); + } + } +} |