ImageTarget Class¶
Inherits: Target
Description¶
ImageTarget represents planar image targets that can be tracked by ImageTracker .
The fields of ImageTarget need to be filled with the create… method before it can be read. And ImageTarget can be tracked by ImageTracker after a successful load into the ImageTracker using ImageTracker.loadTarget .
Constructor¶
- C
void easyar_ImageTarget__ctor(easyar_ImageTarget * * Return)
- C++
ImageTarget()
- Java
public ImageTarget()
- Kotlin
constructor()
- Objective-C
+ (easyar_ImageTarget *) create
- Swift
public convenience init()
- C#
public ImageTarget()
createFromParameters¶
Creates a target from parameters.
- C
void easyar_ImageTarget_createFromParameters(easyar_ImageTargetParameters * parameters, easyar_OptionalOfImageTarget * Return)
- C++
static std::optional<std::shared_ptr<ImageTarget>> createFromParameters(std::shared_ptr<ImageTargetParameters> parameters)
- Java
public static @Nullable ImageTarget createFromParameters(@Nonnull ImageTargetParameters parameters)
- Kotlin
companion object fun createFromParameters(parameters: ImageTargetParameters): ImageTarget?
- Objective-C
+ (easyar_ImageTarget *)createFromParameters:(easyar_ImageTargetParameters *)parameters
- Swift
public static func createFromParameters(_ parameters: ImageTargetParameters) -> ImageTarget?
- C#
public static Optional<ImageTarget> createFromParameters(ImageTargetParameters parameters)
createFromTargetFile¶
Creates a target from an etd file.
- C
void easyar_ImageTarget_createFromTargetFile(easyar_String * path, easyar_StorageType storageType, easyar_OptionalOfImageTarget * Return)
- C++
static std::optional<std::shared_ptr<ImageTarget>> createFromTargetFile(std::string path, StorageType storageType)
- Java
public static @Nullable ImageTarget createFromTargetFile(java.lang.@Nonnull String path, int storageType)
- Kotlin
companion object fun createFromTargetFile(path: String, storageType: Int): ImageTarget?
- Objective-C
+ (easyar_ImageTarget *)createFromTargetFile:(NSString *)path storageType:(easyar_StorageType)storageType
- Swift
public static func createFromTargetFile(_ path: String, _ storageType: StorageType) -> ImageTarget?
- C#
public static Optional<ImageTarget> createFromTargetFile(string path, StorageType storageType)
createFromTargetData¶
Creates a target from an etd data buffer.
- C
void easyar_ImageTarget_createFromTargetData(easyar_Buffer * buffer, easyar_OptionalOfImageTarget * Return)
- C++
static std::optional<std::shared_ptr<ImageTarget>> createFromTargetData(std::shared_ptr<Buffer> buffer)
- Java
public static @Nullable ImageTarget createFromTargetData(@Nonnull Buffer buffer)
- Kotlin
companion object fun createFromTargetData(buffer: Buffer): ImageTarget?
- Objective-C
+ (easyar_ImageTarget *)createFromTargetData:(easyar_Buffer *)buffer
- Swift
public static func createFromTargetData(_ buffer: Buffer) -> ImageTarget?
- C#
public static Optional<ImageTarget> createFromTargetData(Buffer buffer)
save¶
Saves as an etd file.
- C
bool easyar_ImageTarget_save(easyar_ImageTarget * This, easyar_String * path)
- C++
bool save(std::string path)
- Java
public boolean save(java.lang.@Nonnull String path)
- Kotlin
fun save(path: String): Boolean
- Objective-C
- (bool)save:(NSString *)path
- Swift
public func save(_ path: String) -> Bool
- C#
public virtual bool save(string path)
createFromImageFile¶
Creates a target from an image file. If not needed, name, uid, meta can be passed with empty string, and scale can be passed with default value 1. Jpeg and png files are supported.
- C
void easyar_ImageTarget_createFromImageFile(easyar_String * path, easyar_StorageType storageType, easyar_String * name, easyar_String * uid, easyar_String * meta, float scale, easyar_OptionalOfImageTarget * Return)
- C++
static std::optional<std::shared_ptr<ImageTarget>> createFromImageFile(std::string path, StorageType storageType, std::string name, std::string uid, std::string meta, float scale)
- Java
public static @Nullable ImageTarget createFromImageFile(java.lang.@Nonnull String path, int storageType, java.lang.@Nonnull String name, java.lang.@Nonnull String uid, java.lang.@Nonnull String meta, float scale)
- Kotlin
companion object fun createFromImageFile(path: String, storageType: Int, name: String, uid: String, meta: String, scale: Float): ImageTarget?
- Objective-C
+ (easyar_ImageTarget *)createFromImageFile:(NSString *)path storageType:(easyar_StorageType)storageType name:(NSString *)name uid:(NSString *)uid meta:(NSString *)meta scale:(float)scale
- Swift
public static func createFromImageFile(_ path: String, _ storageType: StorageType, _ name: String, _ uid: String, _ meta: String, _ scale: Float) -> ImageTarget?
- C#
public static Optional<ImageTarget> createFromImageFile(string path, StorageType storageType, string name, string uid, string meta, float scale)
scale¶
The scale of image. The value is the physical image width divided by 1 meter. The default value is 1.
- C
float easyar_ImageTarget_scale(const easyar_ImageTarget * This)
- C++
float scale()
- Java
public float scale()
- Kotlin
fun scale(): Float
- Objective-C
- (float)scale
- Swift
public func scale() -> Float
- C#
public virtual float scale()
aspectRatio¶
The aspect ratio of image, width divided by height.
- C
float easyar_ImageTarget_aspectRatio(const easyar_ImageTarget * This)
- C++
float aspectRatio()
- Java
public float aspectRatio()
- Kotlin
fun aspectRatio(): Float
- Objective-C
- (float)aspectRatio
- Swift
public func aspectRatio() -> Float
- C#
public virtual float aspectRatio()
setScale¶
Sets image target scale, this will overwrite the value set in the json file or the default value. The value is the physical image width divided by 1 meter. The default value is 1.
It is needed to set the model scale in rendering engine separately.
- C
bool easyar_ImageTarget_setScale(easyar_ImageTarget * This, float scale)
- C++
bool setScale(float scale)
- Java
public boolean setScale(float scale)
- Kotlin
fun setScale(scale: Float): Boolean
- Objective-C
- (bool)setScale:(float)scale
- Swift
public func setScale(_ scale: Float) -> Bool
- C#
public virtual bool setScale(float scale)
images¶
Returns a list of images that stored in the target. It is generally used to get image data from cloud returned target.
- C
void easyar_ImageTarget_images(easyar_ImageTarget * This, easyar_ListOfImage * * Return)
- C++
std::vector<std::shared_ptr<Image>> images()
- Java
public java.util.@Nonnull ArrayList<@Nonnull Image> images()
- Kotlin
fun images(): ArrayList<Image>
- Objective-C
- (NSArray<easyar_Image *> *)images
- Swift
public func images() -> [Image]
- C#
public virtual List<Image> images()
runtimeID¶
Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally.
- C
int easyar_ImageTarget_runtimeID(const easyar_ImageTarget * This)
- C++
int runtimeID()
- Java
public int runtimeID()
- Kotlin
fun runtimeID(): Int
- Objective-C
- (int)runtimeID
- Swift
public override func runtimeID() -> Int32
- C#
public override int runtimeID()
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_ImageTarget_uid(const easyar_ImageTarget * This, easyar_String * * Return)
- C++
std::string uid()
- Java
public java.lang.@Nonnull String uid()
- Kotlin
fun uid(): String
- Objective-C
- (NSString *)uid
- Swift
public override func uid() -> String
- C#
public override string uid()
name¶
Returns the target name. Name is used to distinguish targets in a json file.
- C
void easyar_ImageTarget_name(const easyar_ImageTarget * This, easyar_String * * Return)
- C++
std::string name()
- Java
public java.lang.@Nonnull String name()
- Kotlin
fun name(): String
- Objective-C
- (NSString *)name
- Swift
public override func name() -> String
- C#
public override string name()
setName¶
Set name. It will erase previously set data or data from cloud.
- C
void easyar_ImageTarget_setName(easyar_ImageTarget * This, easyar_String * name)
- C++
void setName(std::string name)
- Java
public void setName(java.lang.@Nonnull String name)
- Kotlin
fun setName(name: String): Unit
- Objective-C
- (void)setName:(NSString *)name
- Swift
public override func setName(_ name: String) -> Void
- C#
public override void setName(string name)
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_ImageTarget_meta(const easyar_ImageTarget * This, easyar_String * * Return)
- C++
std::string meta()
- Java
public java.lang.@Nonnull String meta()
- Kotlin
fun meta(): String
- Objective-C
- (NSString *)meta
- Swift
public override func meta() -> String
- C#
public override string meta()
setMeta¶
Set meta data. It will erase previously set data or data from cloud.
- C
void easyar_ImageTarget_setMeta(easyar_ImageTarget * This, easyar_String * data)
- C++
void setMeta(std::string data)
- Java
public void setMeta(java.lang.@Nonnull String data)
- Kotlin
fun setMeta(data: String): Unit
- Objective-C
- (void)setMeta:(NSString *)data
- Swift
public override func setMeta(_ data: String) -> Void
- C#
public override void setMeta(string data)