Package com.microblink.photopay.geometry
Class Rectangle
java.lang.Object
com.microblink.photopay.geometry.Rectangle
- All Implemented Interfaces:
android.os.Parcelable
-
Nested Class Summary
-
Field Summary
FieldsFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionRectangle(float x, float y, float width, float height) Rectangle constructor. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanstatic RectanglefromRectF(android.graphics.RectF rectF) static RectangleReturns the default rectangle that defines the whole image or viewfloatfloatgetWidth()floatgetX()floatgetY()inthashCode()booleanReturn true if rectangle is given in relative coordinates.voidlog()voidandroid.graphics.RectFtoRectF()toString()voidwriteToParcel(android.os.Parcel dest, int flags)
-
Field Details
-
CREATOR
-
-
Constructor Details
-
Rectangle
public Rectangle(float x, float y, float width, float height) Rectangle constructor.- Parameters:
x- top left x coordinatey- top left y coordinatewidth- rectangle widthheight- rectangle height
-
-
Method Details
-
isRelative
public boolean isRelative()Return true if rectangle is given in relative coordinates. Relative coordinates mean that each coordinate is given as percentage.- Returns:
- true if rectangle is given in relative coordinates
-
getDefaultROI
Returns the default rectangle that defines the whole image or view- Returns:
- the default rectangle that defines the whole image or view
-
toString
-
log
public void log() -
normalizeToUnitRectangle
public void normalizeToUnitRectangle() -
toRectF
@NonNull public android.graphics.RectF toRectF() -
fromRectF
-
getX
public float getX()- Returns:
- the x
-
getY
public float getY()- Returns:
- the y
-
getWidth
public float getWidth()- Returns:
- the width
-
getHeight
public float getHeight()- Returns:
- the height
-
describeContents
public int describeContents()- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
equals
-
hashCode
public int hashCode() -
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-