Skip to content

Commit 9778286

Browse files
ARCore Android SDK v1.9.0
1 parent 5b67d88 commit 9778286

File tree

30 files changed

+13300
-8359
lines changed

30 files changed

+13300
-8359
lines changed

LICENSE

Lines changed: 13070 additions & 152 deletions
Large diffs are not rendered by default.

NOTICE

Lines changed: 0 additions & 8135 deletions
This file was deleted.

libraries/include/arcore_c_api.h

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ typedef struct ArImageMetadata_ ArImageMetadata;
310310
/// Release with ArImage_release().
311311
typedef struct ArImage_ ArImage;
312312

313+
/// Convenient definition for cubemap image storage where it is a fixed size
314+
/// array of 6 ArImage.
315+
typedef ArImage *ArImageCubemap[6];
316+
313317
/// Forward declaring the AImage struct from Android NDK, which is used
314318
/// in ArImage_getNdkImage().
315319
typedef struct AImage AImage;
@@ -901,6 +905,18 @@ AR_DEFINE_ENUM(ArAugmentedFaceMode){
901905
AR_AUGMENTED_FACE_MODE_MESH3D = 2,
902906
};
903907

908+
/// @ingroup augmented_image
909+
/// Defines the current tracking mode for an Augmented Image. To retrieve the
910+
/// tracking mode for an image use #ArAugmentedImage_getTrackingMethod().
911+
AR_DEFINE_ENUM(ArAugmentedImageTrackingMethod){
912+
// The Augmented Image is not currently being tracked.
913+
AR_AUGMENTED_IMAGE_TRACKING_METHOD_NOT_TRACKING = 0,
914+
// The Augmented Image is currently being tracked using the camera image.
915+
AR_AUGMENTED_IMAGE_TRACKING_METHOD_FULL_TRACKING = 1,
916+
// The Augmented Image is currently being tracked based on its last known
917+
// pose, because it can no longer be tracked using the camera image.
918+
AR_AUGMENTED_IMAGE_TRACKING_METHOD_LAST_KNOWN_POSE = 2};
919+
904920
/// @ingroup augmented_face
905921
/// Defines face regions to query the pose for. Left and right are defined
906922
/// relative to the person that the mesh belongs to. To retrieve the center pose
@@ -1026,12 +1042,11 @@ extern "C" {
10261042
/// May be called prior to ArSession_create().
10271043
///
10281044
/// @param[in] env The application's @c JNIEnv object
1029-
/// @param[in] application_context A @c jobject referencing the application's
1030-
/// Android @c Context.
1045+
/// @param[in] context A @c jobject for an Android @c Context.
10311046
/// @param[out] out_availability A pointer to an ArAvailability to receive
10321047
/// the result.
10331048
void ArCoreApk_checkAvailability(void *env,
1034-
void *application_context,
1049+
void *context,
10351050
ArAvailability *out_availability);
10361051

10371052
/// Initiates installation of ARCore if needed. When your apllication launches
@@ -1144,8 +1159,7 @@ ArStatus ArCoreApk_requestInstallCustom(void *env,
11441159
/// ARCore will require an app restart and might cause Android to kill your app.
11451160
///
11461161
/// @param[in] env The application's @c JNIEnv object
1147-
/// @param[in] application_context A @c jobject referencing the application's
1148-
/// Android @c Context
1162+
/// @param[in] context A @c jobject for an Android @c Context
11491163
/// @param[out] out_session_pointer A pointer to an @c ArSession* to receive
11501164
/// the address of the newly allocated session.
11511165
/// @return #AR_SUCCESS or any of:
@@ -1166,7 +1180,7 @@ ArStatus ArCoreApk_requestInstallCustom(void *env,
11661180
/// - #AR_UNAVAILABLE_SDK_TOO_OLD if the ARCore SDK that this app was built with
11671181
/// is too old and no longer supported by the installed ARCore APK.
11681182
ArStatus ArSession_create(void *env,
1169-
void *application_context,
1183+
void *context,
11701184
ArSession **out_session_pointer);
11711185

11721186
/// Creates a new ARCore session requesting additional features. Prior to
@@ -1183,8 +1197,7 @@ ArStatus ArSession_create(void *env,
11831197
/// ARCore will require an app restart and might cause Android to kill your app.
11841198
///
11851199
/// @param[in] env The application's @c JNIEnv object
1186-
/// @param[in] application_context A @c jobject referencing the application's
1187-
/// Android @c Context
1200+
/// @param[in] context A @c jobject for an Android @c Context
11881201
/// @param[in] features The list of requested features, terminated
11891202
/// by with #AR_SESSION_FEATURE_END_OF_LIST.
11901203
/// @param[out] out_session_pointer A pointer to an @c ArSession* to receive
@@ -1209,7 +1222,7 @@ ArStatus ArSession_create(void *env,
12091222
/// - #AR_UNAVAILABLE_SDK_TOO_OLD if the ARCore SDK that this app was built with
12101223
/// is too old and no longer supported by the installed ARCore APK.
12111224
ArStatus ArSession_createWithFeatures(void *env,
1212-
void *application_context,
1225+
void *context,
12131226
const ArSessionFeature *features,
12141227
ArSession **out_session_pointer);
12151228

@@ -1441,7 +1454,6 @@ ArStatus ArSession_checkSupported(const ArSession *session,
14411454
AR_DEPRECATED(
14421455
"deprecated in release 1.2.0. Please see function documentation");
14431456

1444-
// TODO(b/122918249): Document here that MESH3D works only on FRONT_CAMERA
14451457
/// Configures the session with the given config.
14461458
/// Note: a session is always initially configured with the default config.
14471459
/// This should be called if a configuration different than default is needed.
@@ -1648,26 +1660,39 @@ ArStatus ArSession_resolveAndAcquireNewCloudAnchor(ArSession *session,
16481660
const char *cloud_anchor_id,
16491661
ArAnchor **out_cloud_anchor);
16501662

1651-
/// Enumerates the list of supported camera configs on the device.
1652-
/// Can be called at any time. The supported camera configs will be filled in
1653-
/// the provided list after clearing it.
1663+
/// Gets a list of camera configs supported by the camera being used by the
1664+
/// session.
1665+
///
1666+
/// Can be called at any time. The provided list populated with the camera
1667+
/// configs supported by the configured session and camera.
1668+
///
1669+
/// Each config will contain a different CPU resolution. The GPU texture
1670+
/// resolutions will be the same in all configs. Most devices provide a GPU
1671+
/// texture resolution of 1920 x 1080, but the actual resolution will vary with
1672+
/// device capabilities.
16541673
///
1655-
/// The list will always return 3 camera configs. The GPU texture resolutions
1656-
/// are the same in all three configs. Currently, most devices provide GPU
1657-
/// texture resolution of 1920 x 1080 but this may vary with device
1658-
/// capabilities. The CPU image resolutions returned are VGA, a middle
1659-
/// resolution, and a large resolution matching the GPU texture. The middle
1660-
/// resolution will often be 1280 x 720, but may vary with device capabilities.
1674+
/// When the session camera is a back-facing camera:
1675+
/// - The list will always contain three camera configs.
1676+
/// - The CPU image resolutions returned will be VGA, a middle resolution, and a
1677+
/// large resolution matching the GPU texture resolution. The middle
1678+
/// resolution is typically 1280 x 720, but the actual resolution will vary
1679+
/// with device capabilities.
16611680
///
1662-
/// Note: Prior to ARCore 1.6 the middle CPU image resolution was guaranteed to
1663-
/// be 1280 x 720 on all devices.
1681+
/// When the session camera is front-facing (selfie) camera, the list will
1682+
/// contain at least one supported camera config.
1683+
///
1684+
/// Notes:
1685+
/// - Prior to ARCore SDK 1.6, the middle CPU image resolution was guaranteed to
1686+
/// be 1280 x 720 on all devices.
1687+
/// - In ARCore SDK 1.7 and 1.8, when the session camera was a front-facing
1688+
/// (selfie) camera, the list contained three identical camera configs.
16641689
///
16651690
/// @param[in] session The ARCore session
16661691
/// @param[inout] list The list to fill. This list must have already
16671692
/// been allocated with ArCameraConfigList_create(). The list is cleared
16681693
/// to remove any existing elements. Once it is no longer needed, the list
1669-
/// must be destroyed using ArCameraConfigList_destroy to release allocated
1670-
/// memory.
1694+
/// must be destroyed using ArCameraConfigList_destroy() to release
1695+
/// allocated memory.
16711696
void ArSession_getSupportedCameraConfigs(const ArSession *session,
16721697
ArCameraConfigList *list);
16731698

@@ -2722,6 +2747,12 @@ void ArAugmentedImage_acquireName(const ArSession *session,
27222747
const ArAugmentedImage *augmented_image,
27232748
char **out_augmented_image_name);
27242749

2750+
/// Returns the current method being used to track this Augmented Image.
2751+
void ArAugmentedImage_getTrackingMethod(
2752+
const ArSession *session,
2753+
const ArAugmentedImage *image,
2754+
ArAugmentedImageTrackingMethod *out_tracking_method);
2755+
27252756
/// @}
27262757

27272758
// === ArAugmentedFace methods ===

samples/augmented_image_c/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ android {
5151

5252
dependencies {
5353
// ARCore library
54-
implementation 'com.google.ar:core:1.8.0'
55-
natives 'com.google.ar:core:1.8.0'
54+
implementation 'com.google.ar:core:1.9.0'
55+
natives 'com.google.ar:core:1.9.0'
5656

5757
implementation 'com.android.support:appcompat-v7:27.1.1'
5858
implementation 'com.android.support:design:27.1.1'
373 KB
Loading

samples/augmented_image_c/app/src/main/cpp/augmented_image_application.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,6 @@ void AugmentedImageApplication::OnDrawFrame(void* activity) {
226226

227227
background_renderer_.Draw(ar_session_, ar_frame_);
228228

229-
// If the camera isn't tracking don't bother rendering other objects.
230-
if (camera_tracking_state != AR_TRACKING_STATE_TRACKING) {
231-
return;
232-
}
233-
234229
// Get light estimation value.
235230
ArLightEstimate* ar_light_estimate;
236231
ArLightEstimateState ar_light_estimate_state;

samples/augmented_image_c/app/src/main/java/com/google/ar/core/examples/c/augmentedimage/AugmentedImageActivity.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@
3131
import javax.microedition.khronos.egl.EGLConfig;
3232
import javax.microedition.khronos.opengles.GL10;
3333

34-
/** This is a simple example that shows how to use ARCore AugmentedImage C API. */
34+
/**
35+
* This is a simple example that shows how to use ARCore AugmentedImage C API.
36+
*
37+
* <p>In this example, we assume all images are static or moving slowly with a large occupation of
38+
* the screen. If the target is actively moving, we recommend to check
39+
* ArAugmentedImage_getTrackingMethod() and render only when the tracking method equals to
40+
* AR_AUGMENTED_IMAGE_TRACKING_METHOD_FULL_TRACKING. See details in <a
41+
* href="https://developers.google.com/ar/develop/c/augmented-images/">Recognize and Augment
42+
* Images</a>.
43+
*/
3544
public class AugmentedImageActivity extends AppCompatActivity
3645
implements GLSurfaceView.Renderer, DisplayManager.DisplayListener {
3746
private static final String TAG = AugmentedImageActivity.class.getSimpleName();

samples/augmented_image_c/app/src/main/java/com/google/ar/core/examples/c/augmentedimage/JniInterface.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/*
2+
* Copyright 2019 Google Inc. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
115
package com.google.ar.core.examples.c.augmentedimage;
216

317
import android.app.Activity;

samples/augmented_image_java/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android {
2525

2626
dependencies {
2727
// ARCore library
28-
implementation 'com.google.ar:core:1.8.0'
28+
implementation 'com.google.ar:core:1.9.0'
2929

3030
// Obj - a simple Wavefront OBJ file loader
3131
// https://github.com/javagl/Obj
373 KB
Loading

0 commit comments

Comments
 (0)