ConsoleUser
Copyright (c) 2010-2023 Skaion Corporarion, www.skaion.com
This project was developed in part by numerous sponsorships from the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints of Governmental purposes notwithstanding any copyright notation thereon.
All content reflects those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government or Skaion Corporation.
- class RangePatternMatcherImpl.RangePatternMatcherImpl(config)¶
I am the abstract parent of all Region matching strategies.
Parameters:
config: a <no title> instance
- match(haystack, needle, rect)¶
Look for matches of the needle within the haystack, optionally restricted to only those within the given rectangle.
Parameters:
haystack: an Region to search
needle: an Region to look for
rect: if specified as a 4 element list (or tuple) those are the coordinates of a rectangle to bound the search (upper left, upper right, lower left, lower right), otherwise it is ignored, if there are only 2 elements they are the upper left corner of the rectangle and the bounds of the rectangle are derived from the size of the needle
Return: a list of tuples which are the upper left coordinates that are the start of a match of the needle
- match_at(haystack, needle, corner)¶
Rather than searching the entire screen for a possible match, just look in one particular area and tell if that matches.
Parameters:
haystack: the Region to search in
needle: the Region to look for
corner: a tuple of the upper left corner (X,Y order, not Row,Col) to start the search
Return: True if the needle is found at that location, False otherwise