-
public class AnglesManages offsets between different Reference systems. These offsets are computed based on the setSensorOffset, setDisplayOffset and setDeviceOrientation values that are coming from outside. When communicating with the sensor, RELATIVE_TO_SENSOR should probably be used. This means inverting the offset when using the front camera. This is often the case when calling offset(SENSOR, OUTPUT), for example when passing a JPEG rotation to the sensor. That is meant to be consumed as relative to the sensor plane. For all other usages, ABSOLUTE is probably a better choice.
-
-
Method Summary
Modifier and Type Method Description voidsetSensorOffset(@NonNull() Facing sensorFacing, int sensorOffset)We want to keep everything in the ABSOLUTE reference,so a front facing sensor offset must be inverted. voidsetDisplayOffset(int displayOffset)Sets the display offset. voidsetDeviceOrientation(int deviceOrientation)Sets the device orientation. intoffset(@NonNull() Reference from, @NonNull() Reference to, @NonNull() Axis axis)Returns the offset between two reference systems, computed along the given axis. booleanflip(@NonNull() Reference from, @NonNull() Reference to)Whether the two references systems are flipped. -
-
Method Detail
-
setSensorOffset
void setSensorOffset(@NonNull() Facing sensorFacing, int sensorOffset)
We want to keep everything in the ABSOLUTE reference,so a front facing sensor offset must be inverted.
- Parameters:
sensorFacing- sensor facing valuesensorOffset- sensor offset
-
setDisplayOffset
void setDisplayOffset(int displayOffset)
Sets the display offset.
- Parameters:
displayOffset- the display offset
-
setDeviceOrientation
void setDeviceOrientation(int deviceOrientation)
Sets the device orientation.
- Parameters:
deviceOrientation- the device orientation
-
offset
int offset(@NonNull() Reference from, @NonNull() Reference to, @NonNull() Axis axis)
Returns the offset between two reference systems, computed along the given axis.
- Parameters:
from- the source reference systemto- the destination reference systemaxis- the axis
-
-
-
-