Public Member Functions | Private Member Functions | Private Attributes | List of all members
com.introlab.rtabmap.DisplayRotationHelper Class Reference
Inheritance diagram for com.introlab.rtabmap.DisplayRotationHelper:
Inheritance graph
[legend]

Public Member Functions

 DisplayRotationHelper (Context context)
 
float getCameraSensorRelativeViewportAspectRatio (String cameraId)
 
int getCameraSensorToDisplayRotation (String cameraId)
 
void onDisplayAdded (int displayId)
 
void onDisplayChanged (int displayId)
 
void onDisplayRemoved (int displayId)
 
void onPause ()
 
void onResume ()
 
void onSurfaceChanged (int width, int height)
 
void updateSessionIfNeeded (ARCoreSharedCamera session)
 

Private Member Functions

int toDegrees (int rotation)
 

Private Attributes

final CameraManager cameraManager
 
final Display display
 
final DisplayManager displayManager
 
boolean viewportChanged
 
int viewportHeight
 
int viewportWidth
 

Detailed Description

Helper to track the display rotations. In particular, the 180 degree rotations are not notified by the onSurfaceChanged() callback, and thus they require listening to the android display events.

Definition at line 36 of file DisplayRotationHelper.java.

Constructor & Destructor Documentation

◆ DisplayRotationHelper()

com.introlab.rtabmap.DisplayRotationHelper.DisplayRotationHelper ( Context  context)
inline

Constructs the DisplayRotationHelper but does not register the listener yet.

Parameters
contextthe Android Context.

Definition at line 49 of file DisplayRotationHelper.java.

Member Function Documentation

◆ getCameraSensorRelativeViewportAspectRatio()

float com.introlab.rtabmap.DisplayRotationHelper.getCameraSensorRelativeViewportAspectRatio ( String  cameraId)
inline

Returns the aspect ratio of the GL surface viewport while accounting for the display rotation relative to the device camera sensor orientation.

Definition at line 101 of file DisplayRotationHelper.java.

◆ getCameraSensorToDisplayRotation()

int com.introlab.rtabmap.DisplayRotationHelper.getCameraSensorToDisplayRotation ( String  cameraId)
inline

Returns the rotation of the back-facing camera with respect to the display. The value is one of 0, 90, 180, 270.

Definition at line 123 of file DisplayRotationHelper.java.

◆ onDisplayAdded()

void com.introlab.rtabmap.DisplayRotationHelper.onDisplayAdded ( int  displayId)
inline

Definition at line 157 of file DisplayRotationHelper.java.

◆ onDisplayChanged()

void com.introlab.rtabmap.DisplayRotationHelper.onDisplayChanged ( int  displayId)
inline

Definition at line 163 of file DisplayRotationHelper.java.

◆ onDisplayRemoved()

void com.introlab.rtabmap.DisplayRotationHelper.onDisplayRemoved ( int  displayId)
inline

Definition at line 160 of file DisplayRotationHelper.java.

◆ onPause()

void com.introlab.rtabmap.DisplayRotationHelper.onPause ( )
inline

Unregisters the display listener. Should be called from Activity#onPause().

Definition at line 62 of file DisplayRotationHelper.java.

◆ onResume()

void com.introlab.rtabmap.DisplayRotationHelper.onResume ( )
inline

Registers the display listener. Should be called from Activity#onResume().

Definition at line 57 of file DisplayRotationHelper.java.

◆ onSurfaceChanged()

void com.introlab.rtabmap.DisplayRotationHelper.onSurfaceChanged ( int  width,
int  height 
)
inline

Records a change in surface dimensions. This will be later used by updateSessionIfNeeded(Session). Should be called from #onSurfaceChanged(javax.microedition.khronos.opengles.GL10, int, int).

Parameters
widththe updated width of the surface.
heightthe updated height of the surface.

Definition at line 75 of file DisplayRotationHelper.java.

◆ toDegrees()

int com.introlab.rtabmap.DisplayRotationHelper.toDegrees ( int  rotation)
inlineprivate

Definition at line 141 of file DisplayRotationHelper.java.

◆ updateSessionIfNeeded()

void com.introlab.rtabmap.DisplayRotationHelper.updateSessionIfNeeded ( ARCoreSharedCamera  session)
inline

Updates the session display geometry if a change was posted either by onSurfaceChanged(int, int) call or by onDisplayChanged(int) system callback. This function should be called explicitly before each call to Session#update(). This function will also clear the 'pending update' (viewportChanged) flag.

Parameters
sessionthe Session object to update if display geometry changed.

Definition at line 89 of file DisplayRotationHelper.java.

Member Data Documentation

◆ cameraManager

final CameraManager com.introlab.rtabmap.DisplayRotationHelper.cameraManager
private

Definition at line 42 of file DisplayRotationHelper.java.

◆ display

final Display com.introlab.rtabmap.DisplayRotationHelper.display
private

Definition at line 40 of file DisplayRotationHelper.java.

◆ displayManager

final DisplayManager com.introlab.rtabmap.DisplayRotationHelper.displayManager
private

Definition at line 41 of file DisplayRotationHelper.java.

◆ viewportChanged

boolean com.introlab.rtabmap.DisplayRotationHelper.viewportChanged
private

Definition at line 37 of file DisplayRotationHelper.java.

◆ viewportHeight

int com.introlab.rtabmap.DisplayRotationHelper.viewportHeight
private

Definition at line 39 of file DisplayRotationHelper.java.

◆ viewportWidth

int com.introlab.rtabmap.DisplayRotationHelper.viewportWidth
private

Definition at line 38 of file DisplayRotationHelper.java.


The documentation for this class was generated from the following file:


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:38:59