aboutsummaryrefslogtreecommitdiff
path: root/Plugins/lightspeed.c
blob: 460e7fee744f2bb2a6fb92aaaa0759847e95ae53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdlib.h>
#include "plugin.h"

INFO("a great effect. $1 = y offset")

void perform_effect(_frame f, _args a)
{
	int pos, y, pixelsize=f.pixelformat/8;

	if(!a.s) pos = f.height / 2;
	else pos = atoi(a.s);

	if(pos<=0 || pos>=f.height) pos = f.height / 2;

	for(y=pos; y>=0; y--)
	{
		memcpy(scanline(f, y), scanline(f, y+1), pixelsize*f.width);
	}
}