Record Class Region
java.lang.Object
java.lang.Record
is.galia.image.Region
- Record Components:
x- X origin.y- Y origin.size- Size.isFull- Whentrue, indicates a "full region" which renders its coordinate properties irrelevant.
Region on a plane with origin and dimensions.
A negative origin is allowed. Zero-dimensions are allowed, but not negative ones.
-
Constructor Summary
ConstructorsConstructorDescriptionRegion(double x, double y, double width, double height) Region(double x, double y, double width, double height, boolean isFull) Creates an instance of aRegionrecord class.Region(long x, long y, long width, long height) Region(long x, long y, long width, long height, boolean isFull) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanOverride that allows a small differences between float values.final inthashCode()Returns a hash code value for this object.doubleheight()booleanintersects(Region other) intintintWidth()intintX()intintY()booleanisEmpty()booleanisFull()Returns the value of theisFullrecord component.longlonglonglongX()longlongY()moved(double x, double y) oriented(Size fullSize, Orientation orientation) resized(double width, double height) scaled(double amount) scaled(double xAmount, double yAmount) size()Returns the value of thesizerecord component.Warning:Rectangledoes not support coordinates larger thanInteger.MAX_VALUE,toString()Returns a string representation of this record class.doublewidth()doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.
-
Constructor Details
-
Region
-
Region
-
Region
public Region(double x, double y, double width, double height) -
Region
public Region(double x, double y, double width, double height, boolean isFull) -
Region
public Region(long x, long y, long width, long height) -
Region
public Region(long x, long y, long width, long height, boolean isFull) -
Region
Copy constructor.
-
-
Method Details
-
contains
- Returns:
- Whether the given rectangle is entirely contained within the instance.
-
equals
-
clippedTo
-
width
public double width() -
height
public double height() -
intX
public int intX()- Returns:
- Rounded value of
x().
-
intY
public int intY()- Returns:
- Rounded value of
y().
-
intWidth
public int intWidth()- Returns:
- Rounded value of
width().
-
intHeight
public int intHeight()- Returns:
- Rounded value of
height().
-
intersects
-
isEmpty
public boolean isEmpty()- Returns:
- Whether the instance has zero dimensions and is not
full.
-
longX
public long longX()- Returns:
- Rounded value of
x().
-
longY
public long longY()- Returns:
- Rounded value of
y().
-
longWidth
public long longWidth()- Returns:
- Rounded value of
width().
-
longHeight
public long longHeight()- Returns:
- Rounded value of
height().
-
moved
-
oriented
- Parameters:
fullSize- Raw source image dimensions.orientation- Orientation to apply.- Returns:
- New oriented instance derived from the current one.
-
resized
- Returns:
- New instance with the same origin and the given size.
-
scaled
- Returns:
- New instance with origin and size scaled by the given amount.
-
scaled
- Returns:
- New instance with origin and dimensions scaled by the given amounts.
-
size
-
toAWTRectangle
Warning:Rectangledoes not support coordinates larger thanInteger.MAX_VALUE, -
toString
-
hashCode
-
x
-
y
-
isFull
-