目录

1. OverView

Interface info

public interface com.huawei.hms.panorama.PanoramaInterface
Basic API for viewing panoramas.

Nested Summary

Qualifier and TypeInterface name and Description
Interface

PanoramaLocalInterface

API for panorama display in an app.

Class

ImageInfoResult

Panorama loading result class.

2. Public Method Summary

ReturnMethod

PendingResult<PanoramaInterface.  ImageInfoResult>  

loadImageInfo(Context context, Uri uri)

Obtains panorama information and returns the intent for redirecting to the activity for displaying panoramas.

PendingResult<PanoramaInterface.  ImageInfoResult>  

loadImageInfoWithPermission (Context context, Uri uri)

Obtains panorama information and returns the intent for redirecting to the activity for displaying panoramas. The intent contains the authorization flag FLAG_GRANT_READ_URI_PERMISSION for HUAWEI Panorama Kit to temporarily access the panorama URI.

PendingResult<PanoramaInterface.  ImageInfoResult>  

loadImageInfo(Context context, Uri uri, int type)

Obtains panorama information and returns the intent for redirecting to the activity for displaying panoramas.

PendingResult<PanoramaInterface. ImageInfoResult>  

loadImageInfoWithPermission(Context context, Uri uri, int type)

Obtains panorama information and returns the intent for redirecting to the activity for displaying panoramas. The intent contains the authorization flag FLAG_GRANT_READ_URI_PERMISSION for HUAWEI Panorama Kit to temporarily access the panorama URI.

PanoramaInterface. PanoramaLocalInterface

getLocalInstance(Context context)

Obtains the instance for calling the local API.

3.Public Field Summary

Qualifier and Type

Field and Descriptio

int 

IMAGE_TYPE_SPHERICAL

Spherical panorama. 

int

IMAGE_TYPE_RING

Cylindrical panorama. 

int

CONTROL_TYPE_TOUCH

Touch control. 

int

CONTROL_TYPE_POSE

Motion tracking control.

int

CONTROL_TYPE_MIX

Allows for touch control and motion control simultaneously.

String

KEY_RENDER_MODE

Rendering mode.

String

VALUE_RENDER_MODE_NORMAL 

Default rendering mode.

String

VALUE_RENDER_MODE_POLAR

Rendering in polar coordinates.

String

KEY_CURRENT_AZIMUTH

Current azimuth.

String

KEY_CURRENT_HORIZONTAL_FOV

Current horizontal field of view (FOV).

String

KEY_IMAGE_TYPE

Image type. Two options are available:IMAGE_TYPE_SPHERICAL(spherical) andIMAGE_TYPE_RING(cylindrical/ring).

String

KEY_VIDEO_RATIO 

Aspect ratio of a video. The value type isfloat. The default value is2:1(2.0f). The setting takes effect only when the video is displayed in cylindrical mode.

* If you do not specify an aspect ratio for cylindrical video display, the default value will be used. In this case, if the actual aspect ratio is greater than 2:1, video images in the horizontal direction will be compressed. If the actual aspect ratio is less than 2:1, video images in the horizontal direction will be stretched.


4. Public Methods

4.1 loadImageInfo

Method

PendingResult<PanoramaInterface.ImageInfoResult> loadImageInfo (Context context, Uri uri)

Obtains panorama information and returns the intent for redirecting to the activity for displaying panoramas.

Parameters

Parameter
Description

context 

APP context. To actively trigger an upgrade, pass an Activity object.

uri 

URI of the panorama to be loaded.

Three URIs starting with file, content, and android.resource are supported.

Return

TypeDescription

PendingResult<PanoramaInterface.ImageInfoResult> 

Obtains the PendingResult object encapsulated with ImageInfoResult. 

The PendingResult object provides methods for obtaining results synchronously and asynchronously.

4.2 loadImageInfoWithPermission

Method

PendingResult<PanoramaInterface.ImageInfoResult> loadImageInfoWithPermission(Context context, Uri uri)

Obtains panorama information and returns the intent for redirecting to the activity for displaying panoramas. The intent contains the authorization flagFLAG_GRANT_READ_URI_PERMISSIONfor HUAWEI Panorama Kit to temporarily access the panorama URI.

Parameters

ParameterDescription

context

APP context. To actively trigger an upgrade, pass an Activity object. 

uri 

URI of the panorama to be loaded.

Three URIs starting with file, content, and android.resource are supported.

Return

TypeDescription

PendingResult<PanoramaInterface.ImageInfoResult>

Obtains the PendingResult object encapsulated with ImageInfoResult.

The PendingResult object provides methods for obtaining results 

synchronously and asynchronously.

4.3 loadImageInfo

Method

PendingResult<PanoramaInterface.ImageInfoResult> loadImageInfo (Context context, Uri uri, int type)

Obtains information about the panorama of a specified type and returns the intent for redirecting to the activity for displaying panoramas.

Parameters

ParameterDescription

context 

APP context. To actively trigger an upgrade,pass an Activity object.

uri 

URI of the panorama to be loaded.

Three URIs starting with file, content, and android.resource are supported.

type

Panorama type.

Currently, the spherical panorama and cylindrical panorama are supported.

Return

TypeDescription

PendingResult<PanoramaInterface. ImageInfoResult>

Obtains the PendingResult object encapsulated with ImageInfoResult.

The PendingResult object provides methods for obtaining results

synchronously and asynchronously.

4.4 loadImageInfoWithPermission

Method

PendingResult<PanoramaInterface.ImageInfoResult> loadImageInfoWithPermission(Context context, Uri uri, int type)

Obtains panorama information and returns the intent for redirecting to the activity for displaying panoramas. The intent contains the authorization flagFLAG_GRANT_READ_URI_PERMISSIONfor HUAWEI Panorama Kit to temporarily access the panorama URI.

Parameters

ParameterDescription

context

APP context. To actively trigger an upgrade, pass an Activity object. 

uri

URI of the panorama to be loaded.

Three URIs starting with file, content, and android.resource are supported.

type

Panorama type.

Currently, the spherical panorama and cylindrical panorama are supported.

Return

TypeDescription

PendingResult<PanoramaInterface.ImageInfoResult>

Obtains the PendingResult object encapsulated with ImageInfoResult.

The PendingResult object provides methods for obtaining results synchronously and asynchronously.

4.5 getLocalInstance

Method

PanoramaInterface.PanoramaLocalInterface getLocalInstance(Context context)

Obtains the instance for calling the local API.

Parameters

ParameterDescription
context

APP context. To actively trigger an upgrade, pass an Activityobject.

Return

TypeDescription

PanoramaInterface.PanoramaLocalInterface 

If the API is successfully called, the PanoramaLocalInterface object can be called is returned. If the API fails to be called, null is returned.

5. Public Fields

5.1  IMAGE_TYPE_SPHERICAL

Field

int IMAGE_TYPE_SPHERICAL

Spherical panorama.

5.2  IMAGE_TYPE_RING

Field
int IMAGE_TYPE_RING

Cylindrical panorama.

5.3  CONTROL_TYPE_TOUCH

Field
int CONTROL_TYPE_TOUCH

Touch control.

5.4  CONTROL_TYPE_POSE

Field
int CONTROL_TYPE_POSE

Motion tracking control.

5.5  CONTROL_TYPE_MIX

Field
int CONTROL_TYPE_MIX

Allows for touch control and motion control simultaneously.

5.6  KEY_RENDER_MODE

Field



String KEY_RENDER_MODE

Rendering mode. This constant can be successfully set only after the panorama is correctly set.

5.7  VALUE_RENDER_MODE_NORMAL

Field



String VALUE_RENDER_MODE_NORMAL

Default rendering mode.

5.8  VALUE_RENDER_MODE_POLAR

Field



String VALUE_RENDER_MODE_POLAR

Rendering in polar coordinates. This mode supports only the panorama of the IMAGE_TYPE_SPHERICAL type.

5.9  KEY_CURRENT_AZIMUTH

Field



String KEY_CURRENT_AZIMUTH

Current azimuth.

5.10 KEY_CURRENT_HORIZONTAL_FOV

Field



String  KEY_CURRENT_HORIZONTAL_FOV

Current horizontal field of view (FOV).

5.11 KEY_IMAGE_TYPE

Field

String KEY_IMAGE_TYPE

Image type. Two options are available: IMAGE_TYPE_SPHERICAL (spherical) and IMAGE_TYPE_RING (cylindrical/ring).

5.12 KEY_VIDEO_RATIO

Field

String KEY_VIDEO_RATIO

Aspect ratio of a video. The value type is float. The default value is 2:1 (2.0f). The setting takes effect only when the video is displayed in cylindrical mode.

* If you do not specify an aspect ratio for cylindrical video display, the default value will be used. In this case, if the actual aspect ratio is greater than 2:1, video images in the horizontal direction will be compressed. If the actual aspect ratio is less than 2:1, video images in the horizontal direction will be stretched.