//============================================================================================================================= // // EasyAR Sense 3.1.0-final-7bf6504c6 // Copyright (c) 2015-2020 VisionStar Information Technology (Shanghai) Co., Ltd. All Rights Reserved. // EasyAR is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China // and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd. // //============================================================================================================================= #import "easyar/types.oc.h" #import "easyar/target.oc.h" /// /// ImageTargetParameters represents the parameters to create a `ImageTarget`_ . /// @interface easyar_ImageTargetParameters : easyar_RefBase + (instancetype)new NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE; + (easyar_ImageTargetParameters *) create; /// /// Gets image. /// - (easyar_Image *)image; /// /// Sets image. /// - (void)setImage:(easyar_Image *)image; /// /// Gets target name. It can be used to distinguish targets. /// - (NSString *)name; /// /// Sets target name. /// - (void)setName:(NSString *)name; /// /// Gets 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 an alternative method to distinguish from targets. /// - (NSString *)uid; /// /// Sets target uid. /// - (void)setUid:(NSString *)uid; /// /// Gets meta data. /// - (NSString *)meta; /// /// Sets meta data。 /// - (void)setMeta:(NSString *)meta; /// /// Gets the scale of image. The value is the physical image width divided by 1 meter. The default value is 1. /// - (float)scale; /// /// Sets the scale of image. 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. /// - (void)setScale:(float)scale; @end /// /// ImageTarget represents planar image targets that can be tracked by `ImageTracker`_ . /// The fields of ImageTarget need to be filled with the create.../setupAll method before it can be read. And ImageTarget can be tracked by `ImageTracker`_ after a successful load into the `ImageTracker`_ using `ImageTracker.loadTarget`_ . /// @interface easyar_ImageTarget : easyar_Target + (instancetype)new NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE; + (easyar_ImageTarget *) create; /// /// Creates a target from parameters. /// + (easyar_ImageTarget *)createFromParameters:(easyar_ImageTargetParameters *)parameters; /// /// Creates a target from an etd file. /// + (easyar_ImageTarget *)createFromTargetFile:(NSString *)path storageType:(easyar_StorageType)storageType; /// /// Creates a target from an etd data buffer. /// + (easyar_ImageTarget *)createFromTargetData:(easyar_Buffer *)buffer; /// /// Saves as an etd file. /// - (bool)save:(NSString *)path; /// /// 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. /// + (easyar_ImageTarget *)createFromImageFile:(NSString *)path storageType:(easyar_StorageType)storageType name:(NSString *)name uid:(NSString *)uid meta:(NSString *)meta scale:(float)scale; /// /// Setup all targets listed in the json file or json string from path with storageType. This method only parses the json file or string. /// If path is json file path, storageType should be `App` or `Assets` or `Absolute` indicating the path type. Paths inside json files should be absolute path or relative path to the json file. /// See `StorageType`_ for more descriptions. /// + (NSArray *)setupAll:(NSString *)path storageType:(easyar_StorageType)storageType; /// /// The scale of image. The value is the physical image width divided by 1 meter. The default value is 1. /// - (float)scale; /// /// The aspect ratio of image, width divided by height. /// - (float)aspectRatio; /// /// 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. /// - (bool)setScale:(float)scale; /// /// Returns a list of images that stored in the target. It is generally used to get image data from cloud returned target. /// - (NSArray *)images; /// /// Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally. /// - (int)runtimeID; /// /// 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. /// - (NSString *)uid; /// /// Returns the target name. Name is used to distinguish targets in a json file. /// - (NSString *)name; /// /// Set name. It will erase previously set data or data from cloud. /// - (void)setName:(NSString *)name; /// /// Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server. /// - (NSString *)meta; /// /// Set meta data. It will erase previously set data or data from cloud. /// - (void)setMeta:(NSString *)data; @end