Package com.banuba.sdk.internal.utils
Class OrientationHelper
java.lang.Object
com.banuba.sdk.internal.utils.OrientationHelper
Orientation helper class.
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
finalize()
int
static int
getFaceOrientation
(int imageAngle, int deviceAngle, boolean requireMirroring) Get face orientation angle value based on image and device orientation values.static int
getFaceOrientationByCamera
(int imageAngle, int deviceAngle, int cameraAngle, boolean frontCamera, boolean requireMirroring) Get face orientation angle value based on camera parameters.static OrientationHelper
getInstance
(android.content.Context context) static com.banuba.sdk.types.FullImageData.Orientation
getOrientation
(int imageAngle, int deviceAngle, boolean requireMirroring) GetFullImageData.Orientation
based on image and device orientation values.static com.banuba.sdk.types.FullImageData.Orientation
getOrientationByCamera
(int imageAngle, int deviceAngle, int cameraAngle, boolean frontCamera, boolean requireMirroring) GetFullImageData.Orientation
based on camera parameters.void
void
-
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.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) GetFullImageData.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
-