Skip to content

Instantly share code, notes, and snippets.

@doomSDey
Last active July 24, 2020 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doomSDey/53dd3c889395a40e6e3e4d906928ee7c to your computer and use it in GitHub Desktop.
Save doomSDey/53dd3c889395a40e6e3e4d906928ee7c to your computer and use it in GitHub Desktop.
private int degreesToFirebaseRotation(int degrees) {
switch (degrees) {
case 0:
return FirebaseVisionImageMetadata.ROTATION_0;
case 90:
return FirebaseVisionImageMetadata.ROTATION_90;
case 180:
return FirebaseVisionImageMetadata.ROTATION_180;
case 270:
return FirebaseVisionImageMetadata.ROTATION_270;
default:
throw new IllegalArgumentException(
"Rotation must be 0, 90, 180, or 270.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment