Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VisionAdapter

VisionAdapter serves as an abstraction layer for all image based interactions.

This allows to provide a high level interface for image based actions, without having to spread (possibly) multiple dependencies all over the code. All actions which involve screenshots / images are bundled in this adapter.

Hierarchy

  • VisionAdapter

Index

Constructors

constructor

Methods

findOnScreenRegion

  • findOnScreenRegion will search for a given pattern inside a Region of the main screen If multiple possible occurrences are found, the one with the highest probability is returned. For matchProbability < 0.99 the search will be performed on grayscale images.

    Parameters

    Returns Promise<MatchResult>

    containing location and probability of a possible match

grabScreen

  • grabScreen(): Promise<Image>

grabScreenRegion

saveImage

  • saveImage(image: Image, path: string): Promise<void>

screenHeight

  • screenHeight(): Promise<number>
  • screenHeight returns the main screens height as reported by the OS. Please notice that on e.g. Apples Retina display the reported width and the actual pixel size may differ

    Returns Promise<number>

    The main screens height as reported by the OS

screenSize

  • screenSize(): Promise<Region>

screenWidth

  • screenWidth(): Promise<number>
  • screenWidth returns the main screens width as reported by the OS. Please notice that on e.g. Apples Retina display the reported width and the actual pixel size may differ

    Returns Promise<number>

    The main screens width as reported by the OS