change argument names

git-svn-id: trunk@12953 -
This commit is contained in:
paul 2007-11-21 09:31:55 +00:00
parent 6b823ed766
commit 980c6a4889
2 changed files with 14 additions and 13 deletions

View File

@ -251,7 +251,7 @@ type
procedure SetRawImage(const ARawImage: TRawImage; ADataOwner: Boolean = True); virtual;
procedure GetRawImage(out ARawImage: TRawImage); virtual;
procedure FillPixels(const Color: TFPColor); virtual;
procedure CopyPixels(ASource: TFPCustomImage; xoffs: Integer = 0; yoffs: Integer = 0); virtual;
procedure CopyPixels(ASource: TFPCustomImage; XDst: Integer = 0; YDst: Integer = 0); virtual;
procedure AlphaFromMask(AKeepAlpha: Boolean = True);
procedure GetXYDataPostion(x, y: integer; out Position: TRawImagePosition);
procedure GetXYMaskPostion(x, y: integer; out Position: TRawImagePosition);
@ -3082,7 +3082,7 @@ begin
// ToDo: mask
end;
procedure TLazIntfImage.CopyPixels(ASource: TFPCustomImage; xoffs: Integer = 0; yoffs: Integer = 0);
procedure TLazIntfImage.CopyPixels(ASource: TFPCustomImage; XDst: Integer = 0; YDst: Integer = 0);
var
SrcImg: TLazIntfImage absolute ASource;
x, y, xStop, yStop: Integer;
@ -3092,7 +3092,7 @@ begin
SetSize(Src.Width,Src.Height);
}
if (ASource is TLazIntfImage) and
FRawImage.Description.IsEqual(SrcImg.FRawImage.Description) and (xoffs = 0) and (yoffs = 0) then
FRawImage.Description.IsEqual(SrcImg.FRawImage.Description) and (XDst = 0) and (YDst = 0) then
begin
// same description -> copy
if FRawImage.Data <> nil then
@ -3104,21 +3104,21 @@ begin
// copy pixels
xStop := ASource.Width;
if Width - xoffs < xStop
then xStop := Width - xoffs;
if Width - XDst < xStop
then xStop := Width - XDst;
yStop := ASource.Height;
if Height - yoffs < yStop
then yStop := Height - yoffs;
if Height - YDst < yStop
then yStop := Height - YDst;
Dec(xStop);
Dec(yStop);
for y:=0 to yStop do
for x:=0 to xStop do
Colors[x+xoffs,y+yoffs] := ASource.Colors[x,y];
Colors[x+XDst,y+YDst] := ASource.Colors[x,y];
if ASource is TLazIntfImage then
for y:=0 to yStop do
for x:=0 to xStop do
Masked[x+xoffs,y+yoffs] := SrcImg.Masked[x,y];
Masked[x+XDst,y+YDst] := SrcImg.Masked[x,y];
end;

View File

@ -43,7 +43,7 @@ var
SrcImg, DstImg: TLazIntfImage;
SrcHasAlpha, KeepAlpha: Boolean;
l, r: integer;
ALeft, ATop: integer;
begin
SrcHasAlpha := SrcImage.Description.AlphaPrec > 0;
KeepAlpha := SrcHasAlpha;
@ -89,9 +89,9 @@ begin
end;
DstImg := TLazIntfImage.Create(RawImage, False);
l := (RawImage.Description.Width - SrcImage.Description.Width) div 2;
r := (RawImage.Description.Height - SrcImage.Description.Height) div 2;
DstImg.CopyPixels(SrcImg, l, r);
ALeft := (RawImage.Description.Width - SrcImage.Description.Width) div 2;
ATop := (RawImage.Description.Height - SrcImage.Description.Height) div 2;
DstImg.CopyPixels(SrcImg, ALeft, ATop);
if not SrcHasAlpha
then begin
DstImg.AlphaFromMask;
@ -124,6 +124,7 @@ begin
InternalSetImage(RawImg, SrcImage);
// force output png with colorformat = 4
// to do this we need halftone alpha
if PRGBAQuad(RawImg.Data)[0].Alpha = 0 then
PRGBAQuad(RawImg.Data)[0].Alpha := $01
else