* Some nested loop improvements. fixes issue #40250

(cherry picked from commit 5da20fc860)
This commit is contained in:
Michaël Van Canneyt 2023-04-25 08:36:24 +02:00 committed by marcoonthegit
parent 62a326553e
commit fd6c033b9d
4 changed files with 13 additions and 11 deletions

View File

@ -38,8 +38,8 @@ begin
if (Img.Palette <> self) then
begin
Count := 0;
for x := 0 to img.width-1 do
for y := 0 to img.height-1 do
for y := 0 to img.height-1 do
for x := 0 to img.width-1 do
IndexOf(img[x,y]);
end;
end;

View File

@ -3154,8 +3154,8 @@ begin
if not Result then
Exit;
for x := 0 to Image.Width-1 do
for y := 0 to Image.Height-1 do
for y := 0 to Image.Height-1 do
for x := 0 to Image.Width-1 do
if Image.Colors[x, y] <> AImage.Colors[x, y] then
begin
Result := False;

View File

@ -9967,8 +9967,8 @@ var
x, y: Integer;
begin
Result := True;
for x := 0 to Image.Width-1 do
for y := 0 to Image.Height-1 do
for y := 0 to Image.Height-1 do
for x := 0 to Image.Width-1 do
if Image.Pixels[x, y] <> AImage.Pixels[x, y] then
begin
Result := False;

View File

@ -172,19 +172,21 @@ type
procedure TFPImageFriend.ReversePixelColorOrder;
var
x, y: UInt32;
p, x, y: UInt32;
v: TFPCompactImgRGBA8BitValue;
n: TFPCompactImgRGBA8BitValue;
begin
for x := 0 to Width-1 do
for y := 0 to Height-1 do
for y := 0 to Height-1 do
for x := 0 to Width-1 do
begin
v := FData[x+y*Width];
p:=x+y*Width;
v := FData[p];
n.b := v.r;
n.g := v.g;
n.r := v.b;
n.a := v.a;
FData[x+y*Width] := n;
FData[p] := n;
end;
end;