function ImgMirror(MInput:Matriks;keadaan:Char):Matriks;
var
i,j:Integer;
a,b,MOutput:Matriks;
begin
a:=Flipping(MInput,'V');
b:=Flipping(MInput,'H');
case keadaan of
'V': begin
SetLength(MOutput,length(MInput)*2,length(MInput[0]));
for i:=0 to (length(MOutput)-1) div 2 do
for j:=0 to (length(MOutput[0])-1) do
begin
MOutput[i,j]:=MInput[i,j];
MOutput[i+(Length(MOutput)-1) div 2,j]:=a[i,j];
end;
end;
'H': begin
SetLength(MOutput,length(MInput),length(MInput[0])*2);
for i:=0 to length(MOutput)-1 do
for j:=0 to (length(MOutput[0])-1) div 2 do
begin
MOutput[i,j]:=MInput[i,j];
MOutput[i,j+(Length(MOutput[0])-1) div 2]:=b[i,j];
end;
end;
end;
ImgMirror:=MOutput;
end;
No comments:
Post a Comment