Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TMufasaBitmap.PixelEdgesTPA(MinDiff: Integer): TPointArray;
- var
- x,y,wid,hei,h: Int32;
- hit: Boolean;
- begin
- wid := Self.GetWidth() - 1;
- hei := Self.GetHeight() - 1;
- SetLength(Result, 1000);
- h := 0;
- for y:=0 to hei do
- for x:=0 to wid do
- begin
- hit := False;
- if (X+1 < wid) then
- if not SimilarColors(Self.GetPixel(x,y), Self.GetPixel(x+1,y), MinDiff) then
- hit := True;
- if (not hit) and (Y+1 < hei) then
- if not SimilarColors(Self.GetPixel(x,y), Self.GetPixel(x,y+1), MinDiff) then
- hit := True;
- if hit then
- begin
- if h >= Length(Result) then
- SetLength(Result, Length(Result)*2);
- Result[h].x := x;
- Result[h].y := y;
- Inc(h);
- end;
- end;
- SetLength(Result, h);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement