type
TTPAObject = class(TObject)
protected
ptArr: TList; // allows for it to be a 2D Array or a 1D;; public?
intA: TIntegerArray; // for color stuff
private
public
procedure RAaSTPAEx(const w, h: Integer);
procedure RAaSTPA(const Dist: Integer);
function NearbyPointInArrayEx(const P: TPoint; w, h:Integer): Boolean;
function NearbyPointInArray(const P: TPoint; Dist:Integer): Boolean;
procedure ReArrangeandShortenArrayEx(w, h: Integer): TPointArray;// set internal
procedure ReArrangeandShortenArray(Dist: Integer): TPointArray; // set internal
procedure TPAtoATPAEx(w, h: Integer); // set internal
procedure TPAtoATPA(Dist: Integer); // set internal
{ procedure QuickTPASort(var A: TIntegerArray; var B: TPointArray; iLo, iHi: Integer; SortUp: Boolean);
procedure QuickATPASort(var A: TIntegerArray; var B: T2DPointArray; iLo, iHi: Integer; SortUp: Boolean); }
procedure SortTPAFrom(const From: TPoint); // set internal
procedure SortATPAFrom(const From: TPoint); // set internal
procedure SortATPAFromFirstPoint(const From: TPoint); // set internal
procedure InvertTPA; // set internal
procedure InvertATPA; // set internal
function MiddleTPAEx(out x, y: Integer): Boolean; // set internal
procedure MiddleTPA: TPoint;
procedure SortATPASize(const BigFirst: Boolean); // set internal
procedure SortATPAFromSize(const Size: Integer; CloseFirst: Boolean); // set internal
//function CombineTPA(Ar1, Ar2: TPointArray): TPointArray;
procedure AddTPA(addArr: TPointArray); // set internal, perhaps use another TTPAObject
{procedure ClearSameIntegers(var a: TIntegerArray); }
//and now im too lazy to change more for no reason :D
procedure ClearSameIntegersAndTPA(var a: TIntegerArray; var p: TPointArray);
function SplitTPAEx(arr: TPointArray; w, h: Integer): T2DPointArray;
function SplitTPA(arr: TPointArray; Dist: Integer): T2DPointArray;
procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer);
function RemoveDistTPointArray(x, y, dist: Integer; ThePoints: TPointArray; RemoveHigher: Boolean): TPointArray;
function GetATPABounds(ATPA: T2DPointArray): TBox;
function GetTPABounds(TPA: TPointArray): TBox;
function FindTPAinTPA(SearchTPA, TotalTPA: TPointArray; var Matches: TPointArray): Boolean;
function FindTextTPAinTPA(Height : integer; SearchTPA, TotalTPA: TPointArray; var Matches: TPointArray): Boolean;
function FindGapsTPA(TPA: TPointArray; MinPixels: Integer): T2DPointArray;
procedure SortCircleWise(var tpa: TPointArray; const cx, cy, StartDegree: Integer; SortUp, ClockWise: Boolean);
procedure LinearSort(var tpa: TPointArray; cx, cy, sd: Integer; SortUp: Boolean);
Function MergeATPA(ATPA : T2DPointArray) : TPointArray;
function TPAFromBox(const Box : TBox) : TPointArray;
Function RotatePoints(Const P: TPointArray; A, cx, cy: Extended): TPointArray ;
Function RotatePoint(Const p: TPoint; angle, mx, my: Extended): TPoint; inline;
function FindTPAEdges(p: TPointArray): TPointArray;
function PointInTPA(p: TPoint; arP: TPointArray): Boolean;
function ClearTPAFromTPA(arP, ClearPoints: TPointArray): TPointArray;
procedure ClearDoubleTPA(var TPA: TPointArray);
Function ReturnPointsNotInTPA(Const TotalTPA: TPointArray; const Box: TBox): TPointArray;
Procedure TPACountSort(Var TPA: TPointArray;const max: TPoint;Const SortOnX : Boolean);
Procedure TPACountSortBase(Var TPA: TPointArray;const maxx, base: TPoint; const SortOnX : Boolean);
// these could be avoided by making the TList public.
function get(ind: Integer): Pointer; // may not be necessary..
procedure Put(ind: Integer; p: Pointer); // ^
property Items[Index: Integer]: Pointer read Get write Put; default; // will this allow for Items[x][y]?
end;
Purely for concept, all I did was toss it all in a class..