public class ARX_jni
extends java.lang.Object
ARController class rather than called directly.| Constructor and Description |
|---|
ARX_jni() |
| Modifier and Type | Method and Description |
|---|---|
static int |
arwAddTrackable(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 artoolkitX.
|
static boolean |
arwDrawVideo(int videoSourceIndex)
Draws the latest frame from the video source in the active graphics context.
|
static boolean |
arwDrawVideoFinal(int videoSourceIndex)
Finalise drawing of video frames in a graphics context.
|
static boolean |
arwDrawVideoInit(int videoSourceIndex)
Initialise drawing of video frames in a graphics context.
|
static boolean |
arwDrawVideoSettings(int videoSourceIndex,
int width,
int height,
boolean rotate90,
boolean flipH,
boolean flipV,
int hAlign,
int vAlign,
int scalingMode,
int[] viewport)
Specify the layout of the graphics context in which drawing of video frames will occur.
|
static java.lang.String |
arwGetARToolKitVersion()
Gets the version of the underlying artoolkitX library.
|
static float[] |
arwGetProjectionMatrix(float nearPlane,
float farPlane)
Retrieves the artoolkitX projection matrix.
|
static boolean |
arwGetProjectionMatrixStereo(float nearPlane,
float farPlane,
float[] projL,
float[] projR)
Retrieves the artoolkitX projection matrix for the cameras of a stereo camera pair.
|
static boolean |
arwGetTrackableOptionBool(int trackableUID,
int option) |
static float |
arwGetTrackableOptionFloat(int trackableUID,
int option) |
static int |
arwGetTrackableOptionInt(int trackableUID,
int option) |
static boolean |
arwGetTrackerOptionBool(int option) |
static float |
arwGetTrackerOptionFloat(int option) |
static int |
arwGetTrackerOptionInt(int option) |
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[] pixelFormatStringR)
Returns the parameters of the video source frames.
|
static boolean |
arwInitialiseAR()
Initialises the basic artoolkitX functions.
|
static boolean |
arwIsInited()
Queries whether artoolkitX is initialized.
|
static boolean |
arwIsRunning()
Queries whether tracking is up and running.
|
static boolean |
arwQueryTrackableVisibilityAndTransformation(int trackableUID,
float[] matrix)
Returns the visibility and pose of the specified marker.
|
static boolean |
arwQueryTrackableVisibilityAndTransformationStereo(int trackableUID,
float[] matrixL,
float[] matrixR)
Returns the visibility and stereo pose of the specified marker.
|
static int |
arwRemoveAllTrackables()
Removes all loaded markers.
|
static boolean |
arwRemoveTrackable(int trackableUID)
Removes the specified marker.
|
static void |
arwSetLogLevel(int logLevel)
Sets the severity level.
|
static void |
arwSetTrackableOptionBool(int trackableUID,
int option,
boolean value) |
static void |
arwSetTrackableOptionFloat(int trackableUID,
int option,
float value) |
static void |
arwSetTrackableOptionInt(int trackableUID,
int option,
int value) |
static void |
arwSetTrackerOptionBool(int option,
boolean value) |
static void |
arwSetTrackerOptionFloat(int option,
float value) |
static void |
arwSetTrackerOptionInt(int option,
int value) |
static boolean |
arwShutdownAR()
Shuts down the basic artoolkitX functions.
|
static boolean |
arwStartRunning(java.lang.String vconf,
java.lang.String cparaName)
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)
Initialises stereo video capture.
|
static boolean |
arwStopRunning()
Stops tracking and closes the video source.
|
static boolean |
arwUpdateAR()
Performs an update, runs tracking if in the running state.
|
static boolean |
arwUpdateTexture32(byte[] image) |
static boolean |
arwUpdateTextureStereo32(byte[] imageL,
byte[] imageR) |
static int |
arwVideoPush(int videoSourceIndex,
java.nio.ByteBuffer buf0,
int buf0PixelStride,
int buf0RowStride,
java.nio.ByteBuffer buf1,
int buf1PixelStride,
int buf1RowStride,
java.nio.ByteBuffer buf2,
int buf2PixelStride,
int buf2RowStride,
java.nio.ByteBuffer buf3,
int buf3PixelStride,
int buf3RowStride)
Pushes a video frame to the native library.
|
static int |
arwVideoPushFinal(int videoSourceIndex)
Tells the native library that no further frames will be pushed.
|
static int |
arwVideoPushInit(int videoSourceIndex,
int width,
int height,
java.lang.String pixelFormat,
int camera_index,
int camera_face)
Tells the native library the source and size and format in which video frames will be pushed.
|
public static final int AR_LOG_LEVEL_DEBUG
public static final int AR_LOG_LEVEL_INFO
public static final int AR_LOG_LEVEL_WARN
public static final int AR_LOG_LEVEL_ERROR
public static final int AR_LOG_LEVEL_REL_INFO
public static final int ARW_H_ALIGN_LEFT
public static final int ARW_H_ALIGN_CENTRE
public static final int ARW_H_ALIGN_RIGHT
public static final int ARW_V_ALIGN_TOP
public static final int ARW_V_ALIGN_CENTRE
public static final int ARW_V_ALIGN_BOTTOM
public static final int ARW_SCALE_MODE_FIT
public static final int ARW_SCALE_MODE_FILL
public static final int ARW_SCALE_MODE_STRETCH
public static final int ARW_SCALE_MODE_1_TO_1
public static final int ARW_TRACKER_OPTION_NFT_MULTIMODE
public static final int ARW_TRACKER_OPTION_SQUARE_THRESHOLD
public static final int ARW_TRACKER_OPTION_SQUARE_THRESHOLD_MODE
public static final int ARW_TRACKER_OPTION_SQUARE_LABELING_MODE
public static final int ARW_TRACKER_OPTION_SQUARE_PATTERN_DETECTION_MODE
public static final int ARW_TRACKER_OPTION_SQUARE_BORDER_SIZE
public static final int ARW_TRACKER_OPTION_SQUARE_MATRIX_CODE_TYPE
public static final int ARW_TRACKER_OPTION_SQUARE_IMAGE_PROC_MODE
public static final int ARW_TRACKER_OPTION_SQUARE_DEBUG_MODE
public static final int ARW_TRACKER_OPTION_SQUARE_PATTERN_SIZE
public static final int ARW_TRACKER_OPTION_SQUARE_PATTERN_COUNT_MAX
public static final int AR_LABELING_THRESH_MODE_MANUAL
public static final int AR_LABELING_THRESH_MODE_AUTO_MEDIAN
public static final int AR_LABELING_THRESH_MODE_AUTO_OTSU
public static final int AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE
public static final int AR_LABELING_THRESH_MODE_AUTO_BRACKETING
public static final int AR_LABELING_WHITE_REGION
public static final int AR_LABELING_BLACK_REGION
public static final int AR_TEMPLATE_MATCHING_COLOR
public static final int AR_TEMPLATE_MATCHING_MONO
public static final int AR_MATRIX_CODE_DETECTION
public static final int AR_TEMPLATE_MATCHING_COLOR_AND_MATRIX
public static final int AR_TEMPLATE_MATCHING_MONO_AND_MATRIX
public static final int AR_MATRIX_CODE_3x3
public static final int AR_MATRIX_CODE_3x3_PARITY65
public static final int AR_MATRIX_CODE_3x3_HAMMING63
public static final int AR_MATRIX_CODE_4x4
public static final int AR_MATRIX_CODE_4x4_BCH_13_9_3
public static final int AR_MATRIX_CODE_4x4_BCH_13_5_5
public static final int AR_MATRIX_CODE_5x5_BCH_22_12_5
public static final int AR_MATRIX_CODE_5x5_BCH_22_7_7
public static final int AR_MATRIX_CODE_5x5
public static final int AR_MATRIX_CODE_6x6
public static final int AR_MATRIX_CODE_GLOBAL_ID
public static final int AR_IMAGE_PROC_FRAME_IMAGE
public static final int AR_IMAGE_PROC_FIELD_IMAGE
public static final int ARW_TRACKABLE_OPTION_FILTERED
public static final int ARW_TRACKABLE_OPTION_FILTER_SAMPLE_RATE
public static final int ARW_TRACKABLE_OPTION_FILTER_CUTOFF_FREQ
public static final int ARW_TRACKABLE_OPTION_SQUARE_USE_CONT_POSE_ESTIMATION
public static final int ARW_TRACKABLE_OPTION_SQUARE_CONFIDENCE
public static final int ARW_TRACKABLE_OPTION_SQUARE_CONFIDENCE_CUTOFF
public static final int ARW_TRACKABLE_OPTION_NFT_SCALE
public static final int ARW_TRACKABLE_OPTION_MULTI_MIN_SUBMARKERS
public static final int ARW_TRACKABLE_OPTION_MULTI_MIN_CONF_MATRIX
public static final int ARW_TRACKABLE_OPTION_MULTI_MIN_CONF_PATTERN
public static final int AR_PIXEL_FORMAT_INVALID
public static final int AR_PIXEL_FORMAT_RGB
public static final int AR_PIXEL_FORMAT_BGR
public static final int AR_PIXEL_FORMAT_RGBA
public static final int AR_PIXEL_FORMAT_BGRA
public static final int AR_PIXEL_FORMAT_ABGR
public static final int AR_PIXEL_FORMAT_MONO
public static final int AR_PIXEL_FORMAT_ARGB
public static final int AR_PIXEL_FORMAT_2vuy
public static final int AR_PIXEL_FORMAT_yuvs
public static final int AR_PIXEL_FORMAT_RGB_565
public static final int AR_PIXEL_FORMAT_RGBA_5551
public static final int AR_PIXEL_FORMAT_RGBA_4444
public static final int AR_PIXEL_FORMAT_420v
public static final int AR_PIXEL_FORMAT_420f
public static final int AR_PIXEL_FORMAT_NV21
public static java.lang.String arwGetARToolKitVersion()
public static void arwSetLogLevel(int logLevel)
logLevel - The log level below which log messages should be ignored.public static boolean arwInitialiseAR()
#arwShutdownAR()}public static boolean arwChangeToResourcesDir(java.lang.String resourcesDirectoryPath)
#arwInitialiseAR()}public static boolean arwStartRunning(java.lang.String vconf,
java.lang.String cparaName)
vconf - The video configuration string. Can be left empty.cparaName - Either: null to search for camera parameters specific to the device,
or a path (in the filesystem) to a camera parameter file. The path may be an
absolute path, or relative to the resourcesDirectoryPath set with arwChangeToResourcesDir.public static boolean arwStartRunningStereo(java.lang.String vconfL,
java.lang.String cparaNameL,
java.lang.String vconfR,
java.lang.String cparaNameR,
java.lang.String transL2RName)
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.public static boolean arwIsInited()
arwInitialiseAR(). At
this point #arwStartRunning(String, String, float, float) can be called.public static boolean arwIsRunning()
public static boolean arwStopRunning()
public static boolean arwShutdownAR()
public static float[] arwGetProjectionMatrix(float nearPlane,
float farPlane)
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 arwGetProjectionMatrixStereo(float nearPlane,
float farPlane,
float[] projL,
float[] projR)
nearPlane - The value to use for the near OpenGL clipping plane.farPlane - The value to use for the far OpenGL clipping plane.projL - A float array, which will be filled with the OpenGL compatible projection matrix for the left camera.projR - An float array, which will be filled with the OpenGL compatible projection matrix for the right camera.public static boolean arwGetVideoParams(int[] width,
int[] height,
int[] pixelSize,
java.lang.String[] pixelFormatStringBuffer)
width - An int array, the first element of which will be filled with the width (in pixels) of the video frame, or null if this information is not required.height - An int array, the first element of which will be filled with the height (in pixels) of the video frame, or null if this information is not required.pixelSize - An int array, the first element of which will be filled with the numbers of bytes per pixel of the source frame, or null if this information is not required.pixelFormatStringBuffer - A String array, the first element of which will be filled with the symbolic name of the pixel format of the video frame, or null if this information is not required. The name will be of the form "AR_PIXEL_FORMAT_xxx".#arwGetVideoParamsStereo}public static boolean arwGetVideoParamsStereo(int[] widthL,
int[] heightL,
int[] pixelSizeL,
java.lang.String[] pixelFormatStringL,
int[] widthR,
int[] heightR,
int[] pixelSizeR,
java.lang.String[] pixelFormatStringR)
widthL - An int array, the first element of which will be filled with the width (in pixels) of the video frame, or null if this information is not required.widthR - An int array, the first element of which will be filled with the width (in pixels) of the video frame, or null if this information is not required.heightL - An int array, the first element of which will be filled with the height (in pixels) of the video frame, or null if this information is not required.heightR - An int array, the first element of which will be filled with the height (in pixels) of the video frame, or null if this information is not required.pixelSizeL - An int array, the first element of which will be filled with the numbers of bytes per pixel of the source frame, or null if this information is not required.pixelSizeR - An int array, the first element of which will be filled with the numbers of bytes per pixel of the source frame, or null if this information is not required.pixelFormatStringL - A String array, the first element of which will be filled with the symbolic name of the pixel format of the video frame, or null if this information is not required. The name will be of the form "AR_PIXEL_FORMAT_xxx".pixelFormatStringR - A String array, the first element of which will be filled with the symbolic name of the pixel format of the video frame, or null if this information is not required. The name will be of the form "AR_PIXEL_FORMAT_xxx".#arwGetVideoParams(int[], int[], int[], String[])}public static boolean arwCapture()
public static boolean arwUpdateAR()
public static boolean arwUpdateTexture32(byte[] image)
public static boolean arwUpdateTextureStereo32(byte[] imageL,
byte[] imageR)
public static boolean arwDrawVideoInit(int videoSourceIndex)
videoSourceIndex - The 0-based index of the video source which
will supply frames for drawing. Normally 0, but for the second camera in a stereo pair, 1.#arwIsRunning()},
#arwDrawVideoFinal(int)}public static boolean arwDrawVideoSettings(int videoSourceIndex,
int width,
int height,
boolean rotate90,
boolean flipH,
boolean flipV,
int hAlign,
int vAlign,
int scalingMode,
int[] viewport)
videoSourceIndex - The 0-based index of the video source which
is supplying frames for drawing. Normally 0, but for the second camera in a stereo pair, 1.width - The width in pixels of the graphics context.height - The height in pixels of the graphics context.rotate90 - If true, content should be rendered in the graphics
context rotated 90-degrees.flipH - If true, content should be rendered in the graphics
context mirrored (flipped) in the horizontal dimension.flipV - If true, content should be rendered in the graphics
context mirrored (flipped) in the vertical dimension.hAlign - An enum ARW_H_ALIGN_* specifying the desired horizontal
alignment of video frames in the graphics context.
If unsure, pass ARW_H_ALIGN_CENTRE.vAlign - An enum ARW_V_ALIGN_* specifying the desired vertical
alignment of video frames in the graphics context.
If unsure, pass ARW_V_ALIGN_CENTRE.scalingMode - An enum ARW_SCALE_MODE_* specifying the desired
scaling of the video frames to the graphics context.
If unsure, pass ARW_SCALE_MODE_FIT.viewport - If non-null, must be an array of 4 32-bit signed
integers, in which the calculated OpenGL-style viewport parameters will
be returned. The order of the parameters is: x-coordinate of the left
edge of the viewport (may be negative), the y-coordinate of the bottom
edge of the viewport (may be negative), the width of the viewport in the
x-axis in pixels, and the height of the viewport in the y-axis in pixels.#arwIsRunning},
#arwDrawVideoInit},
#arwDrawVideoFinal}public static boolean arwDrawVideo(int videoSourceIndex)
videoSourceIndex - The 0-based index of the video source which
is supplying frames for drawing.#arwIsRunning},
#arwDrawVideoInit},
#arwDrawVideoFinal},
#arwDrawVideoSettings}public static boolean arwDrawVideoFinal(int videoSourceIndex)
videoSourceIndex - The 0-based index of the video source which
supplied frames for drawing.#arwDrawVideoInit(int)}public static int arwAddTrackable(java.lang.String cfg)
cfg - Marker configuration stringpublic static boolean arwRemoveTrackable(int trackableUID)
trackableUID - The unique identifier (UID) of the trackable to removepublic static int arwRemoveAllTrackables()
public static boolean arwQueryTrackableVisibilityAndTransformation(int trackableUID,
float[] matrix)
trackableUID - The unique identifier (UID) of the trackable to checkmatrix - A float array to populate with an OpenGL-compatible transformation matrix.public static boolean arwQueryTrackableVisibilityAndTransformationStereo(int trackableUID,
float[] matrixL,
float[] matrixR)
trackableUID - The unique identifier (UID) of the trackable to checkmatrixL - A float array to populate with an OpenGL-compatible transformation matrix for the left camera.matrixR - A float array to populate with an OpenGL-compatible transformation matrix for the right camera.public static void arwSetTrackerOptionBool(int option,
boolean value)
public static void arwSetTrackerOptionInt(int option,
int value)
public static void arwSetTrackerOptionFloat(int option,
float value)
public static boolean arwGetTrackerOptionBool(int option)
public static int arwGetTrackerOptionInt(int option)
public static float arwGetTrackerOptionFloat(int option)
public static void arwSetTrackableOptionBool(int trackableUID,
int option,
boolean value)
public static void arwSetTrackableOptionInt(int trackableUID,
int option,
int value)
public static void arwSetTrackableOptionFloat(int trackableUID,
int option,
float value)
public static boolean arwGetTrackableOptionBool(int trackableUID,
int option)
public static int arwGetTrackableOptionInt(int trackableUID,
int option)
public static float arwGetTrackableOptionFloat(int trackableUID,
int option)
public static int arwVideoPushInit(int videoSourceIndex,
int width,
int height,
java.lang.String pixelFormat,
int camera_index,
int camera_face)
videoSourceIndex - Zero-based index of the video source which is being initialized for pushing. Normally 0, but for the second camera in a stereo pair, 1.width - Width of the video frame in pixels.height - Height of the video frame in pixels.pixelFormat - string with format in which buffers will be pushed. Supported values include "NV21", "NV12", "YUV_420_888", "RGBA", "RGB_565", and "MONO".camera_index - Zero-based index into the devices's list of cameras. If only one camera is present on the device, will be 0.camera_face - 0 if camera is rear-facing (the default) or 1 if camera is facing toward the user.public static int arwVideoPush(int videoSourceIndex,
java.nio.ByteBuffer buf0,
int buf0PixelStride,
int buf0RowStride,
java.nio.ByteBuffer buf1,
int buf1PixelStride,
int buf1RowStride,
java.nio.ByteBuffer buf2,
int buf2PixelStride,
int buf2RowStride,
java.nio.ByteBuffer buf3,
int buf3PixelStride,
int buf3RowStride)
videoSourceIndex - Zero-based index of the video source which is being pushed. Normally 0, but for the second camera in a stereo pair, 1.buf0 - For interleaved formats (e.g. RGBA), reference to a byte buffer holding the frame data. For interleaved formats this will be the only plane. For planar formats, reference to a byte buffer holding plane 0 of the frame. For planar NV21 and YUV_420_888 formats, this will be the luma plane.buf0PixelStride - The number of bytes between pixels in adjacent columns in buf0buf0RowStride - The number of bytes between pixels in adjacent rows in buf0buf1 - For planar formats consisting of 2 or more planes, reference to a byte buffer holding plane 1 of the frame. For planar NV21 image format, this will be the chroma plane. For planar YUV_420_888 format, this will be the Cb chroma plane.buf1PixelStride - The number of bytes between pixels in adjacent columns in buf1buf1RowStride - The number of bytes between pixels in adjacent rows in buf1buf2 - For planar formats consisting 3 or more planes, reference to a byte buffer holding plane 2 of the frame. For planar YUV_420_888 format, this will be the Cr chroma plane.buf2PixelStride - The number of bytes between pixels in adjacent columns in buf2buf2RowStride - The number of bytes between pixels in adjacent rows in buf2buf3 - For planar formats consisting of 4 planes, reference to a byte buffer holding plane 3 of the frame.buf3PixelStride - The number of bytes between pixels in adjacent columns in buf3buf3RowStride - The number of bytes between pixels in adjacent rows in buf3public static int arwVideoPushFinal(int videoSourceIndex)
videoSourceIndex - Zero-based index of the video source which is being finalized for pushing. Normally 0, but for the second camera in a stereo pair, 1.