不知道FASTBMP中的高斯模糊用的是什么方法?请卷起千堆雪tyn说说看,贴一下它的原码:
procedure GaussianBlur(Bmp:TFastRGB;Amount:Integer);
var
i: Integer;
begin
for i:=Amount downto 1 do
SplitBlur(Bmp,i);
end;
function TrimInt(i,Min,Max:Integer):Integer;
begin
if i>Max then Result:=Max
else if i<Min then Result:=Min
else Result:=i;
end;
procedure SplitBlur(Bmp:TFastRGB;Amount:Integer);
var
Lin1,
Lin2: PLine;
pc: PFColor;
cx,x,y: Integer;
Buf: array[0..3]of TFColor;
begin
pc:=Bmp.Bits;
for y:=0 to Bmp.Height-1 do
begin
Lin1:=Bmp.Pixels[TrimInt(y+Amount,0,Bmp.Height-1)];
Lin2:=Bmp.Pixels[TrimInt(y-Amount,0,Bmp.Height-1)];
for x:=0 to Bmp.Width-1 do
begin
cx:=TrimInt(x+Amount,0,Bmp.Width-1);
Buf[0]:=Lin1[cx];
Buf[1]:=Lin2[cx];
cx:=TrimInt(x-Amount,0,Bmp.Width-1);
Buf[2]:=Lin1[cx];
Buf[3]:=Lin2[cx];
pc.b:=(Buf[0].b+Buf[1].b+Buf[2].b+Buf[3].b)shr 2; //我想就是这里了,能说说位操作在图象计算中的运用
pc.g:=(Buf[0].g+Buf[1].g+Buf[2].g+Buf[3].g)shr 2;
pc.r:=(Buf[0].r+Buf[1].r+Buf[2].r+Buf[3].r)shr 2;
Inc(pc);
end;
pc:=Ptr(Integer(pc)+Bmp.Gap);
end;
end;