CachedRegion

Cached region, this variant of region will capture the region on creation and cache it, capture will always return this cached image. Sub-regions created from this region will also use this cached image for their operations

Constructors

Link copied to clipboard
fun <T : IDevice<T, R>, R : Region<T, R>> CachedRegion(region: Region<T, R>)

Functions

Link copied to clipboard
open fun add(p0: Point2D)
open fun add(p0: Rectangle2D)
open fun add(p0: Point)
open fun add(p0: Rectangle)
open fun add(p0: Double, p1: Double)
open fun add(p0: Int, p1: Int)
Link copied to clipboard
Link copied to clipboard
open override fun capture(): BufferedImage

Captures the image of the region

Link copied to clipboard
open override fun click(random: Boolean)

Clicks this region For more complex operations please use the devices respective IInput

Link copied to clipboard
suspend fun clickTemplateWhile(template: ITemplate, random: Boolean = true, period: Millis = 100, timeout: Millis = -1, condition: Region<CachedDevice<T, R>, CachedRegion<T, R>>.(ITemplate) -> Boolean)

Clicks the template if it exists, while a condition holds true For more complex operations please use the devices respective IInput

Link copied to clipboard
suspend fun clickWhile(random: Boolean = true, period: Millis = 100, timeout: Millis = -1, condition: Region<CachedDevice<T, R>, CachedRegion<T, R>>.() -> Boolean)

Clicks this region, while a condition holds true For more complex operations please use the devices respective IInput

Link copied to clipboard
override fun clone(): Any
Link copied to clipboard
open operator override fun compareTo(other: Region<CachedDevice<T, R>, CachedRegion<T, R>>): Int

General compare function

Link copied to clipboard
open operator override fun contains(p0: Point2D): Boolean
open operator override fun contains(p0: Rectangle2D): Boolean
open operator fun contains(p0: Point): Boolean
open operator fun contains(p0: Rectangle): Boolean
open override fun contains(p0: Double, p1: Double): Boolean
open fun contains(p0: Int, p1: Int): Boolean
open override fun contains(p0: Double, p1: Double, p2: Double, p3: Double): Boolean
open fun contains(p0: Int, p1: Int, p2: Int, p3: Int): Boolean
Link copied to clipboard
open override fun copy(x: Pixels, y: Pixels, width: Pixels, height: Pixels, device: CachedDevice<T, R>, screen: Int): CachedRegion<T, R>

Copy constructor, the new cached region will be the snapshot at the time of copy

Link copied to clipboard
Link copied to clipboard
open override fun createUnion(p0: Rectangle2D): Rectangle2D
Link copied to clipboard
fun doesntHave(template: ITemplate): Boolean

Checks if template doesn't exist on screen, useful if you don't need the result of the find operation. Inverse of has

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Finds the best match for the given template in the current region

Finds the best <count> matches for the given template in the current region

Link copied to clipboard
open override fun getBounds(): Rectangle
Link copied to clipboard
open override fun getBounds2D(): Rectangle2D
Link copied to clipboard
open fun getCenterX(): Double
Link copied to clipboard
open fun getCenterY(): Double
Link copied to clipboard
open fun getFrame(): Rectangle2D
Link copied to clipboard
open override fun getHeight(): Double
Link copied to clipboard

Gets the last capture of this region

Link copied to clipboard

Gets the last screen capture of the region

Link copied to clipboard
open fun getLocation(): Point
Link copied to clipboard
open fun getMaxX(): Double
Link copied to clipboard
open fun getMaxY(): Double
Link copied to clipboard
open fun getMinX(): Double
Link copied to clipboard
open fun getMinY(): Double
Link copied to clipboard
Link copied to clipboard
open fun getSize(): Dimension
Link copied to clipboard
open override fun getWidth(): Double
Link copied to clipboard
open override fun getX(): Double
Link copied to clipboard
open override fun getY(): Double
Link copied to clipboard
open fun grow(p0: Int, p1: Int)
Link copied to clipboard
fun has(template: ITemplate): Boolean

