Commit 708d3dee authored by BlackAngle233's avatar BlackAngle233
Browse files

update final design

parent 1444629e
fileFormatVersion: 2
guid: 6acdb263679e918458edfb22ffb0dde9
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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.
//
//=============================================================================================================================
#ifndef __EASYAR_IMAGEHELPER_H__
#define __EASYAR_IMAGEHELPER_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/// <summary>
/// Decodes a JPEG or PNG file.
/// </summary>
void easyar_ImageHelper_decode(easyar_Buffer * buffer, /* OUT */ easyar_OptionalOfImage * Return);
#ifdef __cplusplus
}
#endif
#endif
fileFormatVersion: 2
guid: ccc7f65a040e3b84fb1bfeed0b122bba
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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.
//
//=============================================================================================================================
#ifndef __EASYAR_IMAGEHELPER_HXX__
#define __EASYAR_IMAGEHELPER_HXX__
#include "easyar/types.hxx"
namespace easyar {
/// <summary>
/// Image helper class.
/// </summary>
class ImageHelper
{
public:
/// <summary>
/// Decodes a JPEG or PNG file.
/// </summary>
static void decode(Buffer * buffer, /* OUT */ Image * * Return);
};
#ifndef __EASYAR_OPTIONALOFIMAGE__
#define __EASYAR_OPTIONALOFIMAGE__
struct OptionalOfImage
{
bool has_value;
Image * value;
};
static inline easyar_OptionalOfImage OptionalOfImage_to_c(Image * o);
#endif
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_IMAGEHELPER_HXX__
#define __IMPLEMENTATION_EASYAR_IMAGEHELPER_HXX__
#include "easyar/imagehelper.h"
#include "easyar/buffer.hxx"
#include "easyar/image.hxx"
namespace easyar {
inline void ImageHelper::decode(Buffer * arg0, /* OUT */ Image * * Return)
{
easyar_OptionalOfImage _return_value_ = {false, NULL};
easyar_ImageHelper_decode(arg0->get_cdata(), &_return_value_);
*Return = (_return_value_.has_value ? new Image(_return_value_.value) : NULL);
}
#ifndef __IMPLEMENTATION_EASYAR_OPTIONALOFIMAGE__
#define __IMPLEMENTATION_EASYAR_OPTIONALOFIMAGE__
static inline easyar_OptionalOfImage OptionalOfImage_to_c(Image * o)
{
if (o != NULL) {
easyar_OptionalOfImage _return_value_ = {true, o->get_cdata()};
return _return_value_;
} else {
easyar_OptionalOfImage _return_value_ = {false, NULL};
return _return_value_;
}
}
#endif
}
#endif
fileFormatVersion: 2
guid: 037878c9898293848a64ae9613de24ba
timeCreated: 1611716671
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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"
/// <summary>
/// Image helper class.
/// </summary>
@interface easyar_ImageHelper : NSObject
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Decodes a JPEG or PNG file.
/// </summary>
+ (easyar_Image *)decode:(easyar_Buffer *)buffer;
@end
fileFormatVersion: 2
guid: 3157bf4cef2552c4d8d70b3b4b216915
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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.
//
//=============================================================================================================================
#ifndef __EASYAR_IMAGETARGET_H__
#define __EASYAR_IMAGETARGET_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
void easyar_ImageTargetParameters__ctor(/* OUT */ easyar_ImageTargetParameters * * Return);
/// <summary>
/// Gets image.
/// </summary>
void easyar_ImageTargetParameters_image(easyar_ImageTargetParameters * This, /* OUT */ easyar_Image * * Return);
/// <summary>
/// Sets image.
/// </summary>
void easyar_ImageTargetParameters_setImage(easyar_ImageTargetParameters * This, easyar_Image * image);
/// <summary>
/// Gets target name. It can be used to distinguish targets.
/// </summary>
void easyar_ImageTargetParameters_name(easyar_ImageTargetParameters * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Sets target name.
/// </summary>
void easyar_ImageTargetParameters_setName(easyar_ImageTargetParameters * This, easyar_String * name);
/// <summary>
/// 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.
/// </summary>
void easyar_ImageTargetParameters_uid(easyar_ImageTargetParameters * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Sets target uid.
/// </summary>
void easyar_ImageTargetParameters_setUid(easyar_ImageTargetParameters * This, easyar_String * uid);
/// <summary>
/// Gets meta data.
/// </summary>
void easyar_ImageTargetParameters_meta(easyar_ImageTargetParameters * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Sets meta data。
/// </summary>
void easyar_ImageTargetParameters_setMeta(easyar_ImageTargetParameters * This, easyar_String * meta);
/// <summary>
/// Gets the scale of image. The value is the physical image width divided by 1 meter. The default value is 1.
/// </summary>
float easyar_ImageTargetParameters_scale(easyar_ImageTargetParameters * This);
/// <summary>
/// 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.
/// </summary>
void easyar_ImageTargetParameters_setScale(easyar_ImageTargetParameters * This, float scale);
void easyar_ImageTargetParameters__dtor(easyar_ImageTargetParameters * This);
void easyar_ImageTargetParameters__retain(const easyar_ImageTargetParameters * This, /* OUT */ easyar_ImageTargetParameters * * Return);
const char * easyar_ImageTargetParameters__typeName(const easyar_ImageTargetParameters * This);
void easyar_ImageTarget__ctor(/* OUT */ easyar_ImageTarget * * Return);
/// <summary>
/// Creates a target from parameters.
/// </summary>
void easyar_ImageTarget_createFromParameters(easyar_ImageTargetParameters * parameters, /* OUT */ easyar_OptionalOfImageTarget * Return);
/// <summary>
/// Creates a target from an etd file.
/// </summary>
void easyar_ImageTarget_createFromTargetFile(easyar_String * path, easyar_StorageType storageType, /* OUT */ easyar_OptionalOfImageTarget * Return);
/// <summary>
/// Creates a target from an etd data buffer.
/// </summary>
void easyar_ImageTarget_createFromTargetData(easyar_Buffer * buffer, /* OUT */ easyar_OptionalOfImageTarget * Return);
/// <summary>
/// Saves as an etd file.
/// </summary>
bool easyar_ImageTarget_save(easyar_ImageTarget * This, easyar_String * path);
/// <summary>
/// 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.
/// </summary>
void easyar_ImageTarget_createFromImageFile(easyar_String * path, easyar_StorageType storageType, easyar_String * name, easyar_String * uid, easyar_String * meta, float scale, /* OUT */ easyar_OptionalOfImageTarget * Return);
/// <summary>
/// The scale of image. The value is the physical image width divided by 1 meter. The default value is 1.
/// </summary>
float easyar_ImageTarget_scale(const easyar_ImageTarget * This);
/// <summary>
/// The aspect ratio of image, width divided by height.
/// </summary>
float easyar_ImageTarget_aspectRatio(const easyar_ImageTarget * This);
/// <summary>
/// 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.
/// </summary>
bool easyar_ImageTarget_setScale(easyar_ImageTarget * This, float scale);
/// <summary>
/// Returns a list of images that stored in the target. It is generally used to get image data from cloud returned target.
/// </summary>
void easyar_ImageTarget_images(easyar_ImageTarget * This, /* OUT */ easyar_ListOfImage * * Return);
/// <summary>
/// Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally.
/// </summary>
int easyar_ImageTarget_runtimeID(const easyar_ImageTarget * This);
/// <summary>
/// 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.
/// </summary>
void easyar_ImageTarget_uid(const easyar_ImageTarget * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Returns the target name. Name is used to distinguish targets in a json file.
/// </summary>
void easyar_ImageTarget_name(const easyar_ImageTarget * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Set name. It will erase previously set data or data from cloud.
/// </summary>
void easyar_ImageTarget_setName(easyar_ImageTarget * This, easyar_String * name);
/// <summary>
/// Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server.
/// </summary>
void easyar_ImageTarget_meta(const easyar_ImageTarget * This, /* OUT */ easyar_String * * Return);
/// <summary>
/// Set meta data. It will erase previously set data or data from cloud.
/// </summary>
void easyar_ImageTarget_setMeta(easyar_ImageTarget * This, easyar_String * data);
void easyar_ImageTarget__dtor(easyar_ImageTarget * This);
void easyar_ImageTarget__retain(const easyar_ImageTarget * This, /* OUT */ easyar_ImageTarget * * Return);
const char * easyar_ImageTarget__typeName(const easyar_ImageTarget * This);
void easyar_castImageTargetToTarget(const easyar_ImageTarget * This, /* OUT */ easyar_Target * * Return);
void easyar_tryCastTargetToImageTarget(const easyar_Target * This, /* OUT */ easyar_ImageTarget * * Return);
void easyar_ListOfImage__ctor(easyar_Image * const * begin, easyar_Image * const * end, /* OUT */ easyar_ListOfImage * * Return);
void easyar_ListOfImage__dtor(easyar_ListOfImage * This);
void easyar_ListOfImage_copy(const easyar_ListOfImage * This, /* OUT */ easyar_ListOfImage * * Return);
int easyar_ListOfImage_size(const easyar_ListOfImage * This);
easyar_Image * easyar_ListOfImage_at(const easyar_ListOfImage * This, int index);
#ifdef __cplusplus
}
#endif
#endif
fileFormatVersion: 2
guid: 9976b94e69e33f14b8564d97a549ff63
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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.
//
//=============================================================================================================================
#ifndef __EASYAR_IMAGETARGET_HXX__
#define __EASYAR_IMAGETARGET_HXX__
#include "easyar/types.hxx"
#include "easyar/target.hxx"
namespace easyar {
/// <summary>
/// ImageTargetParameters represents the parameters to create a `ImageTarget`_ .
/// </summary>
class ImageTargetParameters
{
protected:
easyar_ImageTargetParameters * cdata_ ;
void init_cdata(easyar_ImageTargetParameters * cdata);
virtual ImageTargetParameters & operator=(const ImageTargetParameters & data) { return *this; } //deleted
public:
ImageTargetParameters(easyar_ImageTargetParameters * cdata);
virtual ~ImageTargetParameters();
ImageTargetParameters(const ImageTargetParameters & data);
const easyar_ImageTargetParameters * get_cdata() const;
easyar_ImageTargetParameters * get_cdata();
ImageTargetParameters();
/// <summary>
/// Gets image.
/// </summary>
void image(/* OUT */ Image * * Return);
/// <summary>
/// Sets image.
/// </summary>
void setImage(Image * image);
/// <summary>
/// Gets target name. It can be used to distinguish targets.
/// </summary>
void name(/* OUT */ String * * Return);
/// <summary>
/// Sets target name.
/// </summary>
void setName(String * name);
/// <summary>
/// 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.
/// </summary>
void uid(/* OUT */ String * * Return);
/// <summary>
/// Sets target uid.
/// </summary>
void setUid(String * uid);
/// <summary>
/// Gets meta data.
/// </summary>
void meta(/* OUT */ String * * Return);
/// <summary>
/// Sets meta data。
/// </summary>
void setMeta(String * meta);
/// <summary>
/// Gets the scale of image. The value is the physical image width divided by 1 meter. The default value is 1.
/// </summary>
float scale();
/// <summary>
/// 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.
/// </summary>
void setScale(float scale);
};
/// <summary>
/// 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`_ .
/// </summary>
class ImageTarget : public Target
{
protected:
easyar_ImageTarget * cdata_ ;
void init_cdata(easyar_ImageTarget * cdata);
virtual ImageTarget & operator=(const ImageTarget & data) { return *this; } //deleted
public:
ImageTarget(easyar_ImageTarget * cdata);
virtual ~ImageTarget();
ImageTarget(const ImageTarget & data);
const easyar_ImageTarget * get_cdata() const;
easyar_ImageTarget * get_cdata();
ImageTarget();
/// <summary>
/// Creates a target from parameters.
/// </summary>
static void createFromParameters(ImageTargetParameters * parameters, /* OUT */ ImageTarget * * Return);
/// <summary>
/// Creates a target from an etd file.
/// </summary>
static void createFromTargetFile(String * path, StorageType storageType, /* OUT */ ImageTarget * * Return);
/// <summary>
/// Creates a target from an etd data buffer.
/// </summary>
static void createFromTargetData(Buffer * buffer, /* OUT */ ImageTarget * * Return);
/// <summary>
/// Saves as an etd file.
/// </summary>
bool save(String * path);
/// <summary>
/// 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.
/// </summary>
static void createFromImageFile(String * path, StorageType storageType, String * name, String * uid, String * meta, float scale, /* OUT */ ImageTarget * * Return);
/// <summary>
/// The scale of image. The value is the physical image width divided by 1 meter. The default value is 1.
/// </summary>
float scale();
/// <summary>
/// The aspect ratio of image, width divided by height.
/// </summary>
float aspectRatio();
/// <summary>
/// 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.
/// </summary>
bool setScale(float scale);
/// <summary>
/// Returns a list of images that stored in the target. It is generally used to get image data from cloud returned target.
/// </summary>
void images(/* OUT */ ListOfImage * * Return);
/// <summary>
/// Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally.
/// </summary>
int runtimeID();
/// <summary>
/// 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.
/// </summary>
void uid(/* OUT */ String * * Return);
/// <summary>
/// Returns the target name. Name is used to distinguish targets in a json file.
/// </summary>
void name(/* OUT */ String * * Return);
/// <summary>
/// Set name. It will erase previously set data or data from cloud.
/// </summary>
void setName(String * name);
/// <summary>
/// Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server.
/// </summary>
void meta(/* OUT */ String * * Return);
/// <summary>
/// Set meta data. It will erase previously set data or data from cloud.
/// </summary>
void setMeta(String * data);
static void tryCastFromTarget(Target * v, /* OUT */ ImageTarget * * Return);
};
#ifndef __EASYAR_OPTIONALOFIMAGETARGET__
#define __EASYAR_OPTIONALOFIMAGETARGET__
struct OptionalOfImageTarget
{
bool has_value;
ImageTarget * value;
};
static inline easyar_OptionalOfImageTarget OptionalOfImageTarget_to_c(ImageTarget * o);
#endif
#ifndef __EASYAR_LISTOFIMAGE__
#define __EASYAR_LISTOFIMAGE__
class ListOfImage
{
private:
easyar_ListOfImage * cdata_;
virtual ListOfImage & operator=(const ListOfImage & data) { return *this; } //deleted
public:
ListOfImage(easyar_ListOfImage * cdata);
virtual ~ListOfImage();
ListOfImage(const ListOfImage & data);
const easyar_ListOfImage * get_cdata() const;
easyar_ListOfImage * get_cdata();
ListOfImage(easyar_Image * * begin, easyar_Image * * end);
int size() const;
Image * at(int index) const;
};
#endif
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_IMAGETARGET_HXX__
#define __IMPLEMENTATION_EASYAR_IMAGETARGET_HXX__
#include "easyar/imagetarget.h"
#include "easyar/image.hxx"
#include "easyar/buffer.hxx"
#include "easyar/target.hxx"
namespace easyar {
inline ImageTargetParameters::ImageTargetParameters(easyar_ImageTargetParameters * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline ImageTargetParameters::~ImageTargetParameters()
{
if (cdata_) {
easyar_ImageTargetParameters__dtor(cdata_);
cdata_ = NULL;
}
}
inline ImageTargetParameters::ImageTargetParameters(const ImageTargetParameters & data)
:
cdata_(NULL)
{
easyar_ImageTargetParameters * cdata = NULL;
easyar_ImageTargetParameters__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_ImageTargetParameters * ImageTargetParameters::get_cdata() const
{
return cdata_;
}
inline easyar_ImageTargetParameters * ImageTargetParameters::get_cdata()
{
return cdata_;
}
inline void ImageTargetParameters::init_cdata(easyar_ImageTargetParameters * cdata)
{
cdata_ = cdata;
}
inline ImageTargetParameters::ImageTargetParameters()
:
cdata_(NULL)
{
easyar_ImageTargetParameters * _return_value_ = NULL;
easyar_ImageTargetParameters__ctor(&_return_value_);
init_cdata(_return_value_);
}
inline void ImageTargetParameters::image(/* OUT */ Image * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_Image * _return_value_ = NULL;
easyar_ImageTargetParameters_image(cdata_, &_return_value_);
*Return = new Image(_return_value_);
}
inline void ImageTargetParameters::setImage(Image * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTargetParameters_setImage(cdata_, arg0->get_cdata());
}
inline void ImageTargetParameters::name(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ImageTargetParameters_name(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ImageTargetParameters::setName(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTargetParameters_setName(cdata_, arg0->get_cdata());
}
inline void ImageTargetParameters::uid(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ImageTargetParameters_uid(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ImageTargetParameters::setUid(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTargetParameters_setUid(cdata_, arg0->get_cdata());
}
inline void ImageTargetParameters::meta(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ImageTargetParameters_meta(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ImageTargetParameters::setMeta(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTargetParameters_setMeta(cdata_, arg0->get_cdata());
}
inline float ImageTargetParameters::scale()
{
if (cdata_ == NULL) {
return float();
}
float _return_value_ = easyar_ImageTargetParameters_scale(cdata_);
return _return_value_;
}
inline void ImageTargetParameters::setScale(float arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTargetParameters_setScale(cdata_, arg0);
}
inline ImageTarget::ImageTarget(easyar_ImageTarget * cdata)
:
Target(static_cast<easyar_Target *>(NULL)),
cdata_(NULL)
{
init_cdata(cdata);
}
inline ImageTarget::~ImageTarget()
{
if (cdata_) {
easyar_ImageTarget__dtor(cdata_);
cdata_ = NULL;
}
}
inline ImageTarget::ImageTarget(const ImageTarget & data)
:
Target(static_cast<easyar_Target *>(NULL)),
cdata_(NULL)
{
easyar_ImageTarget * cdata = NULL;
easyar_ImageTarget__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_ImageTarget * ImageTarget::get_cdata() const
{
return cdata_;
}
inline easyar_ImageTarget * ImageTarget::get_cdata()
{
return cdata_;
}
inline void ImageTarget::init_cdata(easyar_ImageTarget * cdata)
{
cdata_ = cdata;
{
easyar_Target * cdata_inner = NULL;
easyar_castImageTargetToTarget(cdata, &cdata_inner);
Target::init_cdata(cdata_inner);
}
}
inline ImageTarget::ImageTarget()
:
Target(static_cast<easyar_Target *>(NULL)),
cdata_(NULL)
{
easyar_ImageTarget * _return_value_ = NULL;
easyar_ImageTarget__ctor(&_return_value_);
init_cdata(_return_value_);
}
inline void ImageTarget::createFromParameters(ImageTargetParameters * arg0, /* OUT */ ImageTarget * * Return)
{
easyar_OptionalOfImageTarget _return_value_ = {false, NULL};
easyar_ImageTarget_createFromParameters(arg0->get_cdata(), &_return_value_);
*Return = (_return_value_.has_value ? new ImageTarget(_return_value_.value) : NULL);
}
inline void ImageTarget::createFromTargetFile(String * arg0, StorageType arg1, /* OUT */ ImageTarget * * Return)
{
easyar_OptionalOfImageTarget _return_value_ = {false, NULL};
easyar_ImageTarget_createFromTargetFile(arg0->get_cdata(), static_cast<easyar_StorageType>(arg1), &_return_value_);
*Return = (_return_value_.has_value ? new ImageTarget(_return_value_.value) : NULL);
}
inline void ImageTarget::createFromTargetData(Buffer * arg0, /* OUT */ ImageTarget * * Return)
{
easyar_OptionalOfImageTarget _return_value_ = {false, NULL};
easyar_ImageTarget_createFromTargetData(arg0->get_cdata(), &_return_value_);
*Return = (_return_value_.has_value ? new ImageTarget(_return_value_.value) : NULL);
}
inline bool ImageTarget::save(String * arg0)
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_ImageTarget_save(cdata_, arg0->get_cdata());
return _return_value_;
}
inline void ImageTarget::createFromImageFile(String * arg0, StorageType arg1, String * arg2, String * arg3, String * arg4, float arg5, /* OUT */ ImageTarget * * Return)
{
easyar_OptionalOfImageTarget _return_value_ = {false, NULL};
easyar_ImageTarget_createFromImageFile(arg0->get_cdata(), static_cast<easyar_StorageType>(arg1), arg2->get_cdata(), arg3->get_cdata(), arg4->get_cdata(), arg5, &_return_value_);
*Return = (_return_value_.has_value ? new ImageTarget(_return_value_.value) : NULL);
}
inline float ImageTarget::scale()
{
if (cdata_ == NULL) {
return float();
}
float _return_value_ = easyar_ImageTarget_scale(cdata_);
return _return_value_;
}
inline float ImageTarget::aspectRatio()
{
if (cdata_ == NULL) {
return float();
}
float _return_value_ = easyar_ImageTarget_aspectRatio(cdata_);
return _return_value_;
}
inline bool ImageTarget::setScale(float arg0)
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_ImageTarget_setScale(cdata_, arg0);
return _return_value_;
}
inline void ImageTarget::images(/* OUT */ ListOfImage * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfImage * _return_value_ = NULL;
easyar_ImageTarget_images(cdata_, &_return_value_);
*Return = new ListOfImage(_return_value_);
}
inline int ImageTarget::runtimeID()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_ImageTarget_runtimeID(cdata_);
return _return_value_;
}
inline void ImageTarget::uid(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ImageTarget_uid(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ImageTarget::name(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ImageTarget_name(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ImageTarget::setName(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTarget_setName(cdata_, arg0->get_cdata());
}
inline void ImageTarget::meta(/* OUT */ String * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_String * _return_value_ = NULL;
easyar_ImageTarget_meta(cdata_, &_return_value_);
*Return = new String(_return_value_);
}
inline void ImageTarget::setMeta(String * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTarget_setMeta(cdata_, arg0->get_cdata());
}
inline void ImageTarget::tryCastFromTarget(Target * v, /* OUT */ ImageTarget * * Return)
{
if (v == NULL) {
*Return = NULL;
return;
}
easyar_ImageTarget * cdata = NULL;
easyar_tryCastTargetToImageTarget(v->get_cdata(), &cdata);
if (cdata == NULL) {
*Return = NULL;
return;
}
*Return = new ImageTarget(cdata);
}
#ifndef __IMPLEMENTATION_EASYAR_OPTIONALOFIMAGETARGET__
#define __IMPLEMENTATION_EASYAR_OPTIONALOFIMAGETARGET__
static inline easyar_OptionalOfImageTarget OptionalOfImageTarget_to_c(ImageTarget * o)
{
if (o != NULL) {
easyar_OptionalOfImageTarget _return_value_ = {true, o->get_cdata()};
return _return_value_;
} else {
easyar_OptionalOfImageTarget _return_value_ = {false, NULL};
return _return_value_;
}
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_LISTOFIMAGE__
#define __IMPLEMENTATION_EASYAR_LISTOFIMAGE__
inline ListOfImage::ListOfImage(easyar_ListOfImage * cdata)
: cdata_(cdata)
{
}
inline ListOfImage::~ListOfImage()
{
if (cdata_) {
easyar_ListOfImage__dtor(cdata_);
cdata_ = NULL;
}
}
inline ListOfImage::ListOfImage(const ListOfImage & data)
: cdata_(static_cast<easyar_ListOfImage *>(NULL))
{
easyar_ListOfImage_copy(data.cdata_, &cdata_);
}
inline const easyar_ListOfImage * ListOfImage::get_cdata() const
{
return cdata_;
}
inline easyar_ListOfImage * ListOfImage::get_cdata()
{
return cdata_;
}
inline ListOfImage::ListOfImage(easyar_Image * * begin, easyar_Image * * end)
: cdata_(static_cast<easyar_ListOfImage *>(NULL))
{
easyar_ListOfImage__ctor(begin, end, &cdata_);
}
inline int ListOfImage::size() const
{
return easyar_ListOfImage_size(cdata_);
}
inline Image * ListOfImage::at(int index) const
{
easyar_Image * _return_value_ = easyar_ListOfImage_at(cdata_, index);
easyar_Image__retain(_return_value_, &_return_value_);
return new Image(_return_value_);
}
#endif
}
#endif
fileFormatVersion: 2
guid: 6610e35ee3fd62b46a9cd1a96bf20a2c
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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"
/// <summary>
/// ImageTargetParameters represents the parameters to create a `ImageTarget`_ .
/// </summary>
@interface easyar_ImageTargetParameters : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
+ (easyar_ImageTargetParameters *) create;
/// <summary>
/// Gets image.
/// </summary>
- (easyar_Image *)image;
/// <summary>
/// Sets image.
/// </summary>
- (void)setImage:(easyar_Image *)image;
/// <summary>
/// Gets target name. It can be used to distinguish targets.
/// </summary>
- (NSString *)name;
/// <summary>
/// Sets target name.
/// </summary>
- (void)setName:(NSString *)name;
/// <summary>
/// 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.
/// </summary>
- (NSString *)uid;
/// <summary>
/// Sets target uid.
/// </summary>
- (void)setUid:(NSString *)uid;
/// <summary>
/// Gets meta data.
/// </summary>
- (NSString *)meta;
/// <summary>
/// Sets meta data。
/// </summary>
- (void)setMeta:(NSString *)meta;
/// <summary>
/// Gets the scale of image. The value is the physical image width divided by 1 meter. The default value is 1.
/// </summary>
- (float)scale;
/// <summary>
/// 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.
/// </summary>
- (void)setScale:(float)scale;
@end
/// <summary>
/// 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`_ .
/// </summary>
@interface easyar_ImageTarget : easyar_Target
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
+ (easyar_ImageTarget *) create;
/// <summary>
/// Creates a target from parameters.
/// </summary>
+ (easyar_ImageTarget *)createFromParameters:(easyar_ImageTargetParameters *)parameters;
/// <summary>
/// Creates a target from an etd file.
/// </summary>
+ (easyar_ImageTarget *)createFromTargetFile:(NSString *)path storageType:(easyar_StorageType)storageType;
/// <summary>
/// Creates a target from an etd data buffer.
/// </summary>
+ (easyar_ImageTarget *)createFromTargetData:(easyar_Buffer *)buffer;
/// <summary>
/// Saves as an etd file.
/// </summary>
- (bool)save:(NSString *)path;
/// <summary>
/// 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.
/// </summary>
+ (easyar_ImageTarget *)createFromImageFile:(NSString *)path storageType:(easyar_StorageType)storageType name:(NSString *)name uid:(NSString *)uid meta:(NSString *)meta scale:(float)scale;
/// <summary>
/// The scale of image. The value is the physical image width divided by 1 meter. The default value is 1.
/// </summary>
- (float)scale;
/// <summary>
/// The aspect ratio of image, width divided by height.
/// </summary>
- (float)aspectRatio;
/// <summary>
/// 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.
/// </summary>
- (bool)setScale:(float)scale;
/// <summary>
/// Returns a list of images that stored in the target. It is generally used to get image data from cloud returned target.
/// </summary>
- (NSArray<easyar_Image *> *)images;
/// <summary>
/// Returns the target id. A target id is a integer number generated at runtime. This id is non-zero and increasing globally.
/// </summary>
- (int)runtimeID;
/// <summary>
/// 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.
/// </summary>
- (NSString *)uid;
/// <summary>
/// Returns the target name. Name is used to distinguish targets in a json file.
/// </summary>
- (NSString *)name;
/// <summary>
/// Set name. It will erase previously set data or data from cloud.
/// </summary>
- (void)setName:(NSString *)name;
/// <summary>
/// Returns the meta data set by setMetaData. Or, in a cloud returned target, returns the meta data set in the cloud server.
/// </summary>
- (NSString *)meta;
/// <summary>
/// Set meta data. It will erase previously set data or data from cloud.
/// </summary>
- (void)setMeta:(NSString *)data;
@end
fileFormatVersion: 2
guid: 63d5055882253554891e5327323b93db
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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.
//
//=============================================================================================================================
#ifndef __EASYAR_IMAGETRACKER_H__
#define __EASYAR_IMAGETRACKER_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/// <summary>
/// Returns the list of `TargetInstance`_ contained in the result.
/// </summary>
void easyar_ImageTrackerResult_targetInstances(const easyar_ImageTrackerResult * This, /* OUT */ easyar_ListOfTargetInstance * * Return);
/// <summary>
/// Sets the list of `TargetInstance`_ contained in the result.
/// </summary>
void easyar_ImageTrackerResult_setTargetInstances(easyar_ImageTrackerResult * This, easyar_ListOfTargetInstance * instances);
void easyar_ImageTrackerResult__dtor(easyar_ImageTrackerResult * This);
void easyar_ImageTrackerResult__retain(const easyar_ImageTrackerResult * This, /* OUT */ easyar_ImageTrackerResult * * Return);
const char * easyar_ImageTrackerResult__typeName(const easyar_ImageTrackerResult * This);
void easyar_castImageTrackerResultToFrameFilterResult(const easyar_ImageTrackerResult * This, /* OUT */ easyar_FrameFilterResult * * Return);
void easyar_tryCastFrameFilterResultToImageTrackerResult(const easyar_FrameFilterResult * This, /* OUT */ easyar_ImageTrackerResult * * Return);
void easyar_castImageTrackerResultToTargetTrackerResult(const easyar_ImageTrackerResult * This, /* OUT */ easyar_TargetTrackerResult * * Return);
void easyar_tryCastTargetTrackerResultToImageTrackerResult(const easyar_TargetTrackerResult * This, /* OUT */ easyar_ImageTrackerResult * * Return);
/// <summary>
/// Returns true.
/// </summary>
bool easyar_ImageTracker_isAvailable(void);
/// <summary>
/// `FeedbackFrame`_ input port. The InputFrame member of FeedbackFrame must have raw image, timestamp, and camera parameters.
/// </summary>
void easyar_ImageTracker_feedbackFrameSink(easyar_ImageTracker * This, /* OUT */ easyar_FeedbackFrameSink * * Return);
/// <summary>
/// Camera buffers occupied in this component.
/// </summary>
int easyar_ImageTracker_bufferRequirement(easyar_ImageTracker * This);
/// <summary>
/// `OutputFrame`_ output port.
/// </summary>
void easyar_ImageTracker_outputFrameSource(easyar_ImageTracker * This, /* OUT */ easyar_OutputFrameSource * * Return);
/// <summary>
/// Creates an instance. The default track mode is `ImageTrackerMode.PreferQuality`_ .
/// </summary>
void easyar_ImageTracker_create(/* OUT */ easyar_ImageTracker * * Return);
/// <summary>
/// Creates an instance with a specified track mode. On lower-end phones, `ImageTrackerMode.PreferPerformance`_ can be used to keep a better performance with a little quality loss.
/// </summary>
void easyar_ImageTracker_createWithMode(easyar_ImageTrackerMode trackMode, /* OUT */ easyar_ImageTracker * * Return);
/// <summary>
/// Starts the track algorithm.
/// </summary>
bool easyar_ImageTracker_start(easyar_ImageTracker * This);
/// <summary>
/// Stops the track algorithm. Call start to start the track again.
/// </summary>
void easyar_ImageTracker_stop(easyar_ImageTracker * This);
/// <summary>
/// Close. The component shall not be used after calling close.
/// </summary>
void easyar_ImageTracker_close(easyar_ImageTracker * This);
/// <summary>
/// Load a `Target`_ into the tracker. A Target can only be tracked by tracker after a successful load.
/// This method is an asynchronous method. A load operation may take some time to finish and detection of a new/lost target may take more time during the load. The track time after detection will not be affected. If you want to know the load result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
void easyar_ImageTracker_loadTarget(easyar_ImageTracker * This, easyar_Target * target, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromTargetAndBool callback);
/// <summary>
/// Unload a `Target`_ from the tracker.
/// This method is an asynchronous method. An unload operation may take some time to finish and detection of a new/lost target may take more time during the unload. If you want to know the unload result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
void easyar_ImageTracker_unloadTarget(easyar_ImageTracker * This, easyar_Target * target, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromTargetAndBool callback);
/// <summary>
/// Returns current loaded targets in the tracker. If an asynchronous load/unload is in progress, the returned value will not reflect the result until all load/unload finish.
/// </summary>
void easyar_ImageTracker_targets(const easyar_ImageTracker * This, /* OUT */ easyar_ListOfTarget * * Return);
/// <summary>
/// Sets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
bool easyar_ImageTracker_setSimultaneousNum(easyar_ImageTracker * This, int num);
/// <summary>
/// Gets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
int easyar_ImageTracker_simultaneousNum(const easyar_ImageTracker * This);
void easyar_ImageTracker__dtor(easyar_ImageTracker * This);
void easyar_ImageTracker__retain(const easyar_ImageTracker * This, /* OUT */ easyar_ImageTracker * * Return);
const char * easyar_ImageTracker__typeName(const easyar_ImageTracker * This);
void easyar_ListOfTargetInstance__ctor(easyar_TargetInstance * const * begin, easyar_TargetInstance * const * end, /* OUT */ easyar_ListOfTargetInstance * * Return);
void easyar_ListOfTargetInstance__dtor(easyar_ListOfTargetInstance * This);
void easyar_ListOfTargetInstance_copy(const easyar_ListOfTargetInstance * This, /* OUT */ easyar_ListOfTargetInstance * * Return);
int easyar_ListOfTargetInstance_size(const easyar_ListOfTargetInstance * This);
easyar_TargetInstance * easyar_ListOfTargetInstance_at(const easyar_ListOfTargetInstance * This, int index);
void easyar_ListOfTarget__ctor(easyar_Target * const * begin, easyar_Target * const * end, /* OUT */ easyar_ListOfTarget * * Return);
void easyar_ListOfTarget__dtor(easyar_ListOfTarget * This);
void easyar_ListOfTarget_copy(const easyar_ListOfTarget * This, /* OUT */ easyar_ListOfTarget * * Return);
int easyar_ListOfTarget_size(const easyar_ListOfTarget * This);
easyar_Target * easyar_ListOfTarget_at(const easyar_ListOfTarget * This, int index);
#ifdef __cplusplus
}
#endif
#endif
fileFormatVersion: 2
guid: 8f31dd81c05fccb4eb1234c69c1257ae
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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.
//
//=============================================================================================================================
#ifndef __EASYAR_IMAGETRACKER_HXX__
#define __EASYAR_IMAGETRACKER_HXX__
#include "easyar/types.hxx"
#include "easyar/target.hxx"
namespace easyar {
/// <summary>
/// Result of `ImageTracker`_ .
/// </summary>
class ImageTrackerResult : public TargetTrackerResult
{
protected:
easyar_ImageTrackerResult * cdata_ ;
void init_cdata(easyar_ImageTrackerResult * cdata);
virtual ImageTrackerResult & operator=(const ImageTrackerResult & data) { return *this; } //deleted
public:
ImageTrackerResult(easyar_ImageTrackerResult * cdata);
virtual ~ImageTrackerResult();
ImageTrackerResult(const ImageTrackerResult & data);
const easyar_ImageTrackerResult * get_cdata() const;
easyar_ImageTrackerResult * get_cdata();
/// <summary>
/// Returns the list of `TargetInstance`_ contained in the result.
/// </summary>
void targetInstances(/* OUT */ ListOfTargetInstance * * Return);
/// <summary>
/// Sets the list of `TargetInstance`_ contained in the result.
/// </summary>
void setTargetInstances(ListOfTargetInstance * instances);
static void tryCastFromFrameFilterResult(FrameFilterResult * v, /* OUT */ ImageTrackerResult * * Return);
static void tryCastFromTargetTrackerResult(TargetTrackerResult * v, /* OUT */ ImageTrackerResult * * Return);
};
/// <summary>
/// ImageTracker implements image target detection and tracking.
/// ImageTracker occupies (1 + SimultaneousNum) buffers of camera. Use setBufferCapacity of camera to set an amount of buffers that is not less than the sum of amount of buffers occupied by all components. Refer to `Overview &lt;Overview.html&gt;`__ .
/// After creation, you can call start/stop to enable/disable the track process. start and stop are very lightweight calls.
/// When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
/// ImageTracker inputs `FeedbackFrame`_ from feedbackFrameSink. `FeedbackFrameSource`_ shall be connected to feedbackFrameSink for use. Refer to `Overview &lt;Overview.html&gt;`__ .
/// Before a `Target`_ can be tracked by ImageTracker, you have to load it using loadTarget/unloadTarget. You can get load/unload results from callbacks passed into the interfaces.
/// </summary>
class ImageTracker
{
protected:
easyar_ImageTracker * cdata_ ;
void init_cdata(easyar_ImageTracker * cdata);
virtual ImageTracker & operator=(const ImageTracker & data) { return *this; } //deleted
public:
ImageTracker(easyar_ImageTracker * cdata);
virtual ~ImageTracker();
ImageTracker(const ImageTracker & data);
const easyar_ImageTracker * get_cdata() const;
easyar_ImageTracker * get_cdata();
/// <summary>
/// Returns true.
/// </summary>
static bool isAvailable();
/// <summary>
/// `FeedbackFrame`_ input port. The InputFrame member of FeedbackFrame must have raw image, timestamp, and camera parameters.
/// </summary>
void feedbackFrameSink(/* OUT */ FeedbackFrameSink * * Return);
/// <summary>
/// Camera buffers occupied in this component.
/// </summary>
int bufferRequirement();
/// <summary>
/// `OutputFrame`_ output port.
/// </summary>
void outputFrameSource(/* OUT */ OutputFrameSource * * Return);
/// <summary>
/// Creates an instance. The default track mode is `ImageTrackerMode.PreferQuality`_ .
/// </summary>
static void create(/* OUT */ ImageTracker * * Return);
/// <summary>
/// Creates an instance with a specified track mode. On lower-end phones, `ImageTrackerMode.PreferPerformance`_ can be used to keep a better performance with a little quality loss.
/// </summary>
static void createWithMode(ImageTrackerMode trackMode, /* OUT */ ImageTracker * * Return);
/// <summary>
/// Starts the track algorithm.
/// </summary>
bool start();
/// <summary>
/// Stops the track algorithm. Call start to start the track again.
/// </summary>
void stop();
/// <summary>
/// Close. The component shall not be used after calling close.
/// </summary>
void close();
/// <summary>
/// Load a `Target`_ into the tracker. A Target can only be tracked by tracker after a successful load.
/// This method is an asynchronous method. A load operation may take some time to finish and detection of a new/lost target may take more time during the load. The track time after detection will not be affected. If you want to know the load result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
void loadTarget(Target * target, CallbackScheduler * callbackScheduler, FunctorOfVoidFromTargetAndBool callback);
/// <summary>
/// Unload a `Target`_ from the tracker.
/// This method is an asynchronous method. An unload operation may take some time to finish and detection of a new/lost target may take more time during the unload. If you want to know the unload result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
void unloadTarget(Target * target, CallbackScheduler * callbackScheduler, FunctorOfVoidFromTargetAndBool callback);
/// <summary>
/// Returns current loaded targets in the tracker. If an asynchronous load/unload is in progress, the returned value will not reflect the result until all load/unload finish.
/// </summary>
void targets(/* OUT */ ListOfTarget * * Return);
/// <summary>
/// Sets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
bool setSimultaneousNum(int num);
/// <summary>
/// Gets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
int simultaneousNum();
};
#ifndef __EASYAR_LISTOFTARGETINSTANCE__
#define __EASYAR_LISTOFTARGETINSTANCE__
class ListOfTargetInstance
{
private:
easyar_ListOfTargetInstance * cdata_;
virtual ListOfTargetInstance & operator=(const ListOfTargetInstance & data) { return *this; } //deleted
public:
ListOfTargetInstance(easyar_ListOfTargetInstance * cdata);
virtual ~ListOfTargetInstance();
ListOfTargetInstance(const ListOfTargetInstance & data);
const easyar_ListOfTargetInstance * get_cdata() const;
easyar_ListOfTargetInstance * get_cdata();
ListOfTargetInstance(easyar_TargetInstance * * begin, easyar_TargetInstance * * end);
int size() const;
TargetInstance * at(int index) const;
};
#endif
#ifndef __EASYAR_FUNCTOROFVOIDFROMTARGETANDBOOL__
#define __EASYAR_FUNCTOROFVOIDFROMTARGETANDBOOL__
struct FunctorOfVoidFromTargetAndBool
{
void * _state;
void (* func)(void * _state, Target *, bool);
void (* destroy)(void * _state);
FunctorOfVoidFromTargetAndBool(void * _state, void (* func)(void * _state, Target *, bool), void (* destroy)(void * _state));
};
static void FunctorOfVoidFromTargetAndBool_func(void * _state, easyar_Target *, bool, /* OUT */ easyar_String * * _exception);
static void FunctorOfVoidFromTargetAndBool_destroy(void * _state);
static inline easyar_FunctorOfVoidFromTargetAndBool FunctorOfVoidFromTargetAndBool_to_c(FunctorOfVoidFromTargetAndBool f);
#endif
#ifndef __EASYAR_LISTOFTARGET__
#define __EASYAR_LISTOFTARGET__
class ListOfTarget
{
private:
easyar_ListOfTarget * cdata_;
virtual ListOfTarget & operator=(const ListOfTarget & data) { return *this; } //deleted
public:
ListOfTarget(easyar_ListOfTarget * cdata);
virtual ~ListOfTarget();
ListOfTarget(const ListOfTarget & data);
const easyar_ListOfTarget * get_cdata() const;
easyar_ListOfTarget * get_cdata();
ListOfTarget(easyar_Target * * begin, easyar_Target * * end);
int size() const;
Target * at(int index) const;
};
#endif
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_IMAGETRACKER_HXX__
#define __IMPLEMENTATION_EASYAR_IMAGETRACKER_HXX__
#include "easyar/imagetracker.h"
#include "easyar/target.hxx"
#include "easyar/frame.hxx"
#include "easyar/matrix.hxx"
#include "easyar/dataflow.hxx"
#include "easyar/image.hxx"
#include "easyar/buffer.hxx"
#include "easyar/cameraparameters.hxx"
#include "easyar/vector.hxx"
#include "easyar/callbackscheduler.hxx"
namespace easyar {
inline ImageTrackerResult::ImageTrackerResult(easyar_ImageTrackerResult * cdata)
:
TargetTrackerResult(static_cast<easyar_TargetTrackerResult *>(NULL)),
cdata_(NULL)
{
init_cdata(cdata);
}
inline ImageTrackerResult::~ImageTrackerResult()
{
if (cdata_) {
easyar_ImageTrackerResult__dtor(cdata_);
cdata_ = NULL;
}
}
inline ImageTrackerResult::ImageTrackerResult(const ImageTrackerResult & data)
:
TargetTrackerResult(static_cast<easyar_TargetTrackerResult *>(NULL)),
cdata_(NULL)
{
easyar_ImageTrackerResult * cdata = NULL;
easyar_ImageTrackerResult__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_ImageTrackerResult * ImageTrackerResult::get_cdata() const
{
return cdata_;
}
inline easyar_ImageTrackerResult * ImageTrackerResult::get_cdata()
{
return cdata_;
}
inline void ImageTrackerResult::init_cdata(easyar_ImageTrackerResult * cdata)
{
cdata_ = cdata;
{
easyar_TargetTrackerResult * cdata_inner = NULL;
easyar_castImageTrackerResultToTargetTrackerResult(cdata, &cdata_inner);
TargetTrackerResult::init_cdata(cdata_inner);
}
}
inline void ImageTrackerResult::targetInstances(/* OUT */ ListOfTargetInstance * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfTargetInstance * _return_value_ = NULL;
easyar_ImageTrackerResult_targetInstances(cdata_, &_return_value_);
*Return = new ListOfTargetInstance(_return_value_);
}
inline void ImageTrackerResult::setTargetInstances(ListOfTargetInstance * arg0)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTrackerResult_setTargetInstances(cdata_, arg0->get_cdata());
}
inline void ImageTrackerResult::tryCastFromFrameFilterResult(FrameFilterResult * v, /* OUT */ ImageTrackerResult * * Return)
{
if (v == NULL) {
*Return = NULL;
return;
}
easyar_ImageTrackerResult * cdata = NULL;
easyar_tryCastFrameFilterResultToImageTrackerResult(v->get_cdata(), &cdata);
if (cdata == NULL) {
*Return = NULL;
return;
}
*Return = new ImageTrackerResult(cdata);
}
inline void ImageTrackerResult::tryCastFromTargetTrackerResult(TargetTrackerResult * v, /* OUT */ ImageTrackerResult * * Return)
{
if (v == NULL) {
*Return = NULL;
return;
}
easyar_ImageTrackerResult * cdata = NULL;
easyar_tryCastTargetTrackerResultToImageTrackerResult(v->get_cdata(), &cdata);
if (cdata == NULL) {
*Return = NULL;
return;
}
*Return = new ImageTrackerResult(cdata);
}
inline ImageTracker::ImageTracker(easyar_ImageTracker * cdata)
:
cdata_(NULL)
{
init_cdata(cdata);
}
inline ImageTracker::~ImageTracker()
{
if (cdata_) {
easyar_ImageTracker__dtor(cdata_);
cdata_ = NULL;
}
}
inline ImageTracker::ImageTracker(const ImageTracker & data)
:
cdata_(NULL)
{
easyar_ImageTracker * cdata = NULL;
easyar_ImageTracker__retain(data.cdata_, &cdata);
init_cdata(cdata);
}
inline const easyar_ImageTracker * ImageTracker::get_cdata() const
{
return cdata_;
}
inline easyar_ImageTracker * ImageTracker::get_cdata()
{
return cdata_;
}
inline void ImageTracker::init_cdata(easyar_ImageTracker * cdata)
{
cdata_ = cdata;
}
inline bool ImageTracker::isAvailable()
{
bool _return_value_ = easyar_ImageTracker_isAvailable();
return _return_value_;
}
inline void ImageTracker::feedbackFrameSink(/* OUT */ FeedbackFrameSink * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_FeedbackFrameSink * _return_value_ = NULL;
easyar_ImageTracker_feedbackFrameSink(cdata_, &_return_value_);
*Return = new FeedbackFrameSink(_return_value_);
}
inline int ImageTracker::bufferRequirement()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_ImageTracker_bufferRequirement(cdata_);
return _return_value_;
}
inline void ImageTracker::outputFrameSource(/* OUT */ OutputFrameSource * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_OutputFrameSource * _return_value_ = NULL;
easyar_ImageTracker_outputFrameSource(cdata_, &_return_value_);
*Return = new OutputFrameSource(_return_value_);
}
inline void ImageTracker::create(/* OUT */ ImageTracker * * Return)
{
easyar_ImageTracker * _return_value_ = NULL;
easyar_ImageTracker_create(&_return_value_);
*Return = new ImageTracker(_return_value_);
}
inline void ImageTracker::createWithMode(ImageTrackerMode arg0, /* OUT */ ImageTracker * * Return)
{
easyar_ImageTracker * _return_value_ = NULL;
easyar_ImageTracker_createWithMode(static_cast<easyar_ImageTrackerMode>(arg0), &_return_value_);
*Return = new ImageTracker(_return_value_);
}
inline bool ImageTracker::start()
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_ImageTracker_start(cdata_);
return _return_value_;
}
inline void ImageTracker::stop()
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTracker_stop(cdata_);
}
inline void ImageTracker::close()
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTracker_close(cdata_);
}
inline void ImageTracker::loadTarget(Target * arg0, CallbackScheduler * arg1, FunctorOfVoidFromTargetAndBool arg2)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTracker_loadTarget(cdata_, arg0->get_cdata(), arg1->get_cdata(), FunctorOfVoidFromTargetAndBool_to_c(arg2));
}
inline void ImageTracker::unloadTarget(Target * arg0, CallbackScheduler * arg1, FunctorOfVoidFromTargetAndBool arg2)
{
if (cdata_ == NULL) {
return;
}
easyar_ImageTracker_unloadTarget(cdata_, arg0->get_cdata(), arg1->get_cdata(), FunctorOfVoidFromTargetAndBool_to_c(arg2));
}
inline void ImageTracker::targets(/* OUT */ ListOfTarget * * Return)
{
if (cdata_ == NULL) {
*Return = NULL;
return;
}
easyar_ListOfTarget * _return_value_ = NULL;
easyar_ImageTracker_targets(cdata_, &_return_value_);
*Return = new ListOfTarget(_return_value_);
}
inline bool ImageTracker::setSimultaneousNum(int arg0)
{
if (cdata_ == NULL) {
return bool();
}
bool _return_value_ = easyar_ImageTracker_setSimultaneousNum(cdata_, arg0);
return _return_value_;
}
inline int ImageTracker::simultaneousNum()
{
if (cdata_ == NULL) {
return int();
}
int _return_value_ = easyar_ImageTracker_simultaneousNum(cdata_);
return _return_value_;
}
#ifndef __IMPLEMENTATION_EASYAR_LISTOFTARGETINSTANCE__
#define __IMPLEMENTATION_EASYAR_LISTOFTARGETINSTANCE__
inline ListOfTargetInstance::ListOfTargetInstance(easyar_ListOfTargetInstance * cdata)
: cdata_(cdata)
{
}
inline ListOfTargetInstance::~ListOfTargetInstance()
{
if (cdata_) {
easyar_ListOfTargetInstance__dtor(cdata_);
cdata_ = NULL;
}
}
inline ListOfTargetInstance::ListOfTargetInstance(const ListOfTargetInstance & data)
: cdata_(static_cast<easyar_ListOfTargetInstance *>(NULL))
{
easyar_ListOfTargetInstance_copy(data.cdata_, &cdata_);
}
inline const easyar_ListOfTargetInstance * ListOfTargetInstance::get_cdata() const
{
return cdata_;
}
inline easyar_ListOfTargetInstance * ListOfTargetInstance::get_cdata()
{
return cdata_;
}
inline ListOfTargetInstance::ListOfTargetInstance(easyar_TargetInstance * * begin, easyar_TargetInstance * * end)
: cdata_(static_cast<easyar_ListOfTargetInstance *>(NULL))
{
easyar_ListOfTargetInstance__ctor(begin, end, &cdata_);
}
inline int ListOfTargetInstance::size() const
{
return easyar_ListOfTargetInstance_size(cdata_);
}
inline TargetInstance * ListOfTargetInstance::at(int index) const
{
easyar_TargetInstance * _return_value_ = easyar_ListOfTargetInstance_at(cdata_, index);
easyar_TargetInstance__retain(_return_value_, &_return_value_);
return new TargetInstance(_return_value_);
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMTARGETANDBOOL__
#define __IMPLEMENTATION_EASYAR_FUNCTOROFVOIDFROMTARGETANDBOOL__
inline FunctorOfVoidFromTargetAndBool::FunctorOfVoidFromTargetAndBool(void * _state, void (* func)(void * _state, Target *, bool), void (* destroy)(void * _state))
{
this->_state = _state;
this->func = func;
this->destroy = destroy;
}
static void FunctorOfVoidFromTargetAndBool_func(void * _state, easyar_Target * arg0, bool arg1, /* OUT */ easyar_String * * _exception)
{
*_exception = NULL;
try {
easyar_Target__retain(arg0, &arg0);
Target * cpparg0 = new Target(arg0);
bool cpparg1 = arg1;
FunctorOfVoidFromTargetAndBool * f = reinterpret_cast<FunctorOfVoidFromTargetAndBool *>(_state);
f->func(f->_state, cpparg0, cpparg1);
delete cpparg0;
} catch (std::exception & ex) {
easyar_String_from_utf8_begin(ex.what(), _exception);
}
}
static void FunctorOfVoidFromTargetAndBool_destroy(void * _state)
{
FunctorOfVoidFromTargetAndBool * f = reinterpret_cast<FunctorOfVoidFromTargetAndBool *>(_state);
if (f->destroy) {
f->destroy(f->_state);
}
delete f;
}
static inline easyar_FunctorOfVoidFromTargetAndBool FunctorOfVoidFromTargetAndBool_to_c(FunctorOfVoidFromTargetAndBool f)
{
easyar_FunctorOfVoidFromTargetAndBool _return_value_ = {NULL, NULL, NULL};
_return_value_._state = new FunctorOfVoidFromTargetAndBool(f._state, f.func, f.destroy);
_return_value_.func = FunctorOfVoidFromTargetAndBool_func;
_return_value_.destroy = FunctorOfVoidFromTargetAndBool_destroy;
return _return_value_;
}
#endif
#ifndef __IMPLEMENTATION_EASYAR_LISTOFTARGET__
#define __IMPLEMENTATION_EASYAR_LISTOFTARGET__
inline ListOfTarget::ListOfTarget(easyar_ListOfTarget * cdata)
: cdata_(cdata)
{
}
inline ListOfTarget::~ListOfTarget()
{
if (cdata_) {
easyar_ListOfTarget__dtor(cdata_);
cdata_ = NULL;
}
}
inline ListOfTarget::ListOfTarget(const ListOfTarget & data)
: cdata_(static_cast<easyar_ListOfTarget *>(NULL))
{
easyar_ListOfTarget_copy(data.cdata_, &cdata_);
}
inline const easyar_ListOfTarget * ListOfTarget::get_cdata() const
{
return cdata_;
}
inline easyar_ListOfTarget * ListOfTarget::get_cdata()
{
return cdata_;
}
inline ListOfTarget::ListOfTarget(easyar_Target * * begin, easyar_Target * * end)
: cdata_(static_cast<easyar_ListOfTarget *>(NULL))
{
easyar_ListOfTarget__ctor(begin, end, &cdata_);
}
inline int ListOfTarget::size() const
{
return easyar_ListOfTarget_size(cdata_);
}
inline Target * ListOfTarget::at(int index) const
{
easyar_Target * _return_value_ = easyar_ListOfTarget_at(cdata_, index);
easyar_Target__retain(_return_value_, &_return_value_);
return new Target(_return_value_);
}
#endif
}
#endif
fileFormatVersion: 2
guid: 926b73a34a10ca94ba4483eeb99dbbdc
timeCreated: 1611716672
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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"
/// <summary>
/// Result of `ImageTracker`_ .
/// </summary>
@interface easyar_ImageTrackerResult : easyar_TargetTrackerResult
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Returns the list of `TargetInstance`_ contained in the result.
/// </summary>
- (NSArray<easyar_TargetInstance *> *)targetInstances;
/// <summary>
/// Sets the list of `TargetInstance`_ contained in the result.
/// </summary>
- (void)setTargetInstances:(NSArray<easyar_TargetInstance *> *)instances;
@end
/// <summary>
/// ImageTracker implements image target detection and tracking.
/// ImageTracker occupies (1 + SimultaneousNum) buffers of camera. Use setBufferCapacity of camera to set an amount of buffers that is not less than the sum of amount of buffers occupied by all components. Refer to `Overview &lt;Overview.html&gt;`__ .
/// After creation, you can call start/stop to enable/disable the track process. start and stop are very lightweight calls.
/// When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
/// ImageTracker inputs `FeedbackFrame`_ from feedbackFrameSink. `FeedbackFrameSource`_ shall be connected to feedbackFrameSink for use. Refer to `Overview &lt;Overview.html&gt;`__ .
/// Before a `Target`_ can be tracked by ImageTracker, you have to load it using loadTarget/unloadTarget. You can get load/unload results from callbacks passed into the interfaces.
/// </summary>
@interface easyar_ImageTracker : easyar_RefBase
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/// <summary>
/// Returns true.
/// </summary>
+ (bool)isAvailable;
/// <summary>
/// `FeedbackFrame`_ input port. The InputFrame member of FeedbackFrame must have raw image, timestamp, and camera parameters.
/// </summary>
- (easyar_FeedbackFrameSink *)feedbackFrameSink;
/// <summary>
/// Camera buffers occupied in this component.
/// </summary>
- (int)bufferRequirement;
/// <summary>
/// `OutputFrame`_ output port.
/// </summary>
- (easyar_OutputFrameSource *)outputFrameSource;
/// <summary>
/// Creates an instance. The default track mode is `ImageTrackerMode.PreferQuality`_ .
/// </summary>
+ (easyar_ImageTracker *)create;
/// <summary>
/// Creates an instance with a specified track mode. On lower-end phones, `ImageTrackerMode.PreferPerformance`_ can be used to keep a better performance with a little quality loss.
/// </summary>
+ (easyar_ImageTracker *)createWithMode:(easyar_ImageTrackerMode)trackMode;
/// <summary>
/// Starts the track algorithm.
/// </summary>
- (bool)start;
/// <summary>
/// Stops the track algorithm. Call start to start the track again.
/// </summary>
- (void)stop;
/// <summary>
/// Close. The component shall not be used after calling close.
/// </summary>
- (void)close;
/// <summary>
/// Load a `Target`_ into the tracker. A Target can only be tracked by tracker after a successful load.
/// This method is an asynchronous method. A load operation may take some time to finish and detection of a new/lost target may take more time during the load. The track time after detection will not be affected. If you want to know the load result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
- (void)loadTarget:(easyar_Target *)target callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_Target * target, bool status))callback;
/// <summary>
/// Unload a `Target`_ from the tracker.
/// This method is an asynchronous method. An unload operation may take some time to finish and detection of a new/lost target may take more time during the unload. If you want to know the unload result, you have to handle the callback data. The callback will be called from the thread specified by `CallbackScheduler`_ . It will not block the track thread or any other operations except other load/unload.
/// </summary>
- (void)unloadTarget:(easyar_Target *)target callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_Target * target, bool status))callback;
/// <summary>
/// Returns current loaded targets in the tracker. If an asynchronous load/unload is in progress, the returned value will not reflect the result until all load/unload finish.
/// </summary>
- (NSArray<easyar_Target *> *)targets;
/// <summary>
/// Sets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
- (bool)setSimultaneousNum:(int)num;
/// <summary>
/// Gets the max number of targets which will be the simultaneously tracked by the tracker. The default value is 1.
/// </summary>
- (int)simultaneousNum;
@end
fileFormatVersion: 2
guid: 1b85b337a80a61044a477cdf94f2ef87
timeCreated: 1611716671
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//=============================================================================================================================
//
// EasyAR Sense 4.2.0.8700-7bcbc8b1c
// Copyright (c) 2015-2021 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.
//
//=============================================================================================================================
#ifndef __EASYAR_JNIUTILITY_H__
#define __EASYAR_JNIUTILITY_H__
#include "easyar/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/// <summary>
/// Wraps Java&#39;s byte[]。
/// </summary>
void easyar_JniUtility_wrapByteArray(void * bytes, bool readOnly, easyar_FunctorOfVoid deleter, /* OUT */ easyar_Buffer * * Return);
/// <summary>
/// Wraps Java&#39;s java.nio.ByteBuffer, which must be a direct buffer.
/// </summary>
void easyar_JniUtility_wrapBuffer(void * directBuffer, easyar_FunctorOfVoid deleter, /* OUT */ easyar_Buffer * * Return);
/// <summary>
/// Get the raw address of a direct buffer of java.nio.ByteBuffer by calling JNIEnv-&gt;GetDirectBufferAddress.
/// </summary>
void * easyar_JniUtility_getDirectBufferAddress(void * directBuffer);
#ifdef __cplusplus
}
#endif
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment