| Modifier and Type | Field and Description |
|---|---|
static Region |
EMPTY
The constant EMPTY.
|
| Constructor and Description |
|---|
Region(int left,
int top,
int width,
int height)
Instantiates a new Region.
|
Region(int left,
int top,
int width,
int height,
CoordinatesType coordinatesType)
Instantiates a new Region.
|
Region(IRegion other)
Instantiates a new Region.
|
Region(Location location,
RectangleSize size)
Instantiates a new Region.
|
Region(Location location,
RectangleSize size,
CoordinatesType coordinatesType)
Instantiates a new Region.
|
Region(Rectangle rectangle) |
| Modifier and Type | Method and Description |
|---|---|
Region |
addPadding(Padding padding) |
boolean |
contains(Location location)
Check if a specified location is contained within this region.
|
boolean |
contains(Region other)
Check if a region is contained within the current region.
|
boolean |
equals(Object obj) |
Region |
expandToContain(Region region)
Expand to contain region.
|
int |
getArea() |
int |
getBottom() |
CoordinatesType |
getCoordinatesType()
Gets coordinates type.
|
int |
getHeight()
Gets height.
|
Region |
getIntersected(Region other) |
int |
getLeft()
Gets left.
|
Location |
getLocation()
Gets location.
|
Location |
getMiddleOffset()
Gets middle offset.
|
Location |
getNegativeLocation()
Gets negative location.
|
String |
getRegionId() |
int |
getRight() |
RectangleSize |
getSize()
Gets size.
|
Iterable<Region> |
getSubRegions(RectangleSize subRegionSize)
Gets sub regions.
|
Iterable<Region> |
getSubRegions(RectangleSize subRegionSize,
boolean isFixedSize)
Returns a list of sub-regions which compose the current region.
|
SubregionForStitching[] |
getSubRegions(RectangleSize maxSubRegionSize,
int logicalOverlap,
double l2pScaleRatio,
Rectangle physicalRectInScreenshot,
Logger logger) |
int |
getTop()
Gets top.
|
int |
getWidth()
Gets width.
|
int |
hashCode() |
void |
intersect(Region other)
Replaces this region with the intersection of itself and
other |
boolean |
isEmpty()
Is empty boolean.
|
boolean |
isIntersected(Region other)
Check if a region is intersected with the current region.
|
boolean |
isSizeEmpty()
Is size empty boolean.
|
protected void |
makeEmpty()
Make empty.
|
Region |
offset(int dx,
int dy)
Get an offset region.
|
Region |
offset(Location location)
Get an offset region.
|
Region |
regionId(String regionId) |
Region |
scale(double scaleRatio)
Get a region which is a scaled version of the current region.
|
void |
setCoordinatesType(CoordinatesType value)
Sets coordinates type.
|
void |
setHeight(int value)
Sets height.
|
void |
setLeft(int value)
Sets left.
|
void |
setLocation(Location location)
Set the (top,left) position of the current region
|
void |
setSize(RectangleSize size)
Sets size.
|
void |
setTop(int value)
Sets top.
|
void |
setWidth(int value)
Sets width.
|
void |
setX(int x) |
void |
setY(int y) |
String |
toString() |
public static final Region EMPTY
public Region(int left,
int top,
int width,
int height)
left - the lefttop - the topwidth - the widthheight - the heightpublic Region(int left,
int top,
int width,
int height,
CoordinatesType coordinatesType)
left - the lefttop - the topwidth - the widthheight - the heightcoordinatesType - the coordinates typepublic Region(Rectangle rectangle)
public Region(Location location, RectangleSize size)
location - the locationsize - the sizepublic Region(Location location, RectangleSize size, CoordinatesType coordinatesType)
location - the locationsize - the sizecoordinatesType - the coordinates typepublic Region(IRegion other)
other - the otherprotected void makeEmpty()
public boolean isEmpty()
public boolean isSizeEmpty()
public Location getLocation()
getLocation in interface IRegionpublic Location getNegativeLocation()
public Region offset(int dx, int dy)
public Region offset(Location location)
location - the amount by which to offset.public Region scale(double scaleRatio)
scaleRatio - The ratio by which to scale the region.public RectangleSize getSize()
public CoordinatesType getCoordinatesType()
getCoordinatesType in interface IRegionpublic void setCoordinatesType(CoordinatesType value)
value - the valuepublic void setSize(RectangleSize size)
size - The updated size of the region.public void setLocation(Location location)
location - The (top,left) position to set.public Iterable<Region> getSubRegions(RectangleSize subRegionSize, boolean isFixedSize)
subRegionSize - The default sub-region size to use.isFixedSize - If false, then sub-regions might have a size which is smaller then subRegionSize (thus there will be no overlap of regions). Otherwise, all sub-regions will have the same size, but sub-regions might overlap.subRegionSize is equal or greater than the current region, only a single region is returned.public Iterable<Region> getSubRegions(RectangleSize subRegionSize)
subRegionSize - the sub region size#getSubRegions(RectangleSize, boolean). {@code isFixedSize} defaults to {@code false}.public boolean contains(Region other)
other - The region to check if it is contained within the current region.other is contained within the current region, false otherwise.public boolean contains(Location location)
location - The location to test.public boolean isIntersected(Region other)
other - The region to check intersection with.public void intersect(Region other)
otherother - The region with which to intersect.public int getLeft()
public int getWidth()
public int getHeight()
public void setLeft(int value)
value - the valuepublic void setTop(int value)
value - the valuepublic int getBottom()
public int getRight()
public void setWidth(int value)
value - the valuepublic void setHeight(int value)
value - the valuepublic Location getMiddleOffset()
public Region expandToContain(Region region)
region - the regionpublic void setX(int x)
public void setY(int y)
public SubregionForStitching[] getSubRegions(RectangleSize maxSubRegionSize, int logicalOverlap, double l2pScaleRatio, Rectangle physicalRectInScreenshot, Logger logger)
public String getRegionId()
Copyright © 2023. All rights reserved.