glassgridfilter.lua 711 B

12345678910111213
  1. -- Glass grid filter - Copyright 2010 Paulo Silva
  2. -- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
  3. w,h=getpicturesize();
  4. ok,xsiz,ysiz=inputbox("message","xsize",8,0,64,5,"ysize",8,0,64,6);
  5. if ok==true then
  6. for y1=0,h-1,xsiz do
  7. for x1=0,w-1,ysiz do
  8. for y2=0,(ysiz/2)-1,1 do
  9. for x2=0,xsiz-1,1 do
  10. c1=getpicturepixel(x1+x2,y1+y2);c2=getpicturepixel(x1+(xsiz-1)-x2,y1+(ysiz-1)-y2)
  11. putpicturepixel(x1+x2,y1+y2,c2);putpicturepixel(x1+(xsiz-1)-x2,y1+(ysiz-1)-y2,c1)
  12. end;end;end;end;end