// 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