mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-04 19:58:37 +02:00
* Some nested loop improvements. fixes issue #40250
(cherry picked from commit 5da20fc860
)
This commit is contained in:
parent
62a326553e
commit
fd6c033b9d
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user