Checks if template exists on screen, useful if you don't need the result of the find operation. Inverse of doesntHave

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open fun inside(p0: Int, p1: Int): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun intersects(p0: Rectangle2D): Boolean
open override fun intersects(p0: Double, p1: Double, p2: Double, p3: Double): Boolean
Link copied to clipboard
open fun intersectsLine(p0: Double, p1: Double, p2: Double, p3: Double): Boolean
Link copied to clipboard

Checks if this region is the device screen or a copy of it

Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard

Maps a rectangle on to this region

Link copied to clipboard
open fun move(p0: Int, p1: Int)
Link copied to clipboard
open fun outcode(p0: Point2D): Int
open override fun outcode(p0: Double, p1: Double): Int
Link copied to clipboard
Link copied to clipboard
open fun reshape(p0: Int, p1: Int, p2: Int, p3: Int)
Link copied to clipboard
open fun resize(p0: Int, p1: Int)
Link copied to clipboard
open fun setBounds(p0: Rectangle)
open fun setBounds(p0: Int, p1: Int, p2: Int, p3: Int)
Link copied to clipboard
open fun setFrame(p0: Rectangle2D)
open fun setFrame(p0: Point2D, p1: Dimension2D)
open override fun setFrame(p0: Double, p1: Double, p2: Double, p3: Double)
Link copied to clipboard
open fun setFrameFromCenter(p0: Double, p1: Double, p2: Double, p3: Double)
Link copied to clipboard
open fun setFrameFromDiagonal(p0: Double, p1: Double, p2: Double, p3: Double)
Link copied to clipboard
open fun setLocation(p0: Point)
open fun setLocation(p0: Int, p1: Int)
Link copied to clipboard
open fun setRect(p0: Rectangle2D)
open override fun setRect(p0: Double, p1: Double, p2: Double, p3: Double)
Link copied to clipboard
open fun setSize(p0: Dimension)
open fun setSize(p0: Int, p1: Int)
Link copied to clipboard
fun subRegion(x: Pixels, y: Pixels, width: Pixels, height: Pixels): CachedRegion<T, R>

Gets a smaller region that is contained in this region.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open fun translate(p0: Int, p1: Int)
Link copied to clipboard
open override fun type(text: String)

Type text in this region For more complex operations please use the devices respective IInput

Link copied to clipboard
open fun union(p0: Rectangle): Rectangle
Link copied to clipboard
suspend fun waitDoesntHave(template: ITemplate, timeout: Millis = -1)

Waits until the given template vanishes off-screen. This is the suspending version, use waitDoesntHaveBlocking if blocking operation is needed. Inverse of waitHas

Link copied to clipboard
fun waitDoesntHaveBlocking(template: ITemplate, timeout: Millis = -1)
Link copied to clipboard
suspend fun waitHas(template: ITemplate, timeout: Millis = -1): CachedRegion<T, R>?

Waits until the given template shows up on screen. This is the suspending version, use waitHasBlocking if blocking operation is needed. Inverse of waitDoesntHave

Link copied to clipboard
fun waitHasBlocking(template: ITemplate, timeout: Millis = -1): CachedRegion<T, R>?

Properties

Link copied to clipboard

Device that the region belongs to

Link copied to clipboard
var height: Int
Link copied to clipboard

Template matcher that will be used for find operations, can be overridden with custom matcher, otherwise Region.DEFAULT_MATCHER will be used

Link copied to clipboard
val region: Region<T, R>
Link copied to clipboard
val screen: Int

Screen index

Link copied to clipboard
var width: Int
Link copied to clipboard
var x: Int
Link copied to clipboard
var y: Int

Extensions

Link copied to clipboard

Area of the rectangle

Link copied to clipboard

Crops and returns a new rect that fits in the other rect

Link copied to clipboard

Convenience value, equivalent to Rectangle.x

Link copied to clipboard

Convenience value, equivalent to Rectangle.x + Rectangle.width

Link copied to clipboard

Convenience value, equivalent to Rectangle.y

Link copied to clipboard

Convenience value, equivalent to Rectangle.y + Rectangle.height