Reorganized source code and directory tree.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1375 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
28
share/grafx2/scripts/bru_db_Halfsmooth.lua
Normal file
28
share/grafx2/scripts/bru_db_Halfsmooth.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
--BRUSH: Halfsize with smoothscaling
|
||||
--by Richard Fhager
|
||||
--http://hem.fyristorg.com/dawnbringer/
|
||||
|
||||
|
||||
w, h = getbrushsize()
|
||||
|
||||
setbrushsize(math.floor(w/2),math.floor(h/2))
|
||||
|
||||
for x = 0, w - 1, 2 do
|
||||
for y = 0, h - 1, 2 do
|
||||
r1,g1,b1 = getcolor(getbrushbackuppixel(x,y));
|
||||
r2,g2,b2 = getcolor(getbrushbackuppixel(x+1,y));
|
||||
r3,g3,b3 = getcolor(getbrushbackuppixel(x,y+1));
|
||||
r4,g4,b4 = getcolor(getbrushbackuppixel(x+1,y+1));
|
||||
|
||||
r = (r1 + r2 + r3 + r4 ) / 4;
|
||||
g = (g1 + g2 + g3 + g4 ) / 4;
|
||||
b = (b1 + b2 + b3 + b4 ) / 4;
|
||||
|
||||
c = matchcolor(r,g,b);
|
||||
|
||||
putbrushpixel(x/2, y/2, c);
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user