Target Class

Description

Target is the base class for all targets that can be tracked by ImageTracker or other algorithms inside EasyAR.

runtimeID

Returns the target id. A target id is a int number generated at runtime. This id is non-zero and increasing globally.

C: int easyar_Target_runtimeID(const easyar_Target * This)
C++11: int runtimeID()
Traditional C++: int runtimeID()
Java: public native int runtimeID()
Objective-C: - (int)runtimeID
Swift (since EasyAR SDK 2.1.0): public func runtimeID() -> Int32

uid

Returns the target uid. A target uid is useful in cloud based algorithms. If no cloud is used, you can set this uid in the json config as a alternative method to distinguish from targets.

C: void easyar_Target_uid(const easyar_Target * This, easyar_String * * Return)
C++11: std::string uid()
Traditional C++: void uid(String * * Return)
Java: public native java.lang.String uid()
Objective-C: - (NSString *)uid
Swift (since EasyAR SDK 2.1.0): public func uid() -> String

name

Returns the target name. Name is used to distinguish targets in a json file.

C: void easyar_Target_name(const easyar_Target * This, easyar_String * * Return)
C++11: std::string name()
Traditional C++: void name(String * * Return)
Java: public native java.lang.String name()
Objective-C: - (NSString *)name
Swift (since EasyAR SDK 2.1.0): public func name() -> String

meta

Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server.

C: void easyar_Target_meta(const easyar_Target * This, easyar_String * * Return)
C++11: std::string meta()
Traditional C++: void meta(String * * Return)
Java: public native java.lang.String meta()
Objective-C: - (NSString *)meta
Swift (since EasyAR SDK 2.1.0): public func meta() -> String

setMeta

Set meta data. It will erase previously set data or data from cloud.

C: void easyar_Target_setMeta(easyar_Target * This, easyar_String * data)
C++11: void setMeta(std::string data)
Traditional C++: void setMeta(String * data)
Java: public native void setMeta(java.lang.String data)
Objective-C: - (void)setMeta:(NSString *)data
Swift (since EasyAR SDK 2.1.0): public func setMeta(_ data: String) -> Void