Advertisement
mixster

mixster

Dec 27th, 2008
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. function TreeAC: Integer;
  2. var
  3. TPA: TPointArray;
  4. allCol, uniCol, colTal: TIntegerArray;
  5. CTS, i, ii, H1, H2, t: Integer;
  6. begin
  7. CTS := GetColorToleranceSpeed;
  8. ColorToleranceSpeed(2);
  9. FindColorsSpiralTolerance(MMCX, MMCY, TPA, 2249277, MMX1, MMY1, MMX2, MMY2, 45);
  10. allCol := GetColors(TPA);
  11. uniCol := allCol;
  12. ClearSameIntegers(allCol);
  13. H1 := High(allCol);
  14. H2 := High(uniCol);
  15. SetLength(colTal, H2 + 1);
  16. for i := 0 to H1 do
  17. begin
  18. for ii := 0 to H2 do
  19. begin
  20. if allCol[i] = uniCol[ii] then
  21. Inc(colTal[ii]);
  22. end;
  23. end;
  24. t := 0;
  25. for i := 0 to H2 do
  26. if colTal[i] > colTal[t] then
  27. t := i;
  28. Result := uniCol[t];
  29. ColorToleranceSpeed(CTS);
  30. end;
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement