Function Polkadot(MInput:Matriks;l:integer):Matriks;
var
i,j,m,n,r,c,d:integer ;
MOutput : Matriks ;
begin
d:=1;c:=1;
SetLength(MOutput,Length(MInput),Length(MInput[0]));
MOutput := chess(ImageNegativeL(MInput),l);
m := round(Length(MInput)/l);
n := round(Length(MInput[0])/l);
if m>=n then r:=n div 2 else r:=m div 2;
for i:=0 to Length(MOutput)-1 do
begin
for j:=0 to Length(MOutput[0])-1 do
begin
if ((i div m) mod 2 >= 0) and ((j div n) mod 2 >= 0) then
if ((sqr((i-(r*(c-1)))-r)+sqr((j-(r*(d-1)))-r))<=r*r) and (i>=m*(c-1)) and (j>=n*(d-1)) then
MOutput[i,j]:= 255-MInput[i,j]
else
MOutput[i,j]:= MInput[i,j];
//if j=n-1 then d:=d+2;
end;
//if i=m-1 then c:=c+2;
end;
Polkadot:=MOutput;
end;
No comments:
Post a Comment