public abstract class EyesScreenshot extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
domUrl |
protected BufferedImage |
image |
protected Logger |
logger |
| Constructor and Description |
|---|
EyesScreenshot(Logger logger,
BufferedImage image) |
| Modifier and Type | Method and Description |
|---|---|
abstract Location |
convertLocation(Location location,
CoordinatesType from,
CoordinatesType to)
Converts a location's coordinates with the
from coordinates type
to the to coordinates type. |
Region |
convertRegionLocation(Region region,
CoordinatesType from,
CoordinatesType to)
Converts a region's location coordinates with the
from
coordinates type to the to coordinates type. |
String |
getDomUrl()
Gets dom url.
|
BufferedImage |
getImage() |
abstract Region |
getIntersectedRegion(Region region,
CoordinatesType coordinatesType)
Get the intersection of the given region with the screenshot.
|
abstract Location |
getLocationInScreenshot(Location location,
CoordinatesType coordinatesType)
Calculates the location in the screenshot of the location given as
parameter.
|
Location |
getOriginalLocation() |
abstract EyesScreenshot |
getSubScreenshot(Region region,
boolean throwIfClipped)
Returns a part of the screenshot based on the given region.
|
void |
setDomUrl(String domUrl)
Sets dom url.
|
void |
setOriginalLocation(Location originalLocation) |
protected final BufferedImage image
protected final Logger logger
protected String domUrl
public EyesScreenshot(Logger logger, BufferedImage image)
public BufferedImage getImage()
public String getDomUrl()
public void setDomUrl(String domUrl)
domUrl - the dom urlpublic abstract EyesScreenshot getSubScreenshot(Region region, boolean throwIfClipped)
region - The region for which we should get the sub screenshot.throwIfClipped - Throw an EyesException if the region is not
fully contained in the screenshot.public abstract Location convertLocation(Location location, CoordinatesType from, CoordinatesType to)
from coordinates type
to the to coordinates type.location - The location which coordinates needs to be converted.from - The current coordinates type for location.to - The target coordinates type for location.location to
the to coordinates type.public abstract Location getLocationInScreenshot(Location location, CoordinatesType coordinatesType) throws OutOfBoundsException
location - The location as coordinates inside the current frame.coordinatesType - The coordinates type of location.OutOfBoundsException - If the location is
not inside the frame's region in the screenshot.public abstract Region getIntersectedRegion(Region region, CoordinatesType coordinatesType)
region - The region to intersect.coordinatesType - The coordinates type of region.coordinatesType coordinates.public Region convertRegionLocation(Region region, CoordinatesType from, CoordinatesType to)
from
coordinates type to the to coordinates type.region - The region which location's coordinates needs to be converted.from - The current coordinates type for region.to - The target coordinates type for region.region to
the to coordinates type.public Location getOriginalLocation()
public void setOriginalLocation(Location originalLocation)
Copyright © 2023. All rights reserved.