Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure MakeLUTs(Width, Height: Integer);
- var
- i, j: Integer;
- x, y: Integer;
- a, b: Integer;
- begin
- SetLength(OrderLUT, Width * Height);
- SetLength(TransLUT, Width, Height);
- x := 1;
- y := 1;
- j := 1;
- for i := 0 to Width * Height do
- begin
- OrderLUT[i].x := x;
- OrderLUT[i].y := y;
- Inc(x);
- Cec(y);
- if (y = 0) or (x > Width) then
- begin
- Inc(j);
- y := j;
- x := 1;
- if j > Height then
- begin
- y := Height
- x := j - Height;
- end;
- end;
- end;
- a := Width;
- b := 0;
- for y := 0 to Height do
- begin
- i := a;
- Dec(a);
- j := b;
- Inc(b);
- for x := 0 to Width do
- begin
- TransLUT[x, y].x := i;
- TransLUT[x, y].y := j;
- Inc(i);
- Inc(j);
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement