Guest User

Untitled

a guest
Apr 25th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public static Point findImage(final int[] needle, final int width, final int height) {
  2. final int[] haystack = capture();
  3. final int l = OCR.width * OCR.height;
  4. final int m = width * height;
  5. int i, j, oX, oY;
  6. main:
  7. for(i = 0; i < l; i++) {
  8. oX = i % OCR.width;
  9. oY = i / OCR.width;
  10. for(j = 0; j < m; j++)
  11. if(needle[j] != haystack[(j / width + oY) * OCR.width + oX + j %width])
  12. continue main;
  13. return new Point(oX, oY);
  14. }
  15. return null;
  16. }
Add Comment
Please, Sign In to add comment