Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Point findImage(final int[] needle, final int width, final int height) {
- final int[] haystack = capture();
- final int l = OCR.width * OCR.height;
- final int m = width * height;
- int i, j, oX, oY;
- main:
- for(i = 0; i < l; i++) {
- oX = i % OCR.width;
- oY = i / OCR.width;
- for(j = 0; j < m; j++)
- if(needle[j] != haystack[(j / width + oY) * OCR.width + oX + j %width])
- continue main;
- return new Point(oX, oY);
- }
- return null;
- }
Add Comment
Please, Sign In to add comment