14. API Reference
This section provides detailed description of ARGear classes.
ARGSession class stores statuses of an application and provides corresponding functions based on the statuses.
Method | Description |
ARGSession(Context context, ARGConfig config) | Create ARGSession according to ARGConfig. |
ARGSession(Context context, ARGConfig config, Set<ARGInferenceConfig.Feature> inference) | Create ARGSession according to ARGConfig and ARGInferenceConfig.Feature. |
auth | Return ARGAuth object. |
contents | Return ARGContents object. |
setCameraConfig | Set camera configuration information. |
applyAdditionalFaceInfo | Send additional information for face detection. |
feedRawData | Update Preview Frame data from camera. |
feedTextureId | Feed texture ID of camera |
drawFrame | Render fed frames from camera along with ARGear contents. |
resume | Start or resume ARGSession. |
pause | Pause ARGSession. |
destroy | Destroy ARGSession. |
setFeatureInference | Set or update ARGInferenceConfig.Feature. |
setDebugInference | Enable or disable ARGInferenceConfig.Debug. |
public ARGSession(Context context, ARGConfig config) |
Create ARGSession according to ARGConfig. ARGConfig contains configuration information for ARGSession and must be provided to create ARGSession. Corresponding information must be set to the variables below. - public String apiUrl; - public String apiKey; - public String secretKey; - public String authKey;
Parameters
Returns
|
public ARGSession(Context context, ARGConfig config, Set<ARGInferenceConfig.Feature> inference) |
Use ARGConfig and ARGInferenceConfig.Feature to create ARGSession. ARGConfig contains configuration information for ARGSession and must be provided to create ARGSession. Corresponding information must be set to the variables below. public String apiUrl; public String apiKey; public String secretKey; public String authKey; ARGInferenceConfig.Feature is a required parameter and can be obtained from ARGFrame. Types of feature inferences are declared as follows. public enum Feature { FACE_LOW_TRACKING, // Machine Learning based TRACKING FACE_HIGH_TRACKING, // Deep Learning based TRACKING (Low polygon) FACE_MESH_TRACKING, // Deep Learning based TRACKING (High polygon) // FACE_BLEND_SHAPES, SEGMENTATION_HALF, // SEGMENTATION_FULL, // HAND_TRACKING, // HAND_LANDMARK_2D, // HAND_LANDMARK_3D, // BODY_TRACKING, // BODY_POSE_2D, // BODY_POSE_3D }
Parameters
Returns
|
public ARGAuth auth() |
Return An Instance of ARGAuth. (Reference : 12.2 ARGAuth)
Returns
|
public ARGContents contents() |
Return An Instance of ARGContents (Reference : 12.6 ARGContents)
Returns
|
public void setCameraConfig(ARGCameraConfig config) |
Set Camera Configuration Information. ARGCameraConfig declares variables as written below. public int previewWidth; public int previewHeight; public float verticalFov; public float horizontalFov; public int orientation; public boolean isFrontFacing; public float fps;
Parameters
|
public void applyAdditionalFaceInfo(List faceVerticesList, List poseMatrixList, float [] projectionMatrix, float [] viewMatrix |
Send additional information for face detection. Parameters
|
public void feedRawData(byte[] data) |
For Camera API 1 Update Preview Frame Data from Camera Device.
Parameters
|
public void feedRawData(Image data) |
For Camera API 2 Update Preview Frame Data from Camera Device.
Parameters
|
public void feedTexture(int textureId, Size textureSize) |
Feed texture ID of a camera
Parameters
|
public ARGFrame drawFrame(GL10 gl, ARGFrame.Ratio ratio, int viewWidth, int viewHeight) |
Render fed frames from camera along with ARGear contents. The function must be called in gl thread environment. Possible screen ratios are described below. public enum Ratio { RATIO_FULL(3), RATIO_4_3(2), RATIO_1_1(1);
public final int code; Ratio(int code) { this.code = code; } }
Parameters
|
public void resume() |
Start or Resume ARGSession. |
public void pause() |
Pause ARGSession. |
public void destroy() |
Destroy ARGSession. |
public void setFeatureInference(Set<ARGInferenceConfig.Feature> config) |
Set or update ARGInferenceConfig.Feature. From ARGFrame, configured information can be retrieved. Types of feature inferences are declared as follows. public enum Feature { FACE_LOW_TRACKING, // Machine Learning based TRACKING FACE_HIGH_TRACKING, // Deep Learning based TRACKING (Low polygon) // FACE_MESH_TRACKING, // Deep Learning based TRACKING (High polygon) // FACE_BLEND_SHAPES, SEGMENTATION_HALF, // SEGMENTATION_FULL, // HAND_TRACKING, // HAND_LANDMARK_2D, // HAND_LANDMARK_3D, // BODY_TRACKING, // BODY_POSE_2D, // BODY_POSE_3D }
Parameters
|
public void setDebugInference(Set<ARGInferenceConfig.Debug> config) |
Enable or Disable ARGInferenceConfig.Debug. Types of feature inferences are declared as below. public enum Debug { NONE(0), FACE_RECT_HW(1 << 0), FACE_RECT_SW(1 << 3), FACE_LANDMARK(1 << 4), FACE_LANDMARK_EXTEND(1 << 5), FACE_AXIES(1 << 6);
public final int code; Debug(int code) { this.code = code; } }
Parameters
|
ARGAuth provides validity check and signed download URL creation functions.
Method | Description |
isValid | Check whether Authentication is valid. |
requestSignedUrl | Convert download URL into signed download URL. |
public boolean isValid() |
Return boolean value to check whether Authentication is valid or not. If Authentication is invalid, ARGear will not work.
Returns
|
public void requestSignedUrl(final String url, final String itemTitle, final String itemType, final ARGAuth.Callback callback) |
Convert download url into signed download url. After signed url request is sent, the result can be obtained by running ARGAuth.Callback function. ARGAuth.Callback is defined as below. public interface Callback { void onSuccess(String url); void onError(Throwable e); } When ARGAuth.Callback succeeds, it passes signed download url to OnSuccess method as its parameter. When it does not, it passes SignedUrlGenerationException or NetworkException to OnError method as its parameters.
Parameters
|
ARGFrame contains both the fed frames from the camera and the rendered ARGear Contents. ARGFrame can be obtained as a result of calling the drawFrame function in ARGSession.
Method | Description |
getTextureId | Return rendered texture id from ARGear. |
getRawData | Return rendered result from ARGear in byte array type. |
getItemTriggerFlag | Return trigger flag value of ARGear Contents in ARGear. |
getFaces | Return the list of ARGFace objects. |
segmentation | Return ARGSegmentation object. |
public int getTextureId() |
Return rendered texture id in ARGear.
Returns
|