Class OrientationHelper

java.lang.Object
com.banuba.sdk.internal.utils.OrientationHelper

public final class OrientationHelper extends Object
Orientation helper class.
  • Method Details

    • startDeviceOrientationUpdates

      public void startDeviceOrientationUpdates()
    • stopDeviceOrientationUpdates

      public void stopDeviceOrientationUpdates()
    • getDeviceOrientationAngle

      public int getDeviceOrientationAngle()
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • getInstance

      public static OrientationHelper getInstance(@NonNull android.content.Context context)
    • getFaceOrientationByCamera

      public static int getFaceOrientationByCamera(int imageAngle, int deviceAngle, int cameraAngle, boolean frontCamera, boolean requireMirroring)
      Get face orientation angle value based on camera parameters. Image, device and camera orientation angles should be from list of [0, 90, 180, 270]. Image orientation angles match to the next head directions: 0 - head-left direction; 90 - head-down direction; 180 - head-right direction; 270 - head-top direction. Device orientation angles match to the device main button direction next way: 0 - button-down direction; 90 - button-right direction; 180 - button-top direction; 270 - button-left direction.
      Parameters:
      imageAngle - image orientation angle value.
      deviceAngle - device orientation angle value.
      cameraAngle - camera orientation angle value.
      frontCamera - front camera flag value.
      requireMirroring - mirroring required flag value.
      Returns:
      face orientation angle value, should be one from the list of [0, 90, 180, 270].
    • getOrientationByCamera

      public static com.banuba.sdk.types.FullImageData.Orientation getOrientationByCamera(int imageAngle, int deviceAngle, int cameraAngle, boolean frontCamera, boolean requireMirroring)
      Get FullImageData.Orientation based on camera parameters. Image, device and camera orientation angles should be from list of [0, 90, 180, 270]. Image orientation angles match to the next head directions: 0 - head-left direction; 90 - head-down direction; 180 - head-right direction; 270 - head-top direction. Device orientation angles match to the device main button direction next way: 0 - button-down direction; 90 - button-right direction; 180 - button-top direction; 270 - button-left direction.
      Parameters:
      imageAngle - image orientation angle value.
      deviceAngle - device orientation angle value.
      cameraAngle - camera orientation angle value.
      frontCamera - front camera flag value.
      requireMirroring - mirroring required flag value.
      Returns:
      FullImageData.Orientation
    • getFaceOrientation

      public static int getFaceOrientation(int imageAngle, int deviceAngle, boolean requireMirroring)
      Get face orientation angle value based on image and device orientation values. Image and device orientation angles should be from list of [0, 90, 180, 270]. Image orientation angles match to the next head directions: 0 - head-left direction; 90 - head-down direction; 180 - head-right direction; 270 - head-top direction. Device orientation angles match to the device main button direction next way: 0 - button-down direction; 90 - button-right direction; 180 - button-top direction; 270 - button-left direction.
      Parameters:
      imageAngle - image orientation angle value.
      deviceAngle - device orientation angle value.
      requireMirroring - mirroring required flag value.
      Returns:
      face orientation angle value, should be one from the list of [0, 90, 180, 270].
    • getOrientation

      public static com.banuba.sdk.types.FullImageData.Orientation getOrientation(int imageAngle, int deviceAngle, boolean requireMirroring)
      Get FullImageData.Orientation based on image and device orientation values. Image and device orientation angles should be from list of [0, 90, 180, 270]. Image orientation angles match to the next head directions: 0 - head-left direction; 90 - head-down direction; 180 - head-right direction; 270 - head-top direction. Device orientation angles match to the device main button direction next way: 0 - button-down direction; 90 - button-right direction; 180 - button-top direction; 270 - button-left direction.
      Parameters:
      imageAngle - image orientation angle value.
      deviceAngle - device orientation angle value.
      requireMirroring - mirroring required flag value.
      Returns:
      FullImageData.Orientation