Package georegression.struct.shapes
Class Rectangle2D_I32
java.lang.Object
georegression.struct.shapes.Rectangle2D_I32
An axis aligned rectangle in 2D that is specified by its lower extent (x0,y0), and upper extent (x1,y1).
x0 ≤ x1 and y0 ≤ y1. (x1,y1) is exclusive and not contained in the rectangle.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintarea()voidMakes sure x0,y0 is the lower extent and x1,y1 is the upper extentbooleangetCorner(int index, @Nullable Point2D_I32 corner) Provides access to corners in the order specified below.intintgetWidth()inthashCode()booleanisEquals(int x0, int y0, int x1, int y1) setTo(int x0, int y0, int x1, int y1) setTo(Rectangle2D_I32 orig) toString()voidzero()Sets the value of all fields to zero
-
Field Details
-
x0
public int x0Lower extent -
y0
public int y0Lower extent -
x1
public int x1Upper extent -
y1
public int y1Upper extent
-
-
Constructor Details
-
Rectangle2D_I32
public Rectangle2D_I32(int x0, int y0, int x1, int y1) -
Rectangle2D_I32
-
Rectangle2D_I32
public Rectangle2D_I32()
-
-
Method Details
-
setTo
-
setTo
-
zero
public void zero()Sets the value of all fields to zero -
enforceExtents
public void enforceExtents()Makes sure x0,y0 is the lower extent and x1,y1 is the upper extent -
getCorner
Provides access to corners in the order specified below.[0] = (x0, y0) [1] = (x1, y0) [2] = (x1, y1) [3] = (x0, y1)
where w = width, and h = height.- Parameters:
index- Which cornercorner- (Optional) storage for the corner- Returns:
- The corner
-
isEquals
public boolean isEquals(int x0, int y0, int x1, int y1) -
getWidth
public int getWidth() -
getHeight
public int getHeight() -
area
public int area() -
toString
-
equals
-
hashCode
public int hashCode()
-