From f8d8ce4d35bfbba5391af2a3fbce2ad88f94dd69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juha=20Vehvil=C3=A4inen?= Date: Tue, 9 Jul 2002 12:36:46 +0000 Subject: PeRColate svn path=/trunk/Framestein/; revision=31 --- Plugins/rgbavg02.c | 799 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 799 insertions(+) create mode 100644 Plugins/rgbavg02.c (limited to 'Plugins/rgbavg02.c') diff --git a/Plugins/rgbavg02.c b/Plugins/rgbavg02.c new file mode 100644 index 0000000..5fc773e --- /dev/null +++ b/Plugins/rgbavg02.c @@ -0,0 +1,799 @@ +// 242.rgbavg02 -- does 2-source funky pixel averaging. +// by r. luke dubois (luke@music.columbia.edu), +// computer music center, columbia university, 2001. +// +// Pd / Framestein port by Olaf Matthes , June 2002 +// +// objects and source are provided without warranty of any kind, express or implied. +// +// usage: rgbavg +// + +#include +#include +#include +#include "plugin.h" + +#pragma warning( disable : 4761 ) // that's why it's funky !! + +void perform_effect(struct frame f1, struct frame f2, struct args a) +{ + printf("Using rgbavg as effect does nothing!\n"); +} + +void perform_copy(struct frame f1, struct frame f2, struct args a) +{ + short x,y, h, w; + long red, green, blue; + short alpha, mode; + long redpix, greenpix, bluepix, rp, gp, bp; + pixel16 *c1_16, *c2_16; + pixel24 *c1_24, *c2_24; + pixel32 *c1_32, *c2_32; + char *t; + + // get params + if(!a.s) return; + red = atoi(a.s); + if(!(t = strstr(a.s, " "))) return; + green = atoi(t+1); + if(!(t = strstr(t+1, " "))) return; + blue = atoi(t+1); + if(!(t = strstr(t+1, " "))) return; + mode = atoi(t+1); // mode=0 = bypass + + printf("rgbavg: %d %d %d - %d\n", red, green, blue, mode); + + w = f1.width