Created
April 24, 2013 16:43
-
-
Save valexey/5453596 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROCEDURE Blur2DArray*; | |
VAR | |
time : LONGINT; | |
f, n : INTEGER; | |
x, y : INTEGER; | |
color : INTEGER; | |
a, b : POINTER TO Plane; | |
BEGIN | |
NEW(a); | |
NEW(b); | |
time := Kernel.Time(); | |
FOR f:=1 TO Frames DO | |
FOR n:=1 TO N DO | |
FOR y:=1 TO H-2 DO | |
FOR x:=1 TO W-2 DO | |
FOR color:=0 TO 2 DO | |
b[x*3+color,y] := SHORT(SHORT((a[x*3+color,y+1]+a[x*3+color,y-1]+a[(x-1)*3,y]+a[(x+1)*3,y]) DIV 4)); | |
END | |
END | |
END; | |
FOR y:=1 TO H-2 DO | |
FOR x:=1 TO W-2 DO | |
FOR color:=0 TO 2 DO | |
a[x*3+color,y] := SHORT(SHORT((b[x*3+color,y+1]+b[x*3+color,y-1]+b[(x-1)*3,y]+b[(x+1)*3,y]) DIV 4)); | |
END | |
END | |
END | |
END | |
END; | |
Out.Real((Kernel.Time() - time)/1000) | |
END Blur2DArray; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment