Package org.sikuli.script
Class ScreenImage
- java.lang.Object
-
- org.sikuli.script.Element
-
- org.sikuli.script.Image
-
- org.sikuli.script.ScreenImage
-
public class ScreenImage extends Image
stores a BufferedImage usually ceated by screen capture, the screen rectangle it was taken from and the filename, where it is stored as PNG (only if requested)
-
-
Constructor Summary
Constructors Constructor Description ScreenImage(java.awt.Rectangle roi, java.awt.image.BufferedImage img)
create ScreenImage with givenScreenImage(java.io.File shotFile)
create ScreenImage from given
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
java.awt.image.BufferedImage
getBufferedImage()
org.opencv.core.Mat
getContent()
Location
getEnd()
java.lang.String
getFile(java.lang.String path)
stores the image as PNG file in the given path with a created filename (sikuliximage-timestamp.png)java.lang.String
getFile(java.lang.String path, java.lang.String name)
stores the image as PNG file in the given path with the given filenamejava.lang.String
getFilename()
Deprecated.use save() insteadRegion
getRegion()
java.awt.Rectangle
getROI()
Location
getStart()
java.lang.String
getStoredAt()
ScreenImage
getSub(java.awt.Rectangle sub)
org.opencv.core.Mat
makeMat()
java.lang.String
save()
stores the image as PNG file in the standard temp folder with a created filename (sikuliximage-timestamp.png) if not yet stored beforejava.lang.String
save(java.lang.String name)
java.lang.String
saveInto(java.io.File path)
java.lang.String
saveInto(java.lang.String path)
stores the image as PNG file in the given path with a created filename (sikuliximage-timestamp.png)void
saveLastScreenImage(java.io.File fPath)
void
setStartEnd(Location start, Location end)
-
Methods inherited from class org.sikuli.script.Image
create, create, create, create, createSubimage, getDefaultInstance4py, getIDEshouldReload, getLastSeen, getLastSeenScore, getMask, getNameAsText, getSub, getSub, getSub, getURL, hasMask, isAbsolute, isBundled, isFile, isMasked, isRecaptured, mask, masked, offset, offset, offset, setFileURL, setIDEshouldReload, setIsAbsolute, setLastSeen, similarity, similarity, waitAfter, waitAfter
-
Methods inherited from class org.sikuli.script.Element
asFakeImage, asMaskImage, asText, black, black, cacheStats, click, click, click, cloneContent, collectLines, collectLinesText, collectWords, collectWordsText, createURL, createURL, delayClick, diffPercentage, exists, exists, existsT, existsText, file, fileName, find, findAll, findAllByColumn, findAllByRow, findAllT, findAllText, findAny, findAnyList, findBest, findBestList, findChanges, findLine, findLines, findLines, findT, findText, findWord, findWords, findWords, getAll, getAutoWaitTimeout, getBufferedImage, getCache, getCenter, getFindFailedHandler, getFindFailedResponse, getH, getImage, getImage, getLastMatch, getLastMatches, getMatchLastSeen, getName, getObserveScanRate, getOtherScreen, getPoint, getRect, getRepeatWaitTime, getScreen, getSize, getTarget, getThrowException, getValidImageFilename, getW, getWaitScanRate, getX, getY, has, has, hasT, hasText, hasURL, hover, hover, ignoreLastSeen, initScreen, intersection, isFakeImage, isInside, isMaskImage, isOtherScreen, isText, isValid, isVirtual, match, match, matches, matches, mean, meanColor, mouseDown, mouseMove, mouseMove, mouseMove, mouseUp, mouseUp, plain, plain, reload, reload, reLocate, resetCache, resetFindFailedResponse, resetThrowException, resize, resize, sameSize, save, save, set, set, setAutoWaitTimeout, setCenter, setContent, setFindFailedHandler, setFindFailedResponse, setH, setLocation, setMissingAbort, setMissingPrompt, setName, setObserveScanRate, setOtherScreen, setRect, setRect, setRect, setRepeatWaitTime, setScreen, setThrowException, setVirtual, setW, setWaitScanRate, setX, setX, setY, setY, size, size, stdDev, text, textChar, textLine, textLines, textWord, textWords, toString, traceOff, traceOn, union, unionAll, unionAny, unionAnyList, updateContent, url, url, url, virtual, wait, wait, wait, waitVanish, waitVanish, white
-
-
-
-
Constructor Detail
-
ScreenImage
public ScreenImage(java.awt.Rectangle roi, java.awt.image.BufferedImage img)
create ScreenImage with given- Parameters:
roi
- the rectangle it was taken fromimg
- the BufferedImage
-
ScreenImage
public ScreenImage(java.io.File shotFile)
create ScreenImage from given- Parameters:
shotFile
- previously saved screenshot
-
-
Method Detail
-
getContent
public org.opencv.core.Mat getContent()
- Overrides:
getContent
in classorg.sikuli.script.Element
-
getStart
public Location getStart()
-
getEnd
public Location getEnd()
-
getBufferedImage
public java.awt.image.BufferedImage getBufferedImage()
- Overrides:
getBufferedImage
in classorg.sikuli.script.Element
- Returns:
- the stored image in memory
-
makeMat
public org.opencv.core.Mat makeMat()
-
getRegion
public Region getRegion()
- Returns:
- the Region, the iamge was created from
-
getROI
public java.awt.Rectangle getROI()
- Returns:
- the screen rectangle, the iamge was created from
-
getSub
public ScreenImage getSub(java.awt.Rectangle sub)
-
saveInto
public java.lang.String saveInto(java.lang.String path)
stores the image as PNG file in the given path with a created filename (sikuliximage-timestamp.png)- Parameters:
path
- valid path string- Returns:
- absolute path to stored file
-
saveInto
public java.lang.String saveInto(java.io.File path)
-
save
public java.lang.String save(java.lang.String name)
- Overrides:
save
in classorg.sikuli.script.Element
-
getFile
public java.lang.String getFile(java.lang.String path, java.lang.String name)
stores the image as PNG file in the given path with the given filename- Parameters:
path
- valid path stringname
- filename (.png is added if not present)- Returns:
- absolute path to stored file
-
getFilename
@Deprecated public java.lang.String getFilename()
Deprecated.use save() insteadcreates the PNG tempfile only when needed.- Overrides:
getFilename
in classImage
- Returns:
- absolute path to stored tempfile
-
getStoredAt
public java.lang.String getStoredAt()
-
save
public java.lang.String save()
stores the image as PNG file in the standard temp folder with a created filename (sikuliximage-timestamp.png) if not yet stored before- Returns:
- absolute path to stored file
-
getFile
public java.lang.String getFile(java.lang.String path)
stores the image as PNG file in the given path with a created filename (sikuliximage-timestamp.png)- Parameters:
path
- valid path string- Returns:
- absolute path to stored file
-
saveLastScreenImage
public void saveLastScreenImage(java.io.File fPath)
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-