Class Rectangle

  • All Implemented Interfaces:
    android.os.Parcelable

    public class Rectangle
    extends java.lang.Object
    implements android.os.Parcelable
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T extends java.lang.Object>, android.os.Parcelable.Creator<T extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static android.os.Parcelable.Creator<Rectangle> CREATOR  
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • Constructor Summary

      Constructors 
      Constructor Description
      Rectangle​(float x, float y, float width, float height)
      Rectangle constructor.
    • Field Detail

      • CREATOR

        @NonNull
        public static final android.os.Parcelable.Creator<Rectangle> CREATOR
    • Constructor Detail

      • Rectangle

        public Rectangle​(float x,
                         float y,
                         float width,
                         float height)
        Rectangle constructor.
        Parameters:
        x - top left x coordinate
        y - top left y coordinate
        width - rectangle width
        height - rectangle height
    • Method Detail

      • 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

        @NonNull
        public static Rectangle getDefaultROI()
        Returns the default rectangle that defines the whole image or view
        Returns:
        the default rectangle that defines the whole image or view
      • toString

        @NonNull
        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • log

        public void log()
      • normalizeToUnitRectangle

        public void normalizeToUnitRectangle()
      • toRectF

        @NonNull
        public android.graphics.RectF toRectF()
      • fromRectF

        public static Rectangle fromRectF​(android.graphics.RectF rectF)
      • 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 interface android.os.Parcelable
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • writeToParcel

        public void writeToParcel​(@NonNull
                                  android.os.Parcel dest,
                                  int flags)
        Specified by:
        writeToParcel in interface android.os.Parcelable