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/2colors.cpp | 21 +++++++++ Plugins/2colors.dll | Bin 0 -> 28672 bytes Plugins/2colors.exp | Bin 0 -> 627 bytes Plugins/2colors.lib | Bin 0 -> 2066 bytes Plugins/2colors.obj | Bin 0 -> 1133 bytes Plugins/README.txt | 12 +++++ Plugins/bend.c | 86 ++++++++++++++++++++++++++++++++++ Plugins/bend.dll | Bin 0 -> 49152 bytes Plugins/bend.exp | Bin 0 -> 697 bytes Plugins/bend.lib | Bin 0 -> 2110 bytes Plugins/bend.obj | Bin 0 -> 1726 bytes Plugins/black.c | 13 ++++++ Plugins/black.dll | Bin 0 -> 28672 bytes Plugins/black.exp | Bin 0 -> 700 bytes Plugins/black.lib | Bin 0 -> 2120 bytes Plugins/black.obj | Bin 0 -> 560 bytes Plugins/colortv.c | 69 ++++++++++++++++++++++++++++ Plugins/colortv.dll | Bin 0 -> 28672 bytes Plugins/colortv.exp | Bin 0 -> 708 bytes Plugins/colortv.lib | Bin 0 -> 2146 bytes Plugins/colortv.obj | Bin 0 -> 864 bytes Plugins/copy_vert.c | 30 ++++++++++++ Plugins/copy_vert.dll | Bin 0 -> 28672 bytes Plugins/copy_vert.exp | Bin 0 -> 583 bytes Plugins/copy_vert.lib | Bin 0 -> 1970 bytes Plugins/copy_vert.obj | Bin 0 -> 816 bytes Plugins/fs2vf.c | 49 ++++++++++++++++++++ Plugins/fs2vf.dll | Bin 0 -> 36864 bytes Plugins/fs2vf.exp | Bin 0 -> 575 bytes Plugins/fs2vf.lib | Bin 0 -> 1932 bytes Plugins/fs2vf.obj | Bin 0 -> 1894 bytes Plugins/gol.c | 89 ++++++++++++++++++++++++++++++++++++ Plugins/gol.dll | Bin 0 -> 28672 bytes Plugins/gol.exp | Bin 0 -> 567 bytes Plugins/gol.lib | Bin 0 -> 1908 bytes Plugins/gol.obj | Bin 0 -> 1878 bytes Plugins/green.cpp | 14 ++++++ Plugins/green.dll | Bin 0 -> 28672 bytes Plugins/green.exp | Bin 0 -> 619 bytes Plugins/green.lib | Bin 0 -> 2042 bytes Plugins/green.obj | Bin 0 -> 849 bytes Plugins/hist.cpp | 54 ++++++++++++++++++++++ Plugins/hist.dll | Bin 0 -> 45056 bytes Plugins/hist.exp | Bin 0 -> 614 bytes Plugins/hist.lib | Bin 0 -> 2032 bytes Plugins/hist.obj | Bin 0 -> 1986 bytes Plugins/makefile | 82 +++++++++++++++++++++++++++++++++ Plugins/makesliders.c | 40 ++++++++++++++++ Plugins/makesliders.dll | Bin 0 -> 36864 bytes Plugins/makesliders.exp | Bin 0 -> 599 bytes Plugins/makesliders.lib | Bin 0 -> 2004 bytes Plugins/makesliders.obj | Bin 0 -> 940 bytes Plugins/ms.dll | Bin 0 -> 36864 bytes Plugins/noize.c | 21 +++++++++ Plugins/noize.dll | Bin 0 -> 36864 bytes Plugins/noize.exp | Bin 0 -> 700 bytes Plugins/noize.lib | Bin 0 -> 2120 bytes Plugins/noize.obj | Bin 0 -> 865 bytes Plugins/pixels.h | 117 +++++++++++++++++++++++++++++++++++++++++++++++ Plugins/plot.cpp | 25 ++++++++++ Plugins/plot.dll | Bin 0 -> 28672 bytes Plugins/plot.exp | Bin 0 -> 614 bytes Plugins/plot.lib | Bin 0 -> 2032 bytes Plugins/plot.obj | Bin 0 -> 1011 bytes Plugins/plugin.h | 119 ++++++++++++++++++++++++++++++++++++++++++++++++ Plugins/rgb.c | 62 +++++++++++++++++++++++++ Plugins/rgb.dll | Bin 0 -> 36864 bytes Plugins/rgb.exp | Bin 0 -> 567 bytes Plugins/rgb.lib | Bin 0 -> 1908 bytes Plugins/rgb.obj | Bin 0 -> 1180 bytes Plugins/rgbcopy.cpp | 28 ++++++++++++ Plugins/rgbcopy.dll | Bin 0 -> 28672 bytes Plugins/rgbcopy.exp | Bin 0 -> 621 bytes Plugins/rgbcopy.lib | Bin 0 -> 2062 bytes Plugins/rgbcopy.obj | Bin 0 -> 1884 bytes Plugins/setbits.c | 11 +++++ Plugins/setbits.dll | Bin 0 -> 28672 bytes Plugins/setbits.exp | Bin 0 -> 583 bytes Plugins/setbits.lib | Bin 0 -> 1956 bytes Plugins/setbits.obj | Bin 0 -> 514 bytes Plugins/sharemem.h | 61 +++++++++++++++++++++++++ Plugins/shuffle.c | 42 +++++++++++++++++ Plugins/shuffle.dll | Bin 0 -> 28672 bytes Plugins/shuffle.exp | Bin 0 -> 583 bytes Plugins/shuffle.lib | Bin 0 -> 1956 bytes Plugins/shuffle.obj | Bin 0 -> 1020 bytes Plugins/sonogram.cpp | 82 +++++++++++++++++++++++++++++++++ Plugins/sonogram.dll | Bin 0 -> 45056 bytes Plugins/sonogram.exp | Bin 0 -> 630 bytes Plugins/sonogram.lib | Bin 0 -> 2080 bytes Plugins/sonogram.obj | Bin 0 -> 2306 bytes Plugins/subtract.cpp | 38 ++++++++++++++++ Plugins/subtract.dll | Bin 0 -> 28672 bytes Plugins/subtract.exp | Bin 0 -> 630 bytes Plugins/subtract.lib | Bin 0 -> 2080 bytes Plugins/subtract.obj | Bin 0 -> 1409 bytes Plugins/swap.cpp | 62 +++++++++++++++++++++++++ Plugins/swap.dll | Bin 0 -> 36864 bytes Plugins/swap.exp | Bin 0 -> 608 bytes Plugins/swap.lib | Bin 0 -> 2026 bytes Plugins/swap.obj | Bin 0 -> 1893 bytes Plugins/tile.cpp | 59 ++++++++++++++++++++++++ Plugins/tile.dll | Bin 0 -> 28672 bytes Plugins/tile.exp | Bin 0 -> 608 bytes Plugins/tile.lib | Bin 0 -> 2026 bytes Plugins/tile.obj | Bin 0 -> 1312 bytes Plugins/vf2fs.c | 49 ++++++++++++++++++++ Plugins/vf2fs.dll | Bin 0 -> 36864 bytes Plugins/vf2fs.exp | Bin 0 -> 575 bytes Plugins/vf2fs.lib | Bin 0 -> 1932 bytes Plugins/vf2fs.obj | Bin 0 -> 1894 bytes Plugins/xbend.c | 99 ++++++++++++++++++++++++++++++++++++++++ Plugins/xbend.dll | Bin 0 -> 36864 bytes Plugins/xbend.exp | Bin 0 -> 700 bytes Plugins/xbend.lib | Bin 0 -> 2120 bytes Plugins/xbend.obj | Bin 0 -> 1832 bytes Plugins/xshred.c | 20 ++++++++ Plugins/xshred.dll | Bin 0 -> 28672 bytes Plugins/xshred.exp | Bin 0 -> 570 bytes Plugins/xshred.lib | Bin 0 -> 1936 bytes Plugins/xshred.obj | Bin 0 -> 640 bytes 121 files changed, 1454 insertions(+) create mode 100644 Plugins/2colors.cpp create mode 100644 Plugins/2colors.dll create mode 100644 Plugins/2colors.exp create mode 100644 Plugins/2colors.lib create mode 100644 Plugins/2colors.obj create mode 100644 Plugins/README.txt create mode 100644 Plugins/bend.c create mode 100644 Plugins/bend.dll create mode 100644 Plugins/bend.exp create mode 100644 Plugins/bend.lib create mode 100644 Plugins/bend.obj create mode 100644 Plugins/black.c create mode 100644 Plugins/black.dll create mode 100644 Plugins/black.exp create mode 100644 Plugins/black.lib create mode 100644 Plugins/black.obj create mode 100644 Plugins/colortv.c create mode 100644 Plugins/colortv.dll create mode 100644 Plugins/colortv.exp create mode 100644 Plugins/colortv.lib create mode 100644 Plugins/colortv.obj create mode 100644 Plugins/copy_vert.c create mode 100644 Plugins/copy_vert.dll create mode 100644 Plugins/copy_vert.exp create mode 100644 Plugins/copy_vert.lib create mode 100644 Plugins/copy_vert.obj create mode 100644 Plugins/fs2vf.c create mode 100644 Plugins/fs2vf.dll create mode 100644 Plugins/fs2vf.exp create mode 100644 Plugins/fs2vf.lib create mode 100644 Plugins/fs2vf.obj create mode 100644 Plugins/gol.c create mode 100644 Plugins/gol.dll create mode 100644 Plugins/gol.exp create mode 100644 Plugins/gol.lib create mode 100644 Plugins/gol.obj create mode 100644 Plugins/green.cpp create mode 100644 Plugins/green.dll create mode 100644 Plugins/green.exp create mode 100644 Plugins/green.lib create mode 100644 Plugins/green.obj create mode 100644 Plugins/hist.cpp create mode 100644 Plugins/hist.dll create mode 100644 Plugins/hist.exp create mode 100644 Plugins/hist.lib create mode 100644 Plugins/hist.obj create mode 100644 Plugins/makefile create mode 100644 Plugins/makesliders.c create mode 100644 Plugins/makesliders.dll create mode 100644 Plugins/makesliders.exp create mode 100644 Plugins/makesliders.lib create mode 100644 Plugins/makesliders.obj create mode 100644 Plugins/ms.dll create mode 100644 Plugins/noize.c create mode 100644 Plugins/noize.dll create mode 100644 Plugins/noize.exp create mode 100644 Plugins/noize.lib create mode 100644 Plugins/noize.obj create mode 100644 Plugins/pixels.h create mode 100644 Plugins/plot.cpp create mode 100644 Plugins/plot.dll create mode 100644 Plugins/plot.exp create mode 100644 Plugins/plot.lib create mode 100644 Plugins/plot.obj create mode 100644 Plugins/plugin.h create mode 100644 Plugins/rgb.c create mode 100644 Plugins/rgb.dll create mode 100644 Plugins/rgb.exp create mode 100644 Plugins/rgb.lib create mode 100644 Plugins/rgb.obj create mode 100644 Plugins/rgbcopy.cpp create mode 100644 Plugins/rgbcopy.dll create mode 100644 Plugins/rgbcopy.exp create mode 100644 Plugins/rgbcopy.lib create mode 100644 Plugins/rgbcopy.obj create mode 100644 Plugins/setbits.c create mode 100644 Plugins/setbits.dll create mode 100644 Plugins/setbits.exp create mode 100644 Plugins/setbits.lib create mode 100644 Plugins/setbits.obj create mode 100644 Plugins/sharemem.h create mode 100644 Plugins/shuffle.c create mode 100644 Plugins/shuffle.dll create mode 100644 Plugins/shuffle.exp create mode 100644 Plugins/shuffle.lib create mode 100644 Plugins/shuffle.obj create mode 100644 Plugins/sonogram.cpp create mode 100644 Plugins/sonogram.dll create mode 100644 Plugins/sonogram.exp create mode 100644 Plugins/sonogram.lib create mode 100644 Plugins/sonogram.obj create mode 100644 Plugins/subtract.cpp create mode 100644 Plugins/subtract.dll create mode 100644 Plugins/subtract.exp create mode 100644 Plugins/subtract.lib create mode 100644 Plugins/subtract.obj create mode 100644 Plugins/swap.cpp create mode 100644 Plugins/swap.dll create mode 100644 Plugins/swap.exp create mode 100644 Plugins/swap.lib create mode 100644 Plugins/swap.obj create mode 100644 Plugins/tile.cpp create mode 100644 Plugins/tile.dll create mode 100644 Plugins/tile.exp create mode 100644 Plugins/tile.lib create mode 100644 Plugins/tile.obj create mode 100644 Plugins/vf2fs.c create mode 100644 Plugins/vf2fs.dll create mode 100644 Plugins/vf2fs.exp create mode 100644 Plugins/vf2fs.lib create mode 100644 Plugins/vf2fs.obj create mode 100644 Plugins/xbend.c create mode 100644 Plugins/xbend.dll create mode 100644 Plugins/xbend.exp create mode 100644 Plugins/xbend.lib create mode 100644 Plugins/xbend.obj create mode 100644 Plugins/xshred.c create mode 100644 Plugins/xshred.dll create mode 100644 Plugins/xshred.exp create mode 100644 Plugins/xshred.lib create mode 100644 Plugins/xshred.obj (limited to 'Plugins') diff --git a/Plugins/2colors.cpp b/Plugins/2colors.cpp new file mode 100644 index 0000000..b76be62 --- /dev/null +++ b/Plugins/2colors.cpp @@ -0,0 +1,21 @@ +#include +#include "plugin.h" +#include "pixels.h" + +// 2colors: make the image consist of black and white pixels only. +// I haven't tested this yet and it most likely WILL NOT WORK!!! + +void perform_effect(_frame f, _args a) +{ + pixels p(f); + int i=127, o; // intensity + + if(a.s) i=atoi(a.s); + + while(!p.eof()) + { + o = (p.red() + p.green() + p.blue()) / 3; + if(i +#include +#include "plugin.h" + +void perform_effect(_frame f, _args a) +{ + printf("NOTE: bend as effect does nothing. Use bend as copy operation.\n"); +} + +void perform_copy(_frame f1, _frame f2, _args a) +{ + int x, y, w, h, pos, pos2, src, ysrc, ypos1, ypos2, + widthminuspos, widthminuspos2, widthminusone, + heightminusypos1, heightminusypos2; + pixel8 *p1, *p2, tp=0, tpy=0; + char *t; + byte pixelsize = f1.pixelformat/8; + + if(!a.s) return; + pos = atoi(a.s); + if(t = strstr(a.s, " ")) + { + pos2 = atoi(t+1); + tp = 1; + if(t = strstr(t+1, " ")) + { + ypos1 = atoi(t+1); + if(t = strstr(t+1, " ")) + { + ypos2 = atoi(t+1); + if(ypos1>0||ypos2>0) tpy = 1; + } + } + } + + w = f1.width=w) pos=w-1; + if(pos2<0) pos2=0; + if(pos2>=w) pos2=w-1; + + if(ypos1<0) ypos1=0; + if(ypos1>=w) ypos1=w-1; + if(ypos2<0) ypos2=0; + if(ypos2>=w) ypos2=w-1; + + widthminuspos = f1.width-pos; + widthminuspos2 = f1.width-pos2; + widthminusone = w-1; + + heightminusypos1 = f1.height-ypos1; + heightminusypos2 = f1.height-ypos2; + + // here we'll avoid checking for pixelformat by taking the source and destination + // offsets as 8-bit, and multiplying that by pixelsize + + for(y=0; y +#include "plugin.h" + +void perform_effect(_frame f, _args a) +{ + memset(f.bits, 0, f.height*f.lpitch); +} + +void perform_copy(_frame f1, _frame f2, _args a) +{ + memset(f1.bits, 0, f1.height*f1.lpitch); + memset(f2.bits, 0, f2.height*f2.lpitch); +} diff --git a/Plugins/black.dll b/Plugins/black.dll new file mode 100644 index 0000000..cb8b57a Binary files /dev/null and b/Plugins/black.dll differ diff --git a/Plugins/black.exp b/Plugins/black.exp new file mode 100644 index 0000000..4399f54 Binary files /dev/null and b/Plugins/black.exp differ diff --git a/Plugins/black.lib b/Plugins/black.lib new file mode 100644 index 0000000..a21da90 Binary files /dev/null and b/Plugins/black.lib differ diff --git a/Plugins/black.obj b/Plugins/black.obj new file mode 100644 index 0000000..45e140d Binary files /dev/null and b/Plugins/black.obj differ diff --git a/Plugins/colortv.c b/Plugins/colortv.c new file mode 100644 index 0000000..1885d1f --- /dev/null +++ b/Plugins/colortv.c @@ -0,0 +1,69 @@ +#include "plugin.h" + +void perform_effect(struct frame f, struct args a) +{ + int x, y; + pixel16 *p16; + pixel32 *p32; + pixel16 c1, c2, c3; + + switch(f.pixelformat) + { + case 16: + for(y=0; y +#include +#include "plugin.h" + +void perform_copy(_frame f1, _frame f2, _args a) +{ + byte pixelsize = f1.pixelformat/8; + short x, y, xoff, w, h, size=1; + char *t; + + if(!a.s) return; + xoff = atoi(a.s); + + if(t = strstr(a.s, " ")) size=atoi(t+1); + + w = f1.width=w) + { + size = w - xoff; + if(!size) return; + } + + if(xoff<0 || xoff>=w) return; + + for(y=0; y +#include "plugin.h" +#include "sharemem.h" +#include "vframe.h" + +void perform_effect(_frame f, _args a) +{ + HANDLE hlvframe=NULL, hl=NULL; + LPVOID p=NULL; + struct vframeimage *vfp=NULL; + unsigned long c; + + if(!a.s) return; + + vfp = (struct vframeimage *)smopen(&hlvframe, a.s); + if(vfp==NULL) return; + +// printf("name %s width %d height %d pf %d bits %s\n", +// a.s, vfp->f.width, vfp->f.height, vfp->f.pixelformat, vfp->bitsname); + + if(f.pixelformat != vfp->f.pixelformat) + { + printf("fs2vf: pixelformats are different. no resampling available.\n"); + return; + } + + p = smopen(&hl, vfp->bitsname); + if(p==NULL) + { + CloseHandle(hlvframe); + return; + } + + c = (f.height*f.lpitch < vfp->f.height*vfp->f.lpitch) ? + f.height*f.lpitch : vfp->f.height*vfp->f.lpitch; + + memcpy(p, f.bits, c); + + smfree(&hl, p); + smfree(&hlvframe, vfp); +} diff --git a/Plugins/fs2vf.dll b/Plugins/fs2vf.dll new file mode 100644 index 0000000..974de86 Binary files /dev/null and b/Plugins/fs2vf.dll differ diff --git a/Plugins/fs2vf.exp b/Plugins/fs2vf.exp new file mode 100644 index 0000000..f3d5fba Binary files /dev/null and b/Plugins/fs2vf.exp differ diff --git a/Plugins/fs2vf.lib b/Plugins/fs2vf.lib new file mode 100644 index 0000000..038bb12 Binary files /dev/null and b/Plugins/fs2vf.lib differ diff --git a/Plugins/fs2vf.obj b/Plugins/fs2vf.obj new file mode 100644 index 0000000..4996274 Binary files /dev/null and b/Plugins/fs2vf.obj differ diff --git a/Plugins/gol.c b/Plugins/gol.c new file mode 100644 index 0000000..89ff284 --- /dev/null +++ b/Plugins/gol.c @@ -0,0 +1,89 @@ + +// +// Game of Life .. what a waste of time +// + +#include +#include +#include "plugin.h" + +#define BORN 1 +#define DYING 2 + +int dead = 0; + +int aroundme(_frame f, int x, int y) +{ + int i=0; + if(r16(scanline16(f, y-1)[x-1])>dead) i++; + if(r16(scanline16(f, y-1)[x])>dead) i++; + if(r16(scanline16(f, y-1)[x+1])>dead) i++; + if(r16(scanline16(f, y)[x-1])>dead) i++; + if(r16(scanline16(f, y)[x+1])>dead) i++; + if(r16(scanline16(f, y+1)[x-1])>dead) i++; + if(r16(scanline16(f, y+1)[x])>dead) i++; + if(r16(scanline16(f, y+1)[x+1])>dead) i++; + return i; +} + +void setstate(_frame f, byte *t, int x, int y) +{ + int i = aroundme(f, x, y); + + if(i<=1 || i>=4) t[y*f.width+x]=DYING; + else + if(i==3) t[y*f.width+x]=BORN; +} + +void perform_effect(struct frame f, struct args a) +{ + int x,y,i,r; + pixel16 *p, c; + byte *t; + + if(f.pixelformat!=16) return; + + t = malloc(f.width*f.height); + memset(t, 0, f.width*f.height); + + for(y=2; y0) + { + setstate(f, t, x-1, y-1); + setstate(f, t, x, y-1); + setstate(f, t, x+1, y-1); + setstate(f, t, x-1, y); + setstate(f, t, x, y); + setstate(f, t, x+1, y); + setstate(f, t, x-1, y+1); + setstate(f, t, x, y+1); + setstate(f, t, x+1, y+1); + } + } + } + + for(y=2; y0 ? r : 255, g16(c), b16(c)); + break; + case DYING: + c = p[+x]; + p[x] = rgbtocolor16(0, g16(c), b16(c)); + break; + } + } + } + free(t); +} diff --git a/Plugins/gol.dll b/Plugins/gol.dll new file mode 100644 index 0000000..dfd2fd6 Binary files /dev/null and b/Plugins/gol.dll differ diff --git a/Plugins/gol.exp b/Plugins/gol.exp new file mode 100644 index 0000000..2dcf523 Binary files /dev/null and b/Plugins/gol.exp differ diff --git a/Plugins/gol.lib b/Plugins/gol.lib new file mode 100644 index 0000000..c38fb4e Binary files /dev/null and b/Plugins/gol.lib differ diff --git a/Plugins/gol.obj b/Plugins/gol.obj new file mode 100644 index 0000000..e571ee0 Binary files /dev/null and b/Plugins/gol.obj differ diff --git a/Plugins/green.cpp b/Plugins/green.cpp new file mode 100644 index 0000000..c66e3e6 --- /dev/null +++ b/Plugins/green.cpp @@ -0,0 +1,14 @@ +// this is just an example of using the pixels-class.. + +#include "plugin.h" +#include "pixels.h" + +void perform_effect(_frame f, _args a) +{ + pixels p(f); + while(!p.eof()) + { + p.putrgb(0, p.green(), 0); + p.next(); + } +} diff --git a/Plugins/green.dll b/Plugins/green.dll new file mode 100644 index 0000000..3dc1016 Binary files /dev/null and b/Plugins/green.dll differ diff --git a/Plugins/green.exp b/Plugins/green.exp new file mode 100644 index 0000000..bba3425 Binary files /dev/null and b/Plugins/green.exp differ diff --git a/Plugins/green.lib b/Plugins/green.lib new file mode 100644 index 0000000..f79b6b6 Binary files /dev/null and b/Plugins/green.lib differ diff --git a/Plugins/green.obj b/Plugins/green.obj new file mode 100644 index 0000000..d32d5ab Binary files /dev/null and b/Plugins/green.obj differ diff --git a/Plugins/hist.cpp b/Plugins/hist.cpp new file mode 100644 index 0000000..f525db1 --- /dev/null +++ b/Plugins/hist.cpp @@ -0,0 +1,54 @@ +// +// build an array where x=color intensity and y=number of colors with that intensity. +// use with fs.hist.pd. +// +// array is passed in a file, a better solution would be to use vframe... +// + +#include +#include +#include +#include +#include +#include "plugin.h" +#include "pixels.h" + +void perform_effect(_frame f, _args a) +{ + if(!a.s) return; + + // parameters: + // get gol + byte col = atoi(a.s); + + // get filename + char *t; + if(!(t = strstr(a.s, " "))) return; + char *filename = t+1; + + // get receivename + if(!(t = strstr(t+1, " "))) return; + char *retname = t+1; + t[0]=0; // tell filename and receivename apart + + pixels p(f); + signed short hist[256]; // 16bits, for read16 on pd + +// count colors from zero up + memset(hist, 0, sizeof(hist)); +// or count from -2^15 (bottom of graph)? +// short i, v=1<<15; +// for(i=0; i<256; hist[i++]=v) ; + + while(!p.eof()) + { + ++hist[col==0 ? p.red() : col==1 ? p.green() : col==2 ? p.blue() : 0]; + p.next(); + } + + ofstream of(filename, ios::out|ios::binary); + of.write((char *)&hist, sizeof(hist)); + of.close(); + + sprintf(a.ret, "%s=1", retname); // bang to indicate we're done +} diff --git a/Plugins/hist.dll b/Plugins/hist.dll new file mode 100644 index 0000000..7c0bc44 Binary files /dev/null and b/Plugins/hist.dll differ diff --git a/Plugins/hist.exp b/Plugins/hist.exp new file mode 100644 index 0000000..238ffc2 Binary files /dev/null and b/Plugins/hist.exp differ diff --git a/Plugins/hist.lib b/Plugins/hist.lib new file mode 100644 index 0000000..d8d0ddc Binary files /dev/null and b/Plugins/hist.lib differ diff --git a/Plugins/hist.obj b/Plugins/hist.obj new file mode 100644 index 0000000..760936d Binary files /dev/null and b/Plugins/hist.obj differ diff --git a/Plugins/makefile b/Plugins/makefile new file mode 100644 index 0000000..e899fe2 --- /dev/null +++ b/Plugins/makefile @@ -0,0 +1,82 @@ +all: noize colortv subtract xbend bend gol shuffle green tile rgbcopy copyvert black rgb hist setbits xshred sonogram vf2fs fs2vf swap 2colors plot makesliders + dir *.dll + +# FLAGS: +# +# + +FLAGS = /LD /Gd /GD /Ox + +EFFECT = /export:perform_effect +COPY = /export:perform_copy +BOTH = /export:perform_effect /export:perform_copy + +noize: + cl noize.c $(FLAGS) /link $(BOTH) + +colortv: + cl colortv.c $(FLAGS) /link $(BOTH) + +subtract: + cl subtract.cpp $(FLAGS) /link $(EFFECT) + +xbend: + cl xbend.c $(FLAGS) /link $(BOTH) + +bend: + cl bend.c $(FLAGS) /link $(BOTH) + +gol: + cl gol.c $(FLAGS) /link $(EFFECT) + +shuffle: + cl shuffle.c $(FLAGS) /link $(EFFECT) + +green: + cl green.cpp $(FLAGS) /link $(EFFECT) + +tile: + cl tile.cpp $(FLAGS) /link $(COPY) + +rgbcopy: + cl rgbcopy.cpp $(FLAGS) /link $(COPY) + +copyvert: + cl copy_vert.c $(FLAGS) /link $(COPY) + +black: + cl black.c $(FLAGS) /link $(BOTH) + +rgb: + cl rgb.c $(FLAGS) /link $(EFFECT) + +hist: + cl hist.cpp $(FLAGS) /link $(EFFECT) + +setbits: + cl setbits.c $(FLAGS) /link $(EFFECT) + +sonogram: + cl sonogram.cpp $(FLAGS) /link $(EFFECT) + +xshred: + cl xshred.c $(FLAGS) /link $(COPY) + +vf2fs: + cl vf2fs.c $(FLAGS) /I..\Externals /link $(EFFECT) + +fs2vf: + cl fs2vf.c $(FLAGS) /I..\Externals /link $(EFFECT) + +swap: + cl swap.cpp $(FLAGS) /link $(COPY) + +2colors: + cl 2colors.cpp $(FLAGS) /link $(EFFECT) + +plot: + cl plot.cpp $(FLAGS) /link $(EFFECT) + +makesliders: + cl makesliders.c $(FLAGS) /link $(EFFECT) + copy makesliders.dll ms.dll 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 +#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=0 && y +#include "plugin.h" + +void perform_effect(struct frame f, struct args a) +{ + int i,o,x,y; + byte bits = f.pixelformat/8; + + o=(f.width*f.height)/10; + for(i=0; i +#include +#include +#include "plugin.h" +#include "pixels.h" + +// plot exists to provide plotting to vframe - much faster than +// plot with fs.draw which goes thru network. + +void perform_effect(_frame f, _args a) +{ + if(!a.s) return; + + char *t=strstr(a.s, " "); + if(!t) return; + + t[0]=0; + + int x=atoi(a.s); + int y=atoi(t+1); + + pixels p(f); + p.moveto(x, y); + p.putrgb(255, 255, 255); +} diff --git a/Plugins/plot.dll b/Plugins/plot.dll new file mode 100644 index 0000000..93cff6a Binary files /dev/null and b/Plugins/plot.dll differ diff --git a/Plugins/plot.exp b/Plugins/plot.exp new file mode 100644 index 0000000..1d5ce2f Binary files /dev/null and b/Plugins/plot.exp differ diff --git a/Plugins/plot.lib b/Plugins/plot.lib new file mode 100644 index 0000000..afdc085 Binary files /dev/null and b/Plugins/plot.lib differ diff --git a/Plugins/plot.obj b/Plugins/plot.obj new file mode 100644 index 0000000..c48c30f Binary files /dev/null and b/Plugins/plot.obj differ diff --git a/Plugins/plugin.h b/Plugins/plugin.h new file mode 100644 index 0000000..00d3514 --- /dev/null +++ b/Plugins/plugin.h @@ -0,0 +1,119 @@ +// +// send the name of the plugin to fs.frame, and fs will call +// perform_effect(struct frame f, struct args a) in your dll. +// +// send it to the right inlet of fs.copy, and +// perform_copy(struct frame f1, struct frame f2, struct args a) +// will be used as a copy operation. +// + +#ifndef _PLUGINH +#define _PLUGINH + +typedef unsigned char byte; +#define pixel8 byte +#define pixel16 unsigned short +#define pixel24 struct pixel24data +#define pixel32 unsigned long +#define _frame struct frame +#define _args struct args + +struct pixel24data { byte b; byte g; byte r; }; + +struct frame +{ + byte *bits; // pixel data + int lpitch; // used to get row position in bits, see scanline below + // this is not always width*(pixelformat/8), you tell me why + int width; + int height; + int pixelformat; // pixelformat is bitcount of your screen, 8, 16, 24 or 32. +}; + +struct args +{ + char *s; // effect/copy arguments in a string + char *ret; // return values. data given in the form + // "pd_receive_name=value;..." will be sent back to Pd. + // memory allocated: 256 characters. +}; + +// 8-bit pointer to row y +__inline byte *scanline(struct frame f, int y) { return &f.bits[y*f.lpitch]; } + +// pointer to 16 bit pixels +__inline pixel16 *scanline16(struct frame f, int y) { return (pixel16 *)scanline(f, y); } + +// pointer to 24 bit pixels +__inline pixel24 *scanline24(struct frame f, int y) { return (pixel24 *)scanline(f, y); } + +// pointer to 32 bit pixels +__inline pixel32 *scanline32(struct frame f, int y) { return (pixel32 *)scanline(f, y); } + +__inline byte r16(pixel16 color) +{ + return (color >> 11) << 3; +} + +__inline byte g16(pixel16 color) +{ + return ((color & 2016) >> 5) << 2; +} + +__inline byte b16(pixel16 color) +{ + return (color & 31) << 3; +} + +__inline byte r24(pixel24 color) +{ + return color.r; +} + +__inline byte g24(pixel24 color) +{ + return color.g; +} + +__inline byte b24(pixel24 color) +{ + return color.b; +} + +__inline byte r32(pixel32 color) +{ + return (byte)color; +} + +__inline byte g32(pixel32 color) +{ + return (byte)(((pixel16)color) >> 8); +} + +__inline byte b32(pixel32 color) +{ + return (byte)(color >> 16); +} + +__inline pixel16 rgbtocolor16(byte r, byte g, byte b) +{ + return ((r >> 3) << 11) | // r value shifted + ((g >> 2) << 5) | // g value shifted + (b >> 3); // add blue +} + +__inline pixel24 rgbtocolor24(byte r, byte g, byte b) +{ + pixel24 p; + p.r = r; + p.g = g; + p.b = b; + return p; +} + +__inline pixel32 rgbtocolor32(byte r, byte g, byte b) +{ + return (b << 16) | (g << 8) | r; +} + +#endif // #ifndef _PLUGINH diff --git a/Plugins/rgb.c b/Plugins/rgb.c new file mode 100644 index 0000000..d58f784 --- /dev/null +++ b/Plugins/rgb.c @@ -0,0 +1,62 @@ +#include +#include "plugin.h" + +void perform_effect(_frame f, _args a) +{ + char *t; + short x, y; + pixel16 c16; + pixel24 c24; + pixel32 c32; + byte r, g, b; + char *ret_r, *ret_g, *ret_b; + + if(!a.s) return; + + // get x and y params + x = atoi(a.s); + if(!(t = strstr(a.s, " "))) return; + y = atoi(t+1); + + // get returnvaluereceivenames + if(!(t = strstr(t+1, " "))) return; + ret_r = t+1; + if(!(t = strstr(t+1, " "))) return; + ret_g = t+1; + t[0]=0; + if(!(t = strstr(t+1, " "))) return; + ret_b = t+1; + t[0]=0; + + if(x<0||x>=f.width) return; + if(y<0||y>=f.height) return; + + switch(f.pixelformat) + { + case 16: + c16 = scanline16(f, y)[x]; + r = r16(c16); + g = g16(c16); + b = b16(c16); + break; + case 24: + c24 = scanline24(f, y)[x]; + r = r24(c24); + g = g24(c24); + b = b24(c24); + break; + case 32: + c32 = scanline32(f, y)[x]; + r = r32(c32); + g = g32(c32); + b = b32(c32); + break; + } + + // return-values: + // + // framestein will send data given in the form "pd_receiver_name=value" + // back to pd. + + sprintf(a.ret, "%s=%d;%s=%d;%s=%d", ret_b, b, ret_g, g, ret_r, r); +} diff --git a/Plugins/rgb.dll b/Plugins/rgb.dll new file mode 100644 index 0000000..ba7dfd2 Binary files /dev/null and b/Plugins/rgb.dll differ diff --git a/Plugins/rgb.exp b/Plugins/rgb.exp new file mode 100644 index 0000000..cc7feab Binary files /dev/null and b/Plugins/rgb.exp differ diff --git a/Plugins/rgb.lib b/Plugins/rgb.lib new file mode 100644 index 0000000..8e364a1 Binary files /dev/null and b/Plugins/rgb.lib differ diff --git a/Plugins/rgb.obj b/Plugins/rgb.obj new file mode 100644 index 0000000..69b7892 Binary files /dev/null and b/Plugins/rgb.obj differ diff --git a/Plugins/rgbcopy.cpp b/Plugins/rgbcopy.cpp new file mode 100644 index 0000000..b226e23 --- /dev/null +++ b/Plugins/rgbcopy.cpp @@ -0,0 +1,28 @@ +#include +#include +#include "plugin.h" +#include "pixels.h" + +void perform_copy(_frame f1, _frame f2, _args a) +{ + pixels p1(f1), p2(f2); + char *t; + short r=0, g=0, b=0; + + if(!a.s) return; + + if(strstr(a.s, "r") || strstr(a.s, "R")) r=1; + if(strstr(a.s, "g") || strstr(a.s, "G")) g=1; + if(strstr(a.s, "b") || strstr(a.s, "B")) b=1; + + while(!p1.eof()&&!p2.eof()) + { + p2.putrgb( + r ? p1.red() : p2.red(), + g ? p1.green() : p2.green(), + b ? p1.blue() : p2.blue() + ); + p1.next(); + p2.next(); + } +} diff --git a/Plugins/rgbcopy.dll b/Plugins/rgbcopy.dll new file mode 100644 index 0000000..1a995d3 Binary files /dev/null and b/Plugins/rgbcopy.dll differ diff --git a/Plugins/rgbcopy.exp b/Plugins/rgbcopy.exp new file mode 100644 index 0000000..b85e71e Binary files /dev/null and b/Plugins/rgbcopy.exp differ diff --git a/Plugins/rgbcopy.lib b/Plugins/rgbcopy.lib new file mode 100644 index 0000000..09edbd5 Binary files /dev/null and b/Plugins/rgbcopy.lib differ diff --git a/Plugins/rgbcopy.obj b/Plugins/rgbcopy.obj new file mode 100644 index 0000000..5d7194c Binary files /dev/null and b/Plugins/rgbcopy.obj differ diff --git a/Plugins/setbits.c b/Plugins/setbits.c new file mode 100644 index 0000000..dddc5eb --- /dev/null +++ b/Plugins/setbits.c @@ -0,0 +1,11 @@ +#include +#include "plugin.h" + +void perform_effect(_frame f, _args a) +{ + unsigned char c; + + if(!a.s) return; + c = atoi(a.s); + memset(f.bits, c, f.height*f.lpitch); +} diff --git a/Plugins/setbits.dll b/Plugins/setbits.dll new file mode 100644 index 0000000..9a772ab Binary files /dev/null and b/Plugins/setbits.dll differ diff --git a/Plugins/setbits.exp b/Plugins/setbits.exp new file mode 100644 index 0000000..484fe3b Binary files /dev/null and b/Plugins/setbits.exp differ diff --git a/Plugins/setbits.lib b/Plugins/setbits.lib new file mode 100644 index 0000000..1e1db08 Binary files /dev/null and b/Plugins/setbits.lib differ diff --git a/Plugins/setbits.obj b/Plugins/setbits.obj new file mode 100644 index 0000000..09a9196 Binary files /dev/null and b/Plugins/setbits.obj differ diff --git a/Plugins/sharemem.h b/Plugins/sharemem.h new file mode 100644 index 0000000..a26d198 --- /dev/null +++ b/Plugins/sharemem.h @@ -0,0 +1,61 @@ +#ifndef __SHAREMEM_H +#define __SHAREMEM_H + +#include +#include + +// +// allocate named shared memory +// +LPVOID smalloc(HANDLE *h, char *name, DWORD size) +{ + LPVOID p; + + *h = CreateFileMapping( + INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, + size, name + ); + + if(*h==NULL) return(NULL); + + p = MapViewOfFile( *h, FILE_MAP_WRITE, 0, 0, 0); + + if(p==NULL) + { + CloseHandle(*h); + return(NULL); + } + return(p); +} + +// +// open access to named shared memory +// +LPVOID smopen(HANDLE *h, char *name) +{ + LPVOID p; + + *h = OpenFileMapping(FILE_MAP_ALL_ACCESS, TRUE, name); + + if(*h==NULL) return(NULL); + + p = MapViewOfFile(*h, FILE_MAP_WRITE, 0, 0, 0); + + if(p==NULL) + { + CloseHandle(*h); + return(NULL); + } + return(p); +} + +// +// cleanup +// +void smfree(HANDLE *h, LPVOID p) +{ + UnmapViewOfFile(p); + CloseHandle(*h); +} + +#endif 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); + } +} diff --git a/Plugins/shuffle.dll b/Plugins/shuffle.dll new file mode 100644 index 0000000..bd5d552 Binary files /dev/null and b/Plugins/shuffle.dll differ diff --git a/Plugins/shuffle.exp b/Plugins/shuffle.exp new file mode 100644 index 0000000..2802b94 Binary files /dev/null and b/Plugins/shuffle.exp differ diff --git a/Plugins/shuffle.lib b/Plugins/shuffle.lib new file mode 100644 index 0000000..d1bc16f Binary files /dev/null and b/Plugins/shuffle.lib differ diff --git a/Plugins/shuffle.obj b/Plugins/shuffle.obj new file mode 100644 index 0000000..5c70ab2 Binary files /dev/null and b/Plugins/shuffle.obj differ diff --git a/Plugins/sonogram.cpp b/Plugins/sonogram.cpp new file mode 100644 index 0000000..821b94a --- /dev/null +++ b/Plugins/sonogram.cpp @@ -0,0 +1,82 @@ +// +// sonogram.cpp +// +// use with fs.sonogram +// +// see example-sonogram.pd +// + +#include +#include +#include +#include +#include +#include "plugin.h" +#include "pixels.h" + +#define SONOSIZE 128 +#define SONOMAXVAL 500 +#define sonotype float + +int callcount=-1; + +void perform_effect(_frame f, _args a) +{ + if(!a.s) return; + + if(++callcount>=f.width) callcount=0; + + FILE *inf; + if((inf = fopen(a.s, "rb"))==NULL) + { + printf("sonogram: error opening %s\n", a.s); + return; + } + + char buf[80]; + sonotype sono[SONOSIZE]; + int i=0; + + while(!feof(inf)) + { + if(!fgets(buf, 80, inf)) + { + printf("sonogram: read error.\n"); + return; + } + sono[i] = atof(buf); + if(++i>=SONOSIZE) break; + } + fclose(inf); + + int y; + + for(i=0; iSONOMAXVAL) sono[i]=SONOMAXVAL; + sono[i] = (sonotype)((sono[i] / (float)SONOMAXVAL)*255); + // white = no sound + sono[i] = abs(sono[i]-255); + + y = (int)((i / (float)SONOSIZE) * (float)f.height); + // bottom = bass + y = abs((f.height-1) - y); + + switch(f.pixelformat) + { + case 16: + scanline16(f, y)[callcount] = + rgbtocolor16(sono[i], sono[i], sono[i]); + break; + case 24: + scanline24(f, y)[callcount] = + rgbtocolor24(sono[i], sono[i], sono[i]); + break; + case 32: + scanline32(f, y)[callcount] = + rgbtocolor32(sono[i], sono[i], sono[i]); + break; + } + } +} diff --git a/Plugins/sonogram.dll b/Plugins/sonogram.dll new file mode 100644 index 0000000..db6e132 Binary files /dev/null and b/Plugins/sonogram.dll differ diff --git a/Plugins/sonogram.exp b/Plugins/sonogram.exp new file mode 100644 index 0000000..40a6fae Binary files /dev/null and b/Plugins/sonogram.exp differ diff --git a/Plugins/sonogram.lib b/Plugins/sonogram.lib new file mode 100644 index 0000000..484c38d Binary files /dev/null and b/Plugins/sonogram.lib differ diff --git a/Plugins/sonogram.obj b/Plugins/sonogram.obj new file mode 100644 index 0000000..7dd6ee5 Binary files /dev/null and b/Plugins/sonogram.obj differ diff --git a/Plugins/subtract.cpp b/Plugins/subtract.cpp new file mode 100644 index 0000000..89ba216 --- /dev/null +++ b/Plugins/subtract.cpp @@ -0,0 +1,38 @@ +// 0.20 +// - from c to c++ +// - pixelformat-aware + +#include +#include +#include "plugin.h" +#include "pixels.h" + +void perform_effect(_frame f, _args a) +{ + pixels p(f); + char *t; + byte tr, tg, tb, r=0, g=0, b=0; + + if(!a.s) return; + + r = atoi(a.s); + if(t = strstr(a.s, " ")) + { + g = atoi(t+1); + if (t = strstr(t+1, " ")) + b = atoi(t+1); + } + + while(!p.eof()) + { + tr = p.red(); + tg = p.green(); + tb = p.blue(); + p.putrgb( + tr>r ? tr-r : 0, + tg>g ? tg-g : 0, + tb>b ? tb-b : 0 + ); + p.next(); + } +} diff --git a/Plugins/subtract.dll b/Plugins/subtract.dll new file mode 100644 index 0000000..883c541 Binary files /dev/null and b/Plugins/subtract.dll differ diff --git a/Plugins/subtract.exp b/Plugins/subtract.exp new file mode 100644 index 0000000..9a066ba Binary files /dev/null and b/Plugins/subtract.exp differ diff --git a/Plugins/subtract.lib b/Plugins/subtract.lib new file mode 100644 index 0000000..5132561 Binary files /dev/null and b/Plugins/subtract.lib differ diff --git a/Plugins/subtract.obj b/Plugins/subtract.obj new file mode 100644 index 0000000..8405ccc Binary files /dev/null and b/Plugins/subtract.obj differ diff --git a/Plugins/swap.cpp b/Plugins/swap.cpp new file mode 100644 index 0000000..d1389f4 --- /dev/null +++ b/Plugins/swap.cpp @@ -0,0 +1,62 @@ +#include +#include +#include +#include "plugin.h" +#include "pixels.h" + +// swap selected area on two images +// args: swap sourcex1 sourcey1 sourcex2 sourcey2 destx desty +// (the selection is of equal size on both images) + +void swapint(int *a, int *b) +{ + int i = *b; + *b = *a; + *a = i; +} + +void perform_copy(_frame f1, _frame f2, _args a) +{ + if(!a.s) return; + + // get args + int sx1, sy1, sx2, sy2, dx1, dy1; + char *t; + + sx1 = atoi(a.s); + if(!(t = strstr(a.s, " "))) return; + sy1 = atoi(t); + if(!(t = strstr(t+1, " "))) return; + sx2 = atoi(t); + if(!(t = strstr(t+1, " "))) return; + sy2 = atoi(t); + if(!(t = strstr(t+1, " "))) return; + dx1 = atoi(t); + if(!(t = strstr(t+1, " "))) return; + dy1 = atoi(t); + + if(sx1>sx2) swapint(&sx1, &sx2); + if(sy1>sy2) swapint(&sy1, &sy2); + +printf("swap: %d %d %d %d - %d %d\n", sx1, sy1, sx2, sy2, dx1, dy1); + + int x, y, i, o; + pixel16 c16; + pixels p1(f1), p2(f2); + + for(y=sy1; y<=sy2; y++) + for(x=sx1; x<=sx2; x++) + { + if(x>=f1.width || y>=f1.height) continue; + i = dx1+(x-sx1); + o = dy1+(y-sy1); + if(i>=f2.width || o>=f2.height) continue; + + p1.moveto(x, y); + p2.moveto(i, o); + + c16 = p2.dot16(); + p2.dot16(p1.dot16()); + p1.dot16(c16); + } +} diff --git a/Plugins/swap.dll b/Plugins/swap.dll new file mode 100644 index 0000000..ee04f4c Binary files /dev/null and b/Plugins/swap.dll differ diff --git a/Plugins/swap.exp b/Plugins/swap.exp new file mode 100644 index 0000000..8015b40 Binary files /dev/null and b/Plugins/swap.exp differ diff --git a/Plugins/swap.lib b/Plugins/swap.lib new file mode 100644 index 0000000..bda1a31 Binary files /dev/null and b/Plugins/swap.lib differ diff --git a/Plugins/swap.obj b/Plugins/swap.obj new file mode 100644 index 0000000..cca03a8 Binary files /dev/null and b/Plugins/swap.obj differ diff --git a/Plugins/tile.cpp b/Plugins/tile.cpp new file mode 100644 index 0000000..47fa5ca --- /dev/null +++ b/Plugins/tile.cpp @@ -0,0 +1,59 @@ +#include +#include +#include "plugin.h" +#include "pixels.h" + +void perform_copy(_frame f1, _frame f2, _args a) +{ + pixels px(f2); + pixel16 *p16; + pixel24 *p24; + pixel32 *p32; + int tile, tiley=-1, prevy=-1; + char *t; + + tile = atoi(a.s); + if(tile<=0) tile=2; + if(t = strstr(a.s, " ")) + { + tiley = atoi(t+1); + if(tiley<=0) tiley=2; + } + + // i could have the switch() inside the while-loop.. + // but is it more efficient this way? + + switch(f1.pixelformat) + { + case 16: + while(!px.eof()) { + if(px.y != prevy) { + p16 = scanline16(f1, (px.y * (tiley>0 ? tiley : tile))%f1.height); + prevy = px.y; + } + px.dot16(p16[ (px.x * tile)%f1.width ]); + px.next(); + } + break; + case 24: + while(!px.eof()) { + if(px.y != prevy) { + p24 = scanline24(f1, (px.y * (tiley>0 ? tiley : tile))%f1.height); + prevy = px.y; + } + px.dot24(p24[ (px.x * tile)%f1.width ]); + px.next(); + } + break; + case 32: + while(!px.eof()) { + if(px.y != prevy) { + p32 = scanline32(f1, (px.y * (tiley>0 ? tiley : tile))%f1.height); + prevy = px.y; + } + px.dot32(p32[ (px.x * tile)%f1.width ]); + px.next(); + } + break; + } +} diff --git a/Plugins/tile.dll b/Plugins/tile.dll new file mode 100644 index 0000000..58a8886 Binary files /dev/null and b/Plugins/tile.dll differ diff --git a/Plugins/tile.exp b/Plugins/tile.exp new file mode 100644 index 0000000..69d5907 Binary files /dev/null and b/Plugins/tile.exp differ diff --git a/Plugins/tile.lib b/Plugins/tile.lib new file mode 100644 index 0000000..1f0732e Binary files /dev/null and b/Plugins/tile.lib differ diff --git a/Plugins/tile.obj b/Plugins/tile.obj new file mode 100644 index 0000000..8409075 Binary files /dev/null and b/Plugins/tile.obj differ diff --git a/Plugins/vf2fs.c b/Plugins/vf2fs.c new file mode 100644 index 0000000..47e856e --- /dev/null +++ b/Plugins/vf2fs.c @@ -0,0 +1,49 @@ +// +// readvf.c +// used to display vframe objects +// +// 1st argument is name of shared memory +// to struct vframeimage (see Externals\vframe.h) +// + +#include +#include "plugin.h" +#include "sharemem.h" +#include "vframe.h" + +void perform_effect(_frame f, _args a) +{ + HANDLE hlvframe=NULL, hl=NULL; + LPVOID p=NULL; + struct vframeimage *vfp=NULL; + unsigned long c; + + if(!a.s) return; + + vfp = (struct vframeimage *)smopen(&hlvframe, a.s); + if(vfp==NULL) return; + +// printf("name %s width %d height %d pf %d bits %s\n", +// a.s, vfp->f.width, vfp->f.height, vfp->f.pixelformat, vfp->bitsname); + + if(f.pixelformat != vfp->f.pixelformat) + { + printf("vf2fs: pixelformats are different. no resampling available.\n"); + return; + } + + p = smopen(&hl, vfp->bitsname); + if(p==NULL) + { + CloseHandle(hlvframe); + return; + } + + c = (f.height*f.lpitch < vfp->f.height*vfp->f.lpitch) ? + f.height*f.lpitch : vfp->f.height*vfp->f.lpitch; + + memcpy(f.bits, p, c); + + smfree(&hl, p); + smfree(&hlvframe, vfp); +} diff --git a/Plugins/vf2fs.dll b/Plugins/vf2fs.dll new file mode 100644 index 0000000..d51abad Binary files /dev/null and b/Plugins/vf2fs.dll differ diff --git a/Plugins/vf2fs.exp b/Plugins/vf2fs.exp new file mode 100644 index 0000000..c9ce25b Binary files /dev/null and b/Plugins/vf2fs.exp differ diff --git a/Plugins/vf2fs.lib b/Plugins/vf2fs.lib new file mode 100644 index 0000000..0c52583 Binary files /dev/null and b/Plugins/vf2fs.lib differ diff --git a/Plugins/vf2fs.obj b/Plugins/vf2fs.obj new file mode 100644 index 0000000..4c0a7bd Binary files /dev/null and b/Plugins/vf2fs.obj differ diff --git a/Plugins/xbend.c b/Plugins/xbend.c new file mode 100644 index 0000000..1ba9959 --- /dev/null +++ b/Plugins/xbend.c @@ -0,0 +1,99 @@ +#include +#include +#include "plugin.h" + +void perform_effect(_frame f, _args a) +{ + byte pixelsize = f.pixelformat/8; + int x, y, pos, pos2, widthminuspos, widthminuspos2; + pixel8 *p, *tp=0; + char *t; + + if(!a.s) return; + + pos = atoi(a.s); + if(t = strstr(a.s, " ")) + { + pos2 = atoi(t+1); + tp = (pixel8 *)malloc(f.width*pixelsize); + } + + if(pos<0) pos=0; + if(pos>=f.width) pos=f.width-1; + if(pos2<0) pos2=0; + if(pos2>=f.width) pos2=f.width-1; + + widthminuspos = f.width-pos; + widthminuspos2 = f.width-pos2; + + for(y=0; y=w) pos=w-1; + if(pos2<0) pos2=0; + if(pos2>=w) pos2=w-1; + + widthminuspos = f1.width-pos; + widthminuspos2 = f1.width-pos2; + widthminusone = w-1; + + for(y=0; y +#include "plugin.h" + +void perform_copy(_frame f1, _frame f2, _args a) +{ + int step, w, h, y, pixelsize=f1.pixelformat/8; + + if(!a.s) return; + + step = atoi(a.s); + if(step<=0) step=1; + + w = f1.width