/// <summary> /// Initialises the ARToolKit. /// </summary> /// <param name="pattSize"></param> /// <param name="pattCountMax"></param> /// <returns>true if successful, false if an error occurred.</returns> /// <remarks>For any square template (pattern) markers, the number of rows and columns in the template defaults to AR_PATT_SIZE1 and the maximum number of markers that may be loaded for a single matching pass defaults to AR_PATT_NUM_MAX.</remarks> /// <seealso cref="arwShutdownAR"/> public bool arwInitialiseAR() { string dllDir = ""; dllDir = Environment.GetEnvironmentVariable("ARTOOLKIT5_ROOT64"); if (string.IsNullOrEmpty(dllDir)) { dllDir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); } if (dllDir.Equals("")) { throw new System.Exception("ARToolKitCSharpIntegration.ARToolKitFunctions.arwInitialiseAR(): ARTOOLKIT5_ROOT64 not set. Please set ARTOOLKIT5_ROOT64 in your environment variables to the path where you installed ARToolKit to."); } else { SetDllDirectory(dllDir + "\\"); } bool ok; ok = ARNativePlugin.arwInitialiseAR(); if (ok) { inited = true; } return(ok); }
public static bool arwGetVideoParamsStereo(out int widthL, out int heightL, out int pixelSizeL, out String pixelFormatL, out int widthR, out int heightR, out int pixelSizeR, out String pixelFormatR) { StringBuilder sbL = new StringBuilder(128); StringBuilder sbR = new StringBuilder(128); bool ok; if (Application.platform == RuntimePlatform.IPhonePlayer) { ok = ARNativePluginStatic.arwGetVideoParamsStereo(out widthL, out heightL, out pixelSizeL, sbL, sbL.Capacity, out widthR, out heightR, out pixelSizeR, sbR, sbR.Capacity); } else { ok = ARNativePlugin.arwGetVideoParamsStereo(out widthL, out heightL, out pixelSizeL, sbL, sbL.Capacity, out widthR, out heightR, out pixelSizeR, sbR, sbR.Capacity); } if (!ok) { pixelFormatL = ""; pixelFormatR = ""; } else { pixelFormatL = sbL.ToString(); pixelFormatR = sbR.ToString(); } return(ok); }
public bool arwGetMarkerPatternImage(int markerID, int patternID, [In, Out] Color[] colors) { bool ok; ok = ARNativePlugin.arwGetMarkerPatternImage(markerID, patternID, colors); return(ok); }
public bool arwUpdateARToolKit(byte[] imageBytes, bool doDatums) { bool ok = false; GCHandle handle = GCHandle.Alloc(imageBytes, GCHandleType.Pinned); IntPtr address = handle.AddrOfPinnedObject(); ok = ARNativePlugin.arwUpdateARToolKit(address, doDatums); handle.Free(); return(ok); }
// Uses 4 calibration factors public float arwCalibChessboardCornersSimple(int numImages, string file_name, out float[] projectErrorResults) { projectErrorResults = new float[numImages]; GCHandle handle = GCHandle.Alloc(projectErrorResults, GCHandleType.Pinned); IntPtr address = handle.AddrOfPinnedObject(); float averageProjectionError = ARNativePlugin.arwCalibChessboardCornersSimple(file_name, address); handle.Free(); return(averageProjectionError); }
public bool arwQueryTrackableMapperTransformation(int gMapUID, int trackableUID, double[] matrix) { GCHandle handle1 = GCHandle.Alloc(matrix, GCHandleType.Pinned); IntPtr address1 = handle1.AddrOfPinnedObject(); bool ret = ARNativePlugin.arwQueryTrackableMapperTransformation(gMapUID, trackableUID, address1); handle1.Free(); return(ret); }
public bool arwUpdateTexture32([In, Out] Color32[] colors32) { bool ok; GCHandle handle = GCHandle.Alloc(colors32, GCHandleType.Pinned); IntPtr address = handle.AddrOfPinnedObject(); ok = ARNativePlugin.arwUpdateTexture32(address); handle.Free(); return(ok); }
public static bool arwQueryMarkerVisibility(int markerID) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwQueryMarkerVisibility(markerID)); } else { return(ARNativePlugin.arwQueryMarkerVisibility(markerID)); } }
public static bool arwQueryMarkerTransformationStereo(int markerID, float[] matrixL, float[] matrixR) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwQueryMarkerTransformationStereo(markerID, matrixL, matrixR)); } else { return(ARNativePlugin.arwQueryMarkerTransformationStereo(markerID, matrixL, matrixR)); } }
public static bool arwRemoveMarker(int markerID) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwRemoveMarker(markerID)); } else { return(ARNativePlugin.arwRemoveMarker(markerID)); } }
public static int arwRemoveAllMarkers() { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwRemoveAllMarkers()); } else { return(ARNativePlugin.arwRemoveAllMarkers()); } }
public static void arwSetTrackerOptionFloat(int option, float value) { if (Application.platform == RuntimePlatform.IPhonePlayer) { ARNativePluginStatic.arwSetTrackerOptionFloat(option, value); } else { ARNativePlugin.arwSetTrackerOptionFloat(option, value); } }
public static int arwAddMarker(string cfg) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwAddMarker(cfg)); } else { return(ARNativePlugin.arwAddMarker(cfg)); } }
public static void arwSetNFTMultiMode(bool on) { if (Application.platform == RuntimePlatform.IPhonePlayer) { ARNativePluginStatic.arwSetNFTMultiMode(on); } else { ARNativePlugin.arwSetNFTMultiMode(on); } }
public static bool arwGetProjectionMatrixStereo(float[] matrixL, float[] matrixR) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwGetProjectionMatrixStereo(matrixL, matrixR)); } else { return(ARNativePlugin.arwGetProjectionMatrixStereo(matrixL, matrixR)); } }
public static bool arwGetTrackableAppearanceConfig(int markerID, int patternID, float[] matrix, out float width, out float height, out int imageSizeX, out int imageSizeY) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwGetTrackableAppearanceConfig(markerID, patternID, matrix, out width, out height, out imageSizeX, out imageSizeY)); } else { return(ARNativePlugin.arwGetTrackableAppearanceConfig(markerID, patternID, matrix, out width, out height, out imageSizeX, out imageSizeY)); } }
public static bool arwGetNFTMultiMode() { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwGetNFTMultiMode()); } else { return(ARNativePlugin.arwGetNFTMultiMode()); } }
public static int arwGetTrackableAppearanceCount(int markerID) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwGetTrackableAppearanceCount(markerID)); } else { return(ARNativePlugin.arwGetTrackableAppearanceCount(markerID)); } }
public static bool arwUpdateAR() { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwUpdateAR()); } else { return(ARNativePlugin.arwUpdateAR()); } }
public static bool arwLoadOpticalParams(string optical_param_name, byte[] optical_param_buff, int optical_param_buffLen, out float fovy_p, out float aspect_p, float[] m, float[] p) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwLoadOpticalParams(optical_param_name, optical_param_buff, optical_param_buffLen, out fovy_p, out aspect_p, m, p)); } else { return(ARNativePlugin.arwLoadOpticalParams(optical_param_name, optical_param_buff, optical_param_buffLen, out fovy_p, out aspect_p, m, p)); } }
public static void arwSetLogLevel(int logLevel) { if (Application.platform == RuntimePlatform.IPhonePlayer) { ARNativePluginStatic.arwSetLogLevel(logLevel); } else { ARNativePlugin.arwSetLogLevel(logLevel); } }
public static bool arwStartRunningB(string vconf, byte[] cparaBuff, int cparaBuffLen, float nearPlane, float farPlane) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwStartRunningB(vconf, cparaBuff, cparaBuffLen, nearPlane, farPlane)); } else { return(ARNativePlugin.arwStartRunningB(vconf, cparaBuff, cparaBuffLen, nearPlane, farPlane)); } }
public static void arwSetImageProcMode(int mode) { if (Application.platform == RuntimePlatform.IPhonePlayer) { ARNativePluginStatic.arwSetImageProcMode(mode); } else { ARNativePlugin.arwSetImageProcMode(mode); } }
public static bool arwStartRunningStereoB(string vconfL, byte[] cparaBuffL, int cparaBuffLenL, string vconfR, byte[] cparaBuffR, int cparaBuffLenR, byte[] transL2RBuff, int transL2RBuffLen, float nearPlane, float farPlane) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwStartRunningStereoB(vconfL, cparaBuffL, cparaBuffLenL, vconfR, cparaBuffR, cparaBuffLenR, transL2RBuff, transL2RBuffLen, nearPlane, farPlane)); } else { return(ARNativePlugin.arwStartRunningStereoB(vconfL, cparaBuffL, cparaBuffLenL, vconfR, cparaBuffR, cparaBuffLenR, transL2RBuff, transL2RBuffLen, nearPlane, farPlane)); } }
public static int arwGetTrackableOptionInt(int markerID, int option) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwGetTrackableOptionInt(markerID, option)); } else { return(ARNativePlugin.arwGetTrackableOptionInt(markerID, option)); } }
public static int arwGetError() { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwGetError()); } else { return(ARNativePlugin.arwGetError()); } }
/// <summary> /// Shuts down the ARToolKit and frees all resources. /// N.B.: If this is being called from the destructor of the same module which /// supplied the log callback, be sure to set the logCallback = NULL /// prior to calling this function. /// </summary> /// <returns>true if successful, false if an error occurred.</returns> /// <seealso cref="arwInitialiseAR"/> public bool arwShutdownAR() { bool ok = false; ok = ARNativePlugin.arwShutdownAR(); if (ok) { inited = false; } return(ok); }
public static void arwSetTrackableOptionInt(int markerID, int option, int value) { if (Application.platform == RuntimePlatform.IPhonePlayer) { ARNativePluginStatic.arwSetTrackableOptionInt(markerID, option, value); } else { ARNativePlugin.arwSetTrackableOptionInt(markerID, option, value); } }
public static float arwGetTrackerOptionFloat(int option) { if (Application.platform == RuntimePlatform.IPhonePlayer) { return(ARNativePluginStatic.arwGetTrackerOptionFloat(option)); } else { return(ARNativePlugin.arwGetTrackerOptionFloat(option)); } }
public static void arwSetMatrixCodeType(int type) { if (Application.platform == RuntimePlatform.IPhonePlayer) { ARNativePluginStatic.arwSetMatrixCodeType(type); } else { ARNativePlugin.arwSetMatrixCodeType(type); } }