Package com.banuba.sdk.input
Class OrientationHelper
java.lang.Object
com.banuba.sdk.input.OrientationHelper
Orientation helper class.
-
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinalize()intstatic intgetFaceOrientation(int imageAngle, int deviceAngle, boolean requireMirroring) Get face orientation angle value based on image and device orientation values.static intgetFaceOrientationByCamera(int imageAngle, int deviceAngle, int cameraAngle, boolean frontCamera, boolean requireMirroring) Get face orientation angle value based on camera parameters.static OrientationHelpergetInstance(android.content.Context context) static com.banuba.sdk.types.FullImageData.OrientationgetOrientation(int imageAngle, int deviceAngle, boolean requireMirroring) GetFullImageData.Orientationbased on image and device orientation values.static com.banuba.sdk.types.FullImageData.OrientationgetOrientationByCamera(int imageAngle, int deviceAngle, int cameraAngle, boolean frontCamera, boolean requireMirroring) GetFullImageData.Orientationbased on camera parameters.voidvoid
-
Method Details
-
startDeviceOrientationUpdates
public void startDeviceOrientationUpdates() -
stopDeviceOrientationUpdates
public void stopDeviceOrientationUpdates() -
getDeviceOrientationAngle
public int getDeviceOrientationAngle() -
finalize
-
getInstance
-
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) GetFullImageData.Orientationbased 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) GetFullImageData.Orientationbased 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
-