KudanAR - Android
ARImageTrackable Class Reference

Public Member Functions

 ARImageTrackable ()
 
 ARImageTrackable (int nativeMem)
 
 ARImageTrackable (String name)
 
void loadFromPath (String path)
 
void loadFromPath (String path, boolean autoCrop)
 
void loadFromAsset (String asset)
 
void loadFromAsset (String asset, boolean autoCrop)
 
void finalize ()
 
ARWorld getWorld ()
 
void setName (String name)
 
String getName ()
 
boolean getDetected ()
 
void trackerStartFrame ()
 
float getWidth ()
 
float getHeight ()
 
void trackerEndFrame ()
 
void trackerSetDetected (boolean detected)
 
List< ARImageTrackableListenergetListeners ()
 
void addListener (ARImageTrackableListener listener)
 
boolean isFlowRecoverable (boolean globalSetting)
 
void setExtensible (boolean extensible)
 
boolean isExtensible ()
 
boolean isExtended ()
 
void clearExtensions ()
 

Detailed Description

The ARImageTrackable class represents an image that can be tracked. The ARImageTrackerManager will automatically update properties. Attach content to the world property to have it rendered on the trackable. An ARImageTrackable needs to be added to the ARImageTracker to be detected.

Constructor & Destructor Documentation

ARImageTrackable ( )
inline

Initialise an empty ARImageTrackable with values to be set later.

ARImageTrackable ( int  nativeMem)
inline

Initialise an ARImageTrackable with a pointer to its native object.

Parameters
nativeMem
ARImageTrackable ( String  name)
inline

Initialises an ARImageTrackable and assigns it the given name. Trackable names should be unique.

Parameters
nameThe name to give this trackable.

Member Function Documentation

void addListener ( ARImageTrackableListener  listener)
inline

Adds ARTrackableListener to ARImageTrackable

Parameters
listener
void clearExtensions ( )
inline

For extended markers: clear all current extensions (they can be re-created after this, if extended tracking has not been disabled).

void finalize ( )
inline

Clears native memory pointer.

boolean getDetected ( )
inline

Gets whether or not this trackable is currently being detected by the Image Tracker. This value is automatically set by the tracker.

Returns
True if this trackable is currently being detected, false if not.
float getHeight ( )
inline

Gets the height of the trackable. This can be arbitrary but is used to determine the scale of the coordinate system that is attached to this node.

Returns
The scene height of this trackable.
List<ARImageTrackableListener> getListeners ( )
inline

Gets a list of trackable listeners on the ARImageTrackable.

Example of use:

List<ARImageTrackableListener> trackableListeners = imageTrackable.getListeners();
Returns
The list of trackable listeners.
String getName ( )
inline

Gets the name of the trackable.

Returns
The name of this trackable.
float getWidth ( )
inline

Gets the width of the trackable. This can be arbitrary but is used to determine the scale of the coordinate system that is attached to this node.

Returns
The scene width of this trackable.
ARWorld getWorld ( )
inline

Gets the image trackable's world node, the transformation of which is automatically updated by the tracker to represent the trackable's pose in the camera image. Content attached here will be rendered whilst the trackable is being detected.

Returns
The image trackable's world.
boolean isExtended ( )
inline

Get whether any extensions have been made of this trackable, or if this trackable is itself an extension.

Returns
Whether this one trackable has extensions (true) or not (false).
boolean isExtensible ( )
inline

Get whether this trackable uses Extended Tracking and Detection.

Returns
Whether extensibility is enabled (true) or not (false) on this trackable.
boolean isFlowRecoverable ( boolean  globalSetting)
inline

For an individual trackable, query whether it is able to use recovery mode (needs to know the global setting). This function should not be called: use queryRecoveryMode(trackable) on ARImageTracker.

Parameters
globalSettingWhether recovery mode is on or not in general.
Returns
Whether recovery mode is used (true) or not (false) for this one trackable.
void loadFromAsset ( String  asset)
inline

Load an image file into the ARImageTrackable from a packaged image file.

Example of use:

imageTrackable.loadFromAsset("example.jpg");
Parameters
assetThe path to the bundled image file relative to the app package, including file extension.
void loadFromAsset ( String  asset,
boolean  autoCrop 
)
inline

Load an image file into the ARImageTrackable from a packaged image file and set whether or not Automatic Cropping should be used.

Example of use:

imageTrackable.loadFromAsset("example.jpg", true);
Parameters
assetThe path to the bundled image file relative to the app package, including file extension.
autoCropWhether to use the Automatic Cropping feature. True if yes, false if no.
void loadFromPath ( String  path)
inline

Load an image file into the ARImageTrackable from a full file path. Images loaded with this method will not use the Automatic Cropping feature.

Example of use:

imageTrackable.loadFromPath("/mnt/sdcard/images/example.jpg");
Parameters
pathThe full path to the file, including all folders and file extension.
void loadFromPath ( String  path,
boolean  autoCrop 
)
inline

Load an image file into the ARImageTrackable from a full file path and set whether or not Automatic Cropping should be used. Autocropping is a feature that automatically finds the most useful sub-region of a trackable image, and uses that for tracking and detection. This allows images containing large borders to be used without sacrificing tracking resolution. Cropping is automatic and makes no difference to how the trackable objects are used the tracked region will never look cropped. This must be enabled for individual markers when they are created from images.

Example of use:

imageTrackable.loadFromPath("/mnt/sdcard/images/example.jpg", true);
Parameters
pathThe full path to the file, including all folders and file extension.
autoCropWhether to use the Automatic Cropping feature. True if yes, false if no.
void setExtensible ( boolean  extensible)
inline

Set whether or not this trackable uses Extended Tracking and Detection. Extended Tracking and Detection is a feature where trackables can be extended by automatically creating new markers from the surrounding scene. This means that after being expanded, trackables can be detected and tracked from much further away. This can be activated on a per-trackable basis and should ideally only be used for stationary markers, such as posters. Extended Tracking is good for tracking small objects at large distances when moving away from the marker. Extended Tracking is not designed for use with markers that are not stationary. Enabling this feature will require slightly more memory space.

Example of use:

imageTrackable.setExtensible(true);
Parameters
extensibleWhether or not this marker should use Extended Tracking and Detection. Setting this to false will prevent any more extensions being made (but not clear existing ones).
void setName ( String  name)
inline

Sets the name of the trackable. This needs to be unique, otherwise the tracker will not be able to find it. If initialised from a trackable image file then this is read in automatically.

Example of use:

imageTrackable.setName("example");
Parameters
nameThe name to assign to this trackable.
void trackerEndFrame ( )
inline

Updates trackable listeners with trackable event information.

void trackerSetDetected ( boolean  detected)
inline

Sets trackable state.

Parameters
detectedWhether the trackable has been detected.
void trackerStartFrame ( )
inline

Sets detection state to be detected.


The documentation for this class was generated from the following file: