| Interface info | |
|---|---|
| public interface com.huawei.hms.panorama.PanoramaInterface Basic API for viewing panoramas. | |
| Qualifier and Type | Interface name and Description |
|---|---|
| Interface | API for panorama display in an app. |
Class | Panorama loading result class. |
| Return | Method |
|---|---|
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. |
| 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
| Type | Description |
|---|---|
PendingResult<PanoramaInterface.ImageInfoResult> | Obtains the PendingResult object encapsulated with ImageInfoResult. The PendingResult object provides methods for obtaining results synchronously and asynchronously. |
| 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
| 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
| Type | Description |
|---|---|
PendingResult<PanoramaInterface.ImageInfoResult> | Obtains the PendingResult object encapsulated with ImageInfoResult. The PendingResult object provides methods for obtaining results synchronously and asynchronously. |
| 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
| 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. |
type | Panorama type. Currently, the spherical panorama and cylindrical panorama are supported. |
Return
| Type | Description |
|---|---|
PendingResult<PanoramaInterface. ImageInfoResult> | Obtains the PendingResult object encapsulated with ImageInfoResult. The PendingResult object provides methods for obtaining results synchronously and asynchronously. |
| 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
| 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. |
type | Panorama type. Currently, the spherical panorama and cylindrical panorama are supported. |
Return
| Type | Description |
|---|---|
PendingResult<PanoramaInterface.ImageInfoResult> | Obtains the PendingResult object encapsulated with ImageInfoResult. The PendingResult object provides methods for obtaining results synchronously and asynchronously. |
| Method |
|---|
PanoramaInterface.PanoramaLocalInterface getLocalInstance(Context context) Obtains the instance for calling the local API. |
Parameters
| Parameter | Description |
|---|---|
| context | APP context. To actively trigger an upgrade, pass an Activityobject. |
Return
| Type | Description |
|---|---|
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. |
Field |
|---|
| int IMAGE_TYPE_SPHERICAL Spherical panorama. |
| Field |
|---|
| int IMAGE_TYPE_RING Cylindrical panorama. |
| Field |
|---|
| int CONTROL_TYPE_TOUCH Touch control. |
| Field |
|---|
| int CONTROL_TYPE_POSE Motion tracking control. |
| Field |
|---|
| int CONTROL_TYPE_MIX Allows for touch control and motion control simultaneously. |
| Field | ||||
|---|---|---|---|---|
| String KEY_RENDER_MODE Rendering mode. This constant can be successfully set only after the panorama is correctly set. | ||||
| Field | ||||
|---|---|---|---|---|
| String VALUE_RENDER_MODE_NORMAL Default rendering mode. | ||||
| Field | ||||
|---|---|---|---|---|
| String VALUE_RENDER_MODE_POLAR Rendering in polar coordinates. This mode supports only the panorama of the IMAGE_TYPE_SPHERICAL type. | ||||
| Field | ||||
|---|---|---|---|---|
| String KEY_CURRENT_AZIMUTH Current azimuth. | ||||
| Field | ||||
|---|---|---|---|---|
| String KEY_CURRENT_HORIZONTAL_FOV Current horizontal field of view (FOV). | ||||
Field |
| String KEY_IMAGE_TYPE Image type. Two options are available: IMAGE_TYPE_SPHERICAL (spherical) and IMAGE_TYPE_RING (cylindrical/ring). |
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. |