public class NativeInterface
extends java.lang.Object
ARToolKit
class rather than called directly.Modifier and Type | Field and Description |
---|---|
static int |
ARW_MARKER_OPTION_FILTER_CUTOFF_FREQ |
static int |
ARW_MARKER_OPTION_FILTER_SAMPLE_RATE |
static int |
ARW_MARKER_OPTION_FILTERED |
static int |
ARW_MARKER_OPTION_SQUARE_CONFIDENCE |
static int |
ARW_MARKER_OPTION_SQUARE_CONFIDENCE_CUTOFF |
static int |
ARW_MARKER_OPTION_SQUARE_USE_CONT_POSE_ESTIMATION |
Constructor and Description |
---|
NativeInterface() |
Modifier and Type | Method and Description |
---|---|
static boolean |
arwAcceptVideoImage(byte[] image,
int width,
int height,
int cameraIndex,
boolean cameraIsFrontFacing)
Passes a video frame to the native library for processing.
|
static boolean |
arwAcceptVideoImageStereo(byte[] imageL,
int widthL,
int heightL,
int cameraIndexL,
boolean cameraIsFrontFacingL,
byte[] imageR,
int widthR,
int heightR,
int cameraIndexR,
boolean cameraIsFrontFacingR)
Passes a video frame for the right camera of a stereo camera pair to the native library for processing.
|
static int |
arwAddMarker(java.lang.String cfg)
Adds a marker to be detected.
|
static boolean |
arwCapture()
Checks if a new video frame is available.
|
static boolean |
arwChangeToResourcesDir(java.lang.String resourcesDirectoryPath)
Changes the working directory to the resources directory used by ARToolKit.
|
static java.lang.String |
arwGetARToolKitVersion()
Gets the version of the underlying ARToolKit library.
|
static boolean |
arwGetMarkerOptionBool(int markerUID,
int option) |
static float |
arwGetMarkerOptionFloat(int markerUID,
int option) |
static int |
arwGetMarkerOptionInt(int markerUID,
int option) |
static float[] |
arwGetProjectionMatrix()
Retrieves the ARToolKit projection matrix.
|
static boolean |
arwGetProjectionMatrixStereo(float[] projL,
float[] projR)
Retrieves the ARToolKit projection matrix for the right camera of a stereo camera pair.
|
static boolean |
arwGetVideoDebugMode()
Returns whether debug mode is enabled.
|
static boolean |
arwGetVideoParams(int[] width,
int[] height,
int[] pixelSize,
java.lang.String[] pixelFormatStringBuffer)
Returns the parameters of the video source frame.
|
static boolean |
arwGetVideoParamsStereo(int[] widthL,
int[] heightL,
int[] pixelSizeL,
java.lang.String[] pixelFormatStringL,
int[] widthR,
int[] heightR,
int[] pixelSizeR,
java.lang.String[] pixelFormatString)
Returns the parameters of the video source frames.
|
static int |
arwGetVideoThreshold()
Returns the current threshold value used during video image binarization.
|
static boolean |
arwInitialiseAR()
Initialises the basic ARToolKit functions.
|
static boolean |
arwIsRunning()
Queries whether marker detection is up and running.
|
static float[] |
arwQueryMarkerTransformation(int markerUID)
Retrieves the transformation matrix for the specified marker
|
static boolean |
arwQueryMarkerTransformationStereo(int markerUID,
float[] matrixL,
float[] matrixR)
Retrieves the transformation matrix for the specified marker
|
static boolean |
arwQueryMarkerVisibility(int markerUID)
Queries whether the specified marker is currently visible.
|
static int |
arwRemoveAllMarkers()
Removes all loaded markers.
|
static boolean |
arwRemoveMarker(int markerUID)
Removes the specified marker.
|
static void |
arwSetMarkerOptionBool(int markerUID,
int option,
boolean value) |
static void |
arwSetMarkerOptionFloat(int markerUID,
int option,
float value) |
static void |
arwSetMarkerOptionInt(int markerUID,
int option,
int value) |
static void |
arwSetVideoDebugMode(boolean debug)
Sets whether to enable or disable debug mode.
|
static void |
arwSetVideoThreshold(int threshold)
Sets the threshold value used during video image binarization.
|
static boolean |
arwShutdownAR()
Shuts down the basic ARToolKit functions.
|
static boolean |
arwStartRunning(java.lang.String vconf,
java.lang.String cparaName,
float nearPlane,
float farPlane)
Initialises video capture.
|
static boolean |
arwStartRunningStereo(java.lang.String vconfL,
java.lang.String cparaNameL,
java.lang.String vconfR,
java.lang.String cparaNameR,
java.lang.String transL2RName,
float nearPlane,
float farPlane)
Initialises stereo video capture.
|
static boolean |
arwStopRunning()
Stops marker detection and closes the video source.
|
static boolean |
arwUpdateAR()
Performs an update, runs marker detection if in the running state.
|
static boolean |
arwUpdateDebugTexture(byte[] image,
boolean flipY) |
static boolean |
loadNativeLibrary()
Attempts to load the native library so that native functions can be called.
|
public static final int ARW_MARKER_OPTION_FILTERED
public static final int ARW_MARKER_OPTION_FILTER_SAMPLE_RATE
public static final int ARW_MARKER_OPTION_FILTER_CUTOFF_FREQ
public static final int ARW_MARKER_OPTION_SQUARE_USE_CONT_POSE_ESTIMATION
public static final int ARW_MARKER_OPTION_SQUARE_CONFIDENCE
public static final int ARW_MARKER_OPTION_SQUARE_CONFIDENCE_CUTOFF
public static boolean loadNativeLibrary()
public static java.lang.String arwGetARToolKitVersion()
public static boolean arwInitialiseAR()
public static boolean arwChangeToResourcesDir(java.lang.String resourcesDirectoryPath)
arwInitialiseAR()
public static boolean arwStartRunning(java.lang.String vconf, java.lang.String cparaName, float nearPlane, float farPlane)
vconf
- The video configuration string. Can be left empty.cparaName
- The camera parameter file to load.nearPlane
- The value to use for the near OpenGL clipping plane.farPlane
- The value to use for the far OpenGL clipping plane.public static boolean arwStartRunningStereo(java.lang.String vconfL, java.lang.String cparaNameL, java.lang.String vconfR, java.lang.String cparaNameR, java.lang.String transL2RName, float nearPlane, float farPlane)
vconfL
- The video configuration string for the left camera. Can be left empty.cparaNameL
- The camera parameter file to load for the left camera.vconfR
- The video configuration string for the right camera. Can be left empty.cparaNameR
- The camera parameter file to load for the right camera.transL2RName
- The stereo calibration file to load.nearPlane
- The value to use for the near OpenGL clipping plane.farPlane
- The value to use for the far OpenGL clipping plane.public static boolean arwIsRunning()
public static boolean arwStopRunning()
public static boolean arwShutdownAR()
public static float[] arwGetProjectionMatrix()
public static boolean arwGetProjectionMatrixStereo(float[] projL, float[] projR)
public static boolean arwGetVideoParams(int[] width, int[] height, int[] pixelSize, java.lang.String[] pixelFormatStringBuffer)
arwGetVideoParamsStereo
public static boolean arwGetVideoParamsStereo(int[] widthL, int[] heightL, int[] pixelSizeL, java.lang.String[] pixelFormatStringL, int[] widthR, int[] heightR, int[] pixelSizeR, java.lang.String[] pixelFormatString)
arwGetVideoParams
public static boolean arwCapture()
public static boolean arwUpdateAR()
public static int arwAddMarker(java.lang.String cfg)
cfg
- Marker configuration stringpublic static boolean arwRemoveMarker(int markerUID)
markerUID
- The unique identifier (UID) of the marker to removepublic static int arwRemoveAllMarkers()
public static boolean arwQueryMarkerVisibility(int markerUID)
markerUID
- The unique identifier (UID) of the marker to checkpublic static float[] arwQueryMarkerTransformation(int markerUID)
markerUID
- The unique identifier (UID) of the marker to checkpublic static boolean arwQueryMarkerTransformationStereo(int markerUID, float[] matrixL, float[] matrixR)
markerUID
- The unique identifier (UID) of the marker to checkmatrixL
- A float array containing the OpenGL compatible transformation matrix for the left camera.matrixR
- A float array containing the OpenGL compatible transformation matrix for the right camera.public static void arwSetMarkerOptionBool(int markerUID, int option, boolean value)
public static void arwSetMarkerOptionInt(int markerUID, int option, int value)
public static void arwSetMarkerOptionFloat(int markerUID, int option, float value)
public static boolean arwGetMarkerOptionBool(int markerUID, int option)
public static int arwGetMarkerOptionInt(int markerUID, int option)
public static float arwGetMarkerOptionFloat(int markerUID, int option)
public static void arwSetVideoDebugMode(boolean debug)
debug
- true to enable, false to disablepublic static boolean arwGetVideoDebugMode()
public static void arwSetVideoThreshold(int threshold)
threshold
- The new threshold valuepublic static int arwGetVideoThreshold()
public static boolean arwAcceptVideoImage(byte[] image, int width, int height, int cameraIndex, boolean cameraIsFrontFacing)
image
- Buffer containing the video framewidth
- Width of the video frame in pixelsheight
- Height of the video frame in pixelscameraIndex
- Zero-based index of the camera in use. If only one camera is present, will be 0.cameraIsFrontFacing
- false if camera is rear-facing (the default) or true if camera is facing toward the user.public static boolean arwAcceptVideoImageStereo(byte[] imageL, int widthL, int heightL, int cameraIndexL, boolean cameraIsFrontFacingL, byte[] imageR, int widthR, int heightR, int cameraIndexR, boolean cameraIsFrontFacingR)
imageL
- Buffer containing the video framewidthL
- Width of the video frame in pixelsheightL
- Height of the video frame in pixelscameraIndexL
- Zero-based index of the camera in use. If only one camera is present, will be 0.cameraIsFrontFacingL
- false if camera is rear-facing (the default) or true if camera is facing toward the user.imageR
- Buffer containing the video framewidthR
- Width of the video frame in pixelsheightR
- Height of the video frame in pixelscameraIndexR
- Zero-based index of the camera in use. If only one camera is present, will be 0.cameraIsFrontFacingR
- false if camera is rear-facing (the default) or true if camera is facing toward the user.public static boolean arwUpdateDebugTexture(byte[] image, boolean flipY)