org.sikuli.api
Class ImageTarget

java.lang.Object
  extended by org.sikuli.api.DefaultTarget
      extended by org.sikuli.api.ImageTarget
All Implemented Interfaces:
Target
Direct Known Subclasses:
ColorImageTarget, StyledRectangleTarget

public class ImageTarget
extends DefaultTarget
implements Target

An ImageTarget object describes a target using an image.

Author:
Tom Yeh (tom.yeh@colorado.edu)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sikuli.api.Target
Target.Ordering
 
Constructor Summary
ImageTarget(BufferedImage targetImage)
          Creates an ImageTarget from a BufferedImage.
ImageTarget(File file)
          Creates an ImageTarget from a File object.
ImageTarget(URL url)
          Creates an ImageTarget from an image at a given URL.
 
Method Summary
 BufferedImage getImage()
          Returns the image describing this ImageTarget.
 URL getURL()
          Returns the URL of the image for this ImageTarget.
 BufferedImage toImage()
          Gets the image representation of this target for visualization purposes
 String toString()
          Returns a String object representing this ImageTarget object's value.
 
Methods inherited from class org.sikuli.api.DefaultTarget
doFindAll, getLimit, getMinScore, getOrdering, setLimit, setMinScore, setOrdering
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.sikuli.api.Target
doFindAll, getLimit, getMinScore, getOrdering, setLimit, setMinScore, setOrdering
 

Constructor Detail

ImageTarget

public ImageTarget(URL url)
Creates an ImageTarget from an image at a given URL.

Parameters:
url - the URL to load the image.
Throws:
IOException - thrown if the image can not be loaded

ImageTarget

public ImageTarget(File file)
Creates an ImageTarget from a File object.

Parameters:
file - the File to read image data from.
Throws:
IOException - thrown if the File can not be read.

ImageTarget

public ImageTarget(BufferedImage targetImage)
Creates an ImageTarget from a BufferedImage.

Parameters:
targetImage - the image representing this target.
Method Detail

getURL

public URL getURL()
Returns the URL of the image for this ImageTarget.

Returns:
the URL to load the image.

toString

public String toString()
Returns a String object representing this ImageTarget object's value.

Overrides:
toString in class Object
Returns:
a string representation of this ImageTarget.

getImage

public BufferedImage getImage()
Returns the image describing this ImageTarget.

Returns:
a BufferedImage representing this target.

toImage

public BufferedImage toImage()
Description copied from class: DefaultTarget
Gets the image representation of this target for visualization purposes

Overrides:
toImage in class DefaultTarget
Returns:
a BufferedImage object


Copyright © 2014. All rights reserved.