Advertisement
WarPie90

MatrixOp: TPAReduce1

Nov 4th, 2015
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.42 KB | None | 0 0
  1. function TPAReduce1(TPA:TPointArray): TPointArray;
  2. var
  3.   b:TBox;
  4.   mat:TByteMatrix;
  5.   edges:TPointArray;
  6. begin
  7.   B := GetTPABounds(TPA);
  8.   OffsetTPA(TPA, Point(-B.x1, -B.y1));
  9.   SetLength(Mat, B.height(),B.width());
  10.   se.SetData(mat, TPA, TByteArray([1]));
  11.   edges := se.TPAEdges(TPA);
  12.   se.SetData(mat, edges, TByteArray([0]));
  13.   Result := se.Indices(mat, 1, CMP_EQ);
  14.   OffsetTPA(Result, Point(B.x1, B.y1));
  15. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement