Class Face

  • All Implemented Interfaces:
    android.os.Parcelable
    Direct Known Subclasses:
    RecognizableFace

    public class Face
    extends java.lang.Object
    implements android.os.Parcelable
    Face detected in an image
    Since:
    1.0.0
    • Nested Class Summary

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

        android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.ContentsFlags, android.os.Parcelable.Creator<T>, android.os.Parcelable.Stability, android.os.Parcelable.WriteFlags
    • Field Summary

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

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_STABILITY_LOCAL, PARCELABLE_STABILITY_VINTF, PARCELABLE_WRITE_RETURN_VALUE
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        Face​(android.graphics.RectF bounds, EulerAngle angle, android.graphics.PointF leftEye, android.graphics.PointF rightEye, byte[] data, float quality, android.graphics.PointF[] landmarks, float[] dlibLandmarks)  
      protected Face​(android.os.Parcel in)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int describeContents()
      Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
      boolean equals​(java.lang.Object o)  
      Face flipped​(Size imageSize)  
      EulerAngle getAngle()
      Get the angle of the face.
      android.graphics.RectF getBounds()
      Get bounds of the face in the image.
      byte[] getData()
      Get a serialized representation of the face.
      float[] getDlibLandmarks()  
      android.graphics.PointF[] getLandmarks()  
      android.graphics.PointF getLeftEye()
      Get the position of the left eye in the image.
      float getQuality()  
      android.graphics.PointF getRightEye()
      Get the position of the right eye in the image.
      RecognizableType getType()  
      int hashCode()  
      void setLandmarks​(android.graphics.PointF[] landmarks)  
      void writeToParcel​(android.os.Parcel dest, int flags)
      Flatten this object in to a Parcel.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface android.os.Parcelable

        getStability
    • Field Detail

      • CREATOR

        public static final android.os.Parcelable.Creator<Face> CREATOR
    • Constructor Detail

      • Face

        protected Face​(android.os.Parcel in)
      • Face

        public Face​(@NonNull
                    android.graphics.RectF bounds,
                    @NonNull
                    EulerAngle angle,
                    @Nullable
                    android.graphics.PointF leftEye,
                    @Nullable
                    android.graphics.PointF rightEye,
                    @NonNull
                    byte[] data,
                    float quality,
                    @NonNull
                    android.graphics.PointF[] landmarks,
                    @NonNull @Size(10L)
                    float[] dlibLandmarks)
    • Method Detail

      • flipped

        public Face flipped​(Size imageSize)
      • getDlibLandmarks

        public float[] getDlibLandmarks()
      • getBounds

        @NonNull
        public android.graphics.RectF getBounds()
        Get bounds of the face in the image.
        Returns:
        Bounds of the face in pixels
        Since:
        1.0.0
      • getAngle

        @NonNull
        public EulerAngle getAngle()
        Get the angle of the face.
        Returns:
        Face angle
        Since:
        1.0.0
      • getLeftEye

        @Nullable
        public android.graphics.PointF getLeftEye()
        Get the position of the left eye in the image.
        Returns:
        Point
        Since:
        1.0.0
      • getRightEye

        @Nullable
        public android.graphics.PointF getRightEye()
        Get the position of the right eye in the image.
        Returns:
        Point
        Since:
        1.0.0
      • getData

        @NonNull
        public byte[] getData()
        Get a serialized representation of the face.
        Returns:
        Byte array
        Since:
        1.0.0
      • getQuality

        public float getQuality()
      • getLandmarks

        public android.graphics.PointF[] getLandmarks()
        Returns:
        Face landmarks array
        Since:
        1.10.0
      • 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
      • setLandmarks

        public void setLandmarks​(android.graphics.PointF[] landmarks)
        Parameters:
        landmarks - Face landmarks
        Since:
        1.10.0
      • describeContents

        public int describeContents()
        Description copied from interface: android.os.Parcelable
        Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of Parcelable.writeToParcel(Parcel, int), the return value of this method must include the Parcelable.CONTENTS_FILE_DESCRIPTOR bit.
        Specified by:
        describeContents in interface android.os.Parcelable
        Returns:
        a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
      • writeToParcel

        public void writeToParcel​(android.os.Parcel dest,
                                  int flags)
        Description copied from interface: android.os.Parcelable
        Flatten this object in to a Parcel.
        Specified by:
        writeToParcel in interface android.os.Parcelable
        Parameters:
        dest - The Parcel in which the object should be written.
        flags - Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.