Package io.scanbot.sdk.geometry
Class Rectangle
java.lang.Object
io.scanbot.sdk.geometry.Rectangle
Represents a rectangle with integer coordinates in 2D space.
-
Constructor Summary
ConstructorsConstructorDescriptionRectangle(int x, int y, int width, int height) Constructs a rectangle with given coordinates and dimensions. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the height of the rectangle.intgetWidth()Returns the width of the rectangle.intgetX()Returns the x-coordinate of the top-left corner of the rectangle.intgetY()Returns the y-coordinate of the top-left corner of the rectangle.voidsetHeight(int height) Sets the height of the rectangle.voidsetWidth(int width) Sets the width of the rectangle.voidsetX(int x) Sets the x-coordinate of the top-left corner of the rectangle.voidsetY(int y) Sets the y-coordinate of the top-left corner of the rectangle.
-
Constructor Details
-
Rectangle
public Rectangle(int x, int y, int width, int height) Constructs a rectangle with given coordinates and dimensions.- Parameters:
x- x-coordinate of the top-left cornery- y-coordinate of the top-left cornerwidth- widthheight- height
-
-
Method Details
-
getX
public int getX()Returns the x-coordinate of the top-left corner of the rectangle.- Returns:
- x-coordinate
-
setX
public void setX(int x) Sets the x-coordinate of the top-left corner of the rectangle.- Parameters:
x- x-coordinate
-
getY
public int getY()Returns the y-coordinate of the top-left corner of the rectangle.- Returns:
- y-coordinate
-
setY
public void setY(int y) Sets the y-coordinate of the top-left corner of the rectangle.- Parameters:
y- y-coordinate
-
getWidth
public int getWidth()Returns the width of the rectangle.- Returns:
- width
-
setWidth
public void setWidth(int width) Sets the width of the rectangle.- Parameters:
width- width
-
getHeight
public int getHeight()Returns the height of the rectangle.- Returns:
- height
-
setHeight
public void setHeight(int height) Sets the height of the rectangle.- Parameters:
height- height
-