Package com.microblink.blinkid.geometry
Class Rectangle
java.lang.Object
com.microblink.blinkid.geometry.Rectangle
- All Implemented Interfaces:
android.os.Parcelable
-
Nested Class Summary
-
Field Summary
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Constructor Summary
ConstructorDescriptionRectangle
(float x, float y, float width, float height) Rectangle constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static Rectangle
fromRectF
(android.graphics.RectF rectF) static Rectangle
Returns the default rectangle that defines the whole image or viewfloat
float
getWidth()
float
getX()
float
getY()
int
hashCode()
boolean
Return true if rectangle is given in relative coordinates.void
log()
void
android.graphics.RectF
toRectF()
toString()
void
writeToParcel
(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:
describeContents
in interfaceandroid.os.Parcelable
-
equals
-
hashCode
public int hashCode() -
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) - Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-