@webarkit/jsartoolkit-nft
Advanced tools
Comparing version 1.3.2 to 1.4.0
@@ -61,3 +61,3 @@ var scope; | ||
this.version = '1.3.2'; | ||
this.version = '1.4.0'; | ||
console.info('JsartoolkitNFT ', this.version); | ||
@@ -458,5 +458,3 @@ | ||
getNFTMarker(markerIndex) { | ||
if (0 === artoolkitNFT.getNFTMarker(this.id, markerIndex)) { | ||
return artoolkitNFT.NFTMarkerInfo; | ||
} | ||
return artoolkitNFT.getNFTMarker(this.id, markerIndex); | ||
}; | ||
@@ -695,11 +693,7 @@ | ||
var params = artoolkitNFT.frameMalloc; | ||
this.framepointer = params.framepointer; | ||
this.framesize = params.framesize; | ||
this.videoLumaPointer = params.videoLumaPointer; | ||
this.framesize = this.width * this.height; | ||
this.dataHeap = new Uint8Array(Module.HEAPU8.buffer, this.framepointer, this.framesize); | ||
this.videoLuma = new Uint8Array(Module.HEAPU8.buffer, this.videoLumaPointer, this.framesize / 4); | ||
this.videoLuma = new Uint8Array(this.framesize / 4); | ||
this.camera_mat = new Float64Array(Module.HEAPU8.buffer, params.camera, 16); | ||
this.camera_mat = artoolkitNFT.getCameraLens(this.id); | ||
@@ -757,6 +751,7 @@ this.setProjectionNearPlane(0.1); | ||
if (this.dataHeap) { | ||
this.dataHeap.set(data); | ||
if (this.videoLuma) { | ||
artoolkitNFT.passVideoData(this.id, data, this.videoLuma); | ||
return true; | ||
} | ||
return false; | ||
@@ -904,2 +899,5 @@ }; | ||
'getImageProcMode', | ||
"getCameraLens", | ||
"passVideoData", | ||
]; | ||
@@ -906,0 +904,0 @@ |
@@ -0,0 +0,0 @@ var browser = (function () { |
@@ -13,25 +13,25 @@ ; (function () { | ||
/** | ||
The ARControllerNFT is the main object for doing AR marker detection with JSARToolKit. | ||
/** | ||
The ARControllerNFT is the main object for doing AR marker detection with JSARToolKit. | ||
To use an ARControllerNFT, you need to tell it the dimensions to use for the AR processing canvas and | ||
pass it an ARCameraParamNFT to define the camera parameters to use when processing images. | ||
The ARCameraParamNFT defines the lens distortion and aspect ratio of the camera used. | ||
See https://www.artoolworks.com/support/library/Calibrating_your_camera for more information about AR camera parameters and how to make and use them. | ||
To use an ARControllerNFT, you need to tell it the dimensions to use for the AR processing canvas and | ||
pass it an ARCameraParamNFT to define the camera parameters to use when processing images. | ||
The ARCameraParamNFT defines the lens distortion and aspect ratio of the camera used. | ||
See https://www.artoolworks.com/support/library/Calibrating_your_camera for more information about AR camera parameters and how to make and use them. | ||
If you pass an image as the first argument, the ARControllerNFT uses that as the image to process, | ||
using the dimensions of the image as AR processing canvas width and height. If the first argument | ||
to ARControllerNFT is an image, the second argument is used as the camera param. | ||
If you pass an image as the first argument, the ARControllerNFT uses that as the image to process, | ||
using the dimensions of the image as AR processing canvas width and height. If the first argument | ||
to ARControllerNFT is an image, the second argument is used as the camera param. | ||
The camera parameters argument can be either an ARCameraParamNFT or an URL to a camera definition file. | ||
If the camera argument is an URL, it is loaded into a new ARCameraParamNFT, and the ARControllerNFT dispatches | ||
a 'load' event and calls the onload method if it is defined. | ||
The camera parameters argument can be either an ARCameraParamNFT or an URL to a camera definition file. | ||
If the camera argument is an URL, it is loaded into a new ARCameraParamNFT, and the ARControllerNFT dispatches | ||
a 'load' event and calls the onload method if it is defined. | ||
@exports ARControllerNFT | ||
@constructor | ||
@exports ARControllerNFT | ||
@constructor | ||
@param {number} width The width of the images to process. | ||
@param {number} height The height of the images to process. | ||
@param {ARCameraParamNFT | string} camera The ARCameraParamNFT to use for image processing. If this is a string, the ARControllerNFT treats it as an URL and tries to load it as a ARCameraParamNFT definition file, calling ARControllerNFT#onload on success. | ||
*/ | ||
@param {number} width The width of the images to process. | ||
@param {number} height The height of the images to process. | ||
@param {ARCameraParamNFT | string} camera The ARCameraParamNFT to use for image processing. If this is a string, the ARControllerNFT treats it as an URL and tries to load it as a ARCameraParamNFT definition file, calling ARControllerNFT#onload on success. | ||
*/ | ||
var ARControllerNFT = function (width, height, cameraPara) { | ||
@@ -65,3 +65,3 @@ this.id = undefined; | ||
this.version = '1.3.2'; | ||
this.version = '1.4.0'; | ||
console.info('JsartoolkitNFT ', this.version); | ||
@@ -83,8 +83,8 @@ console.warn("This library is deprecated, use the ES6 version instead!! It will be removed in a future release.") | ||
/** | ||
Destroys the ARControllerNFT instance and frees all associated resources. | ||
After calling dispose, the ARControllerNFT can't be used any longer. Make a new one if you need one. | ||
/** | ||
Destroys the ARControllerNFT instance and frees all associated resources. | ||
After calling dispose, the ARControllerNFT can't be used any longer. Make a new one if you need one. | ||
Calling this avoids leaking Emscripten memory, which may be important if you're using multiple ARControllerNFTs. | ||
*/ | ||
Calling this avoids leaking Emscripten memory, which may be important if you're using multiple ARControllerNFTs. | ||
*/ | ||
ARControllerNFT.prototype.dispose = function () { | ||
@@ -101,6 +101,6 @@ // It is possible to call dispose on an ARControllerNFT that was never initialized. But if it was never initialized the id is undefined. | ||
/** | ||
Detects markers in the given image. The process method dispatches marker detection events during its run. | ||
/** | ||
Detects markers in the given image. The process method dispatches marker detection events during its run. | ||
The marker detection process proceeds by first dispatching a markerNum event that tells you how many | ||
The marker detection process proceeds by first dispatching a markerNum event that tells you how many | ||
markers were found in the image. Next, a getMarker event is dispatched for each found marker square. | ||
@@ -110,32 +110,32 @@ | ||
Finally, getMultiMarker is dispatched for every found multimarker, followed by getMultiMarkerSub events | ||
dispatched for each of the markers in the multimarker. | ||
Finally, getMultiMarker is dispatched for every found multimarker, followed by getMultiMarkerSub events | ||
dispatched for each of the markers in the multimarker. | ||
ARControllerNFT.addEventListener('markerNum', function(ev) { | ||
console.log("Detected " + ev.data + " markers.") | ||
}); | ||
ARControllerNFT.addEventListener('getMarker', function(ev) { | ||
console.log("Detected marker with ids:", ev.data.marker.id, ev.data.marker.idPatt, ev.data.marker.idMatrix); | ||
console.log("Marker data", ev.data.marker); | ||
console.log("Marker transform matrix:", [].join.call(ev.data.matrix, ', ')); | ||
ARControllerNFT.addEventListener('markerNum', function(ev) { | ||
console.log("Detected " + ev.data + " markers.") | ||
}); | ||
ARControllerNFT.addEventListener('getMarker', function(ev) { | ||
console.log("Detected marker with ids:", ev.data.marker.id, ev.data.marker.idPatt, ev.data.marker.idMatrix); | ||
console.log("Marker data", ev.data.marker); | ||
console.log("Marker transform matrix:", [].join.call(ev.data.matrix, ', ')); | ||
}); | ||
ARControllerNFT.addEventListener('getNFTMarker', function(ev) { | ||
// do stuff | ||
}); | ||
ARControllerNFT.addEventListener('getMultiMarker', function(ev) { | ||
console.log("Detected multimarker with id:", ev.data.multiMarkerId); | ||
}); | ||
ARControllerNFT.addEventListener('getMultiMarkerSub', function(ev) { | ||
console.log("Submarker for " + ev.data.multiMarkerId, ev.data.markerIndex, ev.data.marker); | ||
}); | ||
// do stuff | ||
}); | ||
ARControllerNFT.addEventListener('getMultiMarker', function(ev) { | ||
console.log("Detected multimarker with id:", ev.data.multiMarkerId); | ||
}); | ||
ARControllerNFT.addEventListener('getMultiMarkerSub', function(ev) { | ||
console.log("Submarker for " + ev.data.multiMarkerId, ev.data.markerIndex, ev.data.marker); | ||
}); | ||
ARControllerNFT.process(image); | ||
ARControllerNFT.process(image); | ||
If no image is given, defaults to this.image. | ||
If no image is given, defaults to this.image. | ||
If the debugSetup has been called, draws debug markers on the debug canvas. | ||
If the debugSetup has been called, draws debug markers on the debug canvas. | ||
@param {ImageElement | VideoElement} image The image to process [optional]. | ||
*/ | ||
@param {ImageElement | VideoElement} image The image to process [optional]. | ||
*/ | ||
ARControllerNFT.prototype.process = function (image) { | ||
@@ -209,6 +209,6 @@ var result = this.detectMarker(image); | ||
}; | ||
/** | ||
Detects the NFT markers in the process() function, | ||
with the given tracked id. | ||
*/ | ||
/** | ||
Detects the NFT markers in the process() function, | ||
with the given tracked id. | ||
*/ | ||
ARControllerNFT.prototype.detectNFTMarker = function () { | ||
@@ -218,14 +218,14 @@ artoolkitNFT.detectNFTMarker(this.id); | ||
/** | ||
Adds the given NFT marker ID to the index of tracked IDs. | ||
Sets the markerWidth for the pattern marker to markerWidth. | ||
/** | ||
Adds the given NFT marker ID to the index of tracked IDs. | ||
Sets the markerWidth for the pattern marker to markerWidth. | ||
Used by process() to implement continuous tracking, | ||
keeping track of the marker's transformation matrix | ||
and customizable marker widths. | ||
Used by process() to implement continuous tracking, | ||
keeping track of the marker's transformation matrix | ||
and customizable marker widths. | ||
@param {number} id ID of the NFT marker to track. | ||
@param {number} markerWidth The width of the marker to track. | ||
@return {Object} The marker tracking object. | ||
*/ | ||
@param {number} id ID of the NFT marker to track. | ||
@param {number} markerWidth The width of the marker to track. | ||
@return {Object} The marker tracking object. | ||
*/ | ||
ARControllerNFT.prototype.trackNFTMarkerId = function (id, markerWidth) { | ||
@@ -248,13 +248,13 @@ var obj = this.nftMarkers[id]; | ||
/** | ||
Add an event listener on this ARControllerNFT for the named event, calling the callback function | ||
whenever that event is dispatched. | ||
/** | ||
Add an event listener on this ARControllerNFT for the named event, calling the callback function | ||
whenever that event is dispatched. | ||
Possible events are: | ||
* getNFTMarker - dispatched whenever process() finds a NFT marker | ||
* load - dispatched when the ARControllerNFT is ready to use (useful if passing in a camera URL in the constructor) | ||
Possible events are: | ||
* getNFTMarker - dispatched whenever process() finds a NFT marker | ||
* load - dispatched when the ARControllerNFT is ready to use (useful if passing in a camera URL in the constructor) | ||
@param {string} name Name of the event to listen to. | ||
@param {function} callback Callback function to call when an event with the given name is dispatched. | ||
*/ | ||
@param {string} name Name of the event to listen to. | ||
@param {function} callback Callback function to call when an event with the given name is dispatched. | ||
*/ | ||
ARControllerNFT.prototype.addEventListener = function (name, callback) { | ||
@@ -267,8 +267,8 @@ if (!this.listeners[name]) { | ||
/** | ||
Remove an event listener from the named event. | ||
/** | ||
Remove an event listener from the named event. | ||
@param {string} name Name of the event to stop listening to. | ||
@param {function} callback Callback function to remove from the listeners of the named event. | ||
*/ | ||
@param {string} name Name of the event to stop listening to. | ||
@param {function} callback Callback function to remove from the listeners of the named event. | ||
*/ | ||
ARControllerNFT.prototype.removeEventListener = function (name, callback) { | ||
@@ -283,7 +283,7 @@ if (this.listeners[name]) { | ||
/** | ||
Dispatches the given event to all registered listeners on event.name. | ||
/** | ||
Dispatches the given event to all registered listeners on event.name. | ||
@param {Object} event Event to dispatch. | ||
*/ | ||
@param {Object} event Event to dispatch. | ||
*/ | ||
ARControllerNFT.prototype.dispatchEvent = function (event) { | ||
@@ -298,7 +298,7 @@ var listeners = this.listeners[event.name]; | ||
/** | ||
Sets up a debug canvas for the AR detection. Draws a red marker on top of each detected square in the image. | ||
/** | ||
Sets up a debug canvas for the AR detection. Draws a red marker on top of each detected square in the image. | ||
The debug canvas is added to document.body. | ||
*/ | ||
The debug canvas is added to document.body. | ||
*/ | ||
ARControllerNFT.prototype.debugSetup = function () { | ||
@@ -309,14 +309,14 @@ this.setDebugMode(true); | ||
/** | ||
Loads an NFT marker from the given URL prefix and calls the onSuccess callback with the UID of the marker. | ||
/** | ||
Loads an NFT marker from the given URL prefix and calls the onSuccess callback with the UID of the marker. | ||
ARControllerNFT.loadNFTMarker(markerURL, onSuccess, onError); | ||
ARControllerNFT.loadNFTMarker(markerURL, onSuccess, onError); | ||
@param {string} markerURLs - List of the URL prefix of the NFT markers to load. | ||
@param {function} onSuccess - The success callback. Called with the id of the loaded marker on a successful load. | ||
@param {function} onError - The error callback. Called with the encountered error if the load fails. | ||
*/ | ||
@param {string} markerURLs - List of the URL prefix of the NFT markers to load. | ||
@param {function} onSuccess - The success callback. Called with the id of the loaded marker on a successful load. | ||
@param {function} onError - The error callback. Called with the encountered error if the load fails. | ||
*/ | ||
ARControllerNFT.prototype.loadNFTMarkers = function (markerURLs, onSuccess, onError) { | ||
var self = this; | ||
artoolkitNFT.addNFTMarkers(this.id, markerURLs, function(ids) { | ||
artoolkitNFT.addNFTMarkers(this.id, markerURLs, function (ids) { | ||
self.nftMarkerCount += ids.length; | ||
@@ -329,12 +329,12 @@ onSuccess(ids); | ||
if (markerURL) { | ||
this.loadNFTMarkers([markerURL], function(ids) { | ||
onSuccess(ids[0]); | ||
this.loadNFTMarkers([markerURL], function (ids) { | ||
onSuccess(ids[0]); | ||
}, onError); | ||
} else { | ||
if (onError) { | ||
onError("Marker URL needs to be defined and not equal empty string!"); | ||
} | ||
else { | ||
console.error("Marker URL needs to be defined and not equal empty string!"); | ||
} | ||
if (onError) { | ||
onError("Marker URL needs to be defined and not equal empty string!"); | ||
} | ||
else { | ||
console.error("Marker URL needs to be defined and not equal empty string!"); | ||
} | ||
} | ||
@@ -344,12 +344,12 @@ | ||
/** | ||
Converts the given 3x4 marker transformation matrix in the 12-element transMat array | ||
into a 4x4 WebGL matrix and writes the result into the 16-element glMat array. | ||
/** | ||
Converts the given 3x4 marker transformation matrix in the 12-element transMat array | ||
into a 4x4 WebGL matrix and writes the result into the 16-element glMat array. | ||
If scale parameter is given, scales the transform of the glMat by the scale parameter. | ||
If scale parameter is given, scales the transform of the glMat by the scale parameter. | ||
@param {Float64Array} transMat The 3x4 marker transformation matrix. | ||
@param {Float64Array} glMat The 4x4 GL transformation matrix. | ||
@param {number} scale The scale for the transform. | ||
*/ | ||
@param {Float64Array} transMat The 3x4 marker transformation matrix. | ||
@param {Float64Array} glMat The 4x4 GL transformation matrix. | ||
@param {number} scale The scale for the transform. | ||
*/ | ||
ARControllerNFT.prototype.transMatToGLMat = function (transMat, glMat, scale) { | ||
@@ -431,6 +431,6 @@ if (glMat == undefined) { | ||
}; | ||
/** | ||
This is the core ARToolKit marker detection function. It calls through to a set of | ||
internal functions to perform the key marker detection steps of binarization and | ||
labelling, contour extraction, and template matching and/or matrix code extraction. | ||
/** | ||
This is the core ARToolKit marker detection function. It calls through to a set of | ||
internal functions to perform the key marker detection steps of binarization and | ||
labelling, contour extraction, and template matching and/or matrix code extraction. | ||
@@ -443,6 +443,6 @@ Typically, the resulting set of detected markers is retrieved by calling arGetMarkerNum | ||
@param {image} Image to be processed to detect markers. | ||
@return {number} 0 if the function proceeded without error, or a value less than 0 in case of error. | ||
A result of 0 does not however, imply any markers were detected. | ||
*/ | ||
@param {image} Image to be processed to detect markers. | ||
@return {number} 0 if the function proceeded without error, or a value less than 0 in case of error. | ||
A result of 0 does not however, imply any markers were detected. | ||
*/ | ||
ARControllerNFT.prototype.detectMarker = function (image) { | ||
@@ -460,5 +460,5 @@ if (this._copyImageToHeap(image)) { | ||
Returns undefined if no marker was found. | ||
Returns undefined if no marker was found. | ||
A markerIndex of -1 is used to access the global custom marker. | ||
A markerIndex of -1 is used to access the global custom marker. | ||
@@ -469,5 +469,3 @@ @param {number} markerIndex The index of the NFT marker to query. | ||
ARControllerNFT.prototype.getNFTMarker = function (markerIndex) { | ||
if (0 === artoolkitNFT.getNFTMarker(this.id, markerIndex)) { | ||
return artoolkitNFT.NFTMarkerInfo; | ||
} | ||
return artoolkitNFT.getNFTMarker(this.id, markerIndex); | ||
}; | ||
@@ -484,10 +482,10 @@ | ||
/** | ||
Returns the 16-element WebGL transformation matrix used by ARControllerNFT.process to | ||
pass marker WebGL matrices to event listeners. | ||
/** | ||
Returns the 16-element WebGL transformation matrix used by ARControllerNFT.process to | ||
pass marker WebGL matrices to event listeners. | ||
Unique to each ARControllerNFT. | ||
Unique to each ARControllerNFT. | ||
@return {Float64Array} The 16-element WebGL transformation matrix used by the ARControllerNFT. | ||
*/ | ||
@return {Float64Array} The 16-element WebGL transformation matrix used by the ARControllerNFT. | ||
*/ | ||
ARControllerNFT.prototype.getTransformationMatrix = function () { | ||
@@ -497,7 +495,7 @@ return this.transform_mat; | ||
/** | ||
* Returns the projection matrix computed from camera parameters for the ARControllerNFT. | ||
* | ||
* @return {Float64Array} The 16-element WebGL camera matrix for the ARControllerNFT camera parameters. | ||
*/ | ||
/** | ||
* Returns the projection matrix computed from camera parameters for the ARControllerNFT. | ||
* | ||
* @return {Float64Array} The 16-element WebGL camera matrix for the ARControllerNFT camera parameters. | ||
*/ | ||
ARControllerNFT.prototype.getCameraMatrix = function () { | ||
@@ -509,9 +507,9 @@ return this.camera_mat; | ||
/** | ||
* Enables or disables debug mode in the tracker. When enabled, a black and white debug | ||
* image is generated during marker detection. The debug image is useful for visualising | ||
* the binarization process and choosing a threshold value. | ||
* @param {boolean} mode true to enable debug mode, false to disable debug mode | ||
* @see getDebugMode() | ||
*/ | ||
/** | ||
* Enables or disables debug mode in the tracker. When enabled, a black and white debug | ||
* image is generated during marker detection. The debug image is useful for visualising | ||
* the binarization process and choosing a threshold value. | ||
* @param {boolean} mode true to enable debug mode, false to disable debug mode | ||
* @see getDebugMode() | ||
*/ | ||
ARControllerNFT.prototype.setDebugMode = function (mode) { | ||
@@ -521,7 +519,7 @@ return artoolkitNFT.setDebugMode(this.id, mode); | ||
/** | ||
* Returns whether debug mode is currently enabled. | ||
* @return {boolean} true when debug mode is enabled, false when debug mode is disabled | ||
* @see setDebugMode() | ||
*/ | ||
/** | ||
* Returns whether debug mode is currently enabled. | ||
* @return {boolean} true when debug mode is enabled, false when debug mode is disabled | ||
* @see setDebugMode() | ||
*/ | ||
ARControllerNFT.prototype.getDebugMode = function () { | ||
@@ -531,7 +529,7 @@ return artoolkitNFT.getDebugMode(this.id); | ||
/** | ||
Returns the Emscripten HEAP offset to the debug processing image used by ARToolKit. | ||
/** | ||
Returns the Emscripten HEAP offset to the debug processing image used by ARToolKit. | ||
@return {number} HEAP offset to the debug processing image. | ||
*/ | ||
@return {number} HEAP offset to the debug processing image. | ||
*/ | ||
ARControllerNFT.prototype.getProcessingImage = function () { | ||
@@ -541,7 +539,7 @@ return artoolkitNFT.getProcessingImage(this.id); | ||
/** | ||
Sets the logging level to use by ARToolKit. | ||
/** | ||
Sets the logging level to use by ARToolKit. | ||
@param {number} mode type for the log level. | ||
*/ | ||
@param {number} mode type for the log level. | ||
*/ | ||
ARControllerNFT.prototype.setLogLevel = function (mode) { | ||
@@ -551,6 +549,6 @@ return artoolkitNFT.setLogLevel(mode); | ||
/** | ||
Gets the logging level used by ARToolKit. | ||
@return {number} return the log level in use. | ||
*/ | ||
/** | ||
Gets the logging level used by ARToolKit. | ||
@return {number} return the log level in use. | ||
*/ | ||
ARControllerNFT.prototype.getLogLevel = function () { | ||
@@ -560,7 +558,7 @@ return artoolkitNFT.getLogLevel(); | ||
/** | ||
Sets the value of the near plane of the camera. | ||
@param {number} value the value of the near plane | ||
@return {number} 0 (void) | ||
*/ | ||
/** | ||
Sets the value of the near plane of the camera. | ||
@param {number} value the value of the near plane | ||
@return {number} 0 (void) | ||
*/ | ||
ARControllerNFT.prototype.setProjectionNearPlane = function (value) { | ||
@@ -570,6 +568,6 @@ return artoolkitNFT.setProjectionNearPlane(this.id, value); | ||
/** | ||
Gets the value of the near plane of the camera with the give id. | ||
@return {number} the value of the near plane. | ||
*/ | ||
/** | ||
Gets the value of the near plane of the camera with the give id. | ||
@return {number} the value of the near plane. | ||
*/ | ||
ARControllerNFT.prototype.getProjectionNearPlane = function () { | ||
@@ -579,7 +577,7 @@ return artoolkitNFT.getProjectionNearPlane(this.id); | ||
/** | ||
Sets the value of the far plane of the camera. | ||
@param {number} value the value of the far plane | ||
@return {number} 0 (void) | ||
*/ | ||
/** | ||
Sets the value of the far plane of the camera. | ||
@param {number} value the value of the far plane | ||
@return {number} 0 (void) | ||
*/ | ||
ARControllerNFT.prototype.setProjectionFarPlane = function (value) { | ||
@@ -589,6 +587,6 @@ return artoolkitNFT.setProjectionFarPlane(this.id, value); | ||
/** | ||
Gets the value of the far plane of the camera with the give id. | ||
@return {number} the value of the far plane. | ||
*/ | ||
/** | ||
Gets the value of the far plane of the camera with the give id. | ||
@return {number} the value of the far plane. | ||
*/ | ||
ARControllerNFT.prototype.getProjectionFarPlane = function () { | ||
@@ -599,12 +597,12 @@ return artoolkitNFT.getProjectionFarPlane(this.id); | ||
/** | ||
Set the labeling threshold mode (auto/manual). | ||
/** | ||
Set the labeling threshold mode (auto/manual). | ||
@param {number} mode An integer specifying the mode. One of: | ||
AR_LABELING_THRESH_MODE_MANUAL, | ||
AR_LABELING_THRESH_MODE_AUTO_MEDIAN, | ||
AR_LABELING_THRESH_MODE_AUTO_OTSU, | ||
AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE, | ||
AR_LABELING_THRESH_MODE_AUTO_BRACKETING | ||
*/ | ||
@param {number} mode An integer specifying the mode. One of: | ||
AR_LABELING_THRESH_MODE_MANUAL, | ||
AR_LABELING_THRESH_MODE_AUTO_MEDIAN, | ||
AR_LABELING_THRESH_MODE_AUTO_OTSU, | ||
AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE, | ||
AR_LABELING_THRESH_MODE_AUTO_BRACKETING | ||
*/ | ||
ARControllerNFT.prototype.setThresholdMode = function (mode) { | ||
@@ -614,7 +612,7 @@ return artoolkitNFT.setThresholdMode(this.id, mode); | ||
/** | ||
* Gets the current threshold mode used for image binarization. | ||
* @return {number} The current threshold mode | ||
* @see getVideoThresholdMode() | ||
*/ | ||
/** | ||
* Gets the current threshold mode used for image binarization. | ||
* @return {number} The current threshold mode | ||
* @see getVideoThresholdMode() | ||
*/ | ||
ARControllerNFT.prototype.getThresholdMode = function () { | ||
@@ -624,4 +622,4 @@ return artoolkitNFT.getThresholdMode(this.id); | ||
/** | ||
Set the labeling threshhold. | ||
/** | ||
Set the labeling threshhold. | ||
@@ -639,12 +637,12 @@ This function forces sets the threshold value. | ||
Background: The labeling threshold is the value which | ||
the AR library uses to differentiate between black and white | ||
portions of an ARToolKit marker. Since the actual brightness, | ||
contrast, and gamma of incoming images can vary signficantly | ||
between different cameras and lighting conditions, this | ||
value typically needs to be adjusted dynamically to a | ||
suitable midpoint between the observed values for black | ||
and white portions of the markers in the image. | ||
the AR library uses to differentiate between black and white | ||
portions of an ARToolKit marker. Since the actual brightness, | ||
contrast, and gamma of incoming images can vary signficantly | ||
between different cameras and lighting conditions, this | ||
value typically needs to be adjusted dynamically to a | ||
suitable midpoint between the observed values for black | ||
and white portions of the markers in the image. | ||
@param {number} threshold An integer in the range [0,255] (inclusive). | ||
*/ | ||
@param {number} threshold An integer in the range [0,255] (inclusive). | ||
*/ | ||
ARControllerNFT.prototype.setThreshold = function (threshold) { | ||
@@ -654,17 +652,17 @@ return artoolkitNFT.setThreshold(this.id, threshold); | ||
/** | ||
Get the current labeling threshold. | ||
/** | ||
Get the current labeling threshold. | ||
This function queries the current labeling threshold. For, | ||
AR_LABELING_THRESH_MODE_AUTO_MEDIAN, AR_LABELING_THRESH_MODE_AUTO_OTSU, | ||
and AR_LABELING_THRESH_MODE_AUTO_BRACKETING | ||
the threshold value is only valid until the next auto-update. | ||
This function queries the current labeling threshold. For, | ||
AR_LABELING_THRESH_MODE_AUTO_MEDIAN, AR_LABELING_THRESH_MODE_AUTO_OTSU, | ||
and AR_LABELING_THRESH_MODE_AUTO_BRACKETING | ||
the threshold value is only valid until the next auto-update. | ||
The current threshold mode is not affected by this call. | ||
The current threshold mode is not affected by this call. | ||
The threshold value is not relevant if threshold mode is | ||
AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE. | ||
The threshold value is not relevant if threshold mode is | ||
AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE. | ||
@return {number} The current threshold value. | ||
*/ | ||
@return {number} The current threshold value. | ||
*/ | ||
ARControllerNFT.prototype.getThreshold = function () { | ||
@@ -674,4 +672,4 @@ return artoolkitNFT.getThreshold(this.id); | ||
/** | ||
Set the image processing mode. | ||
/** | ||
Set the image processing mode. | ||
@@ -690,19 +688,19 @@ When the image processing mode is AR_IMAGE_PROC_FRAME_IMAGE, | ||
@param {number} mode | ||
Options for this field are: | ||
AR_IMAGE_PROC_FRAME_IMAGE | ||
AR_IMAGE_PROC_FIELD_IMAGE | ||
The default mode is AR_IMAGE_PROC_FRAME_IMAGE. | ||
*/ | ||
ARControllerNFT.prototype.setImageProcMode = function(mode) { | ||
return artoolkitNFT.setImageProcMode(this.id, mode); | ||
}; | ||
@param {number} mode | ||
Options for this field are: | ||
AR_IMAGE_PROC_FRAME_IMAGE | ||
AR_IMAGE_PROC_FIELD_IMAGE | ||
The default mode is AR_IMAGE_PROC_FRAME_IMAGE. | ||
*/ | ||
ARControllerNFT.prototype.setImageProcMode = function (mode) { | ||
return artoolkitNFT.setImageProcMode(this.id, mode); | ||
}; | ||
/** | ||
Get the image processing mode. | ||
/** | ||
Get the image processing mode. | ||
See arSetImageProcMode() for a complete description. | ||
See arSetImageProcMode() for a complete description. | ||
@return {number} The current image processing mode. | ||
*/ | ||
@return {number} The current image processing mode. | ||
*/ | ||
ARControllerNFT.prototype.getImageProcMode = function () { | ||
@@ -724,11 +722,7 @@ return artoolkitNFT.getImageProcMode(this.id); | ||
var params = artoolkitNFT.frameMalloc; | ||
this.framepointer = params.framepointer; | ||
this.framesize = params.framesize; | ||
this.videoLumaPointer = params.videoLumaPointer; | ||
this.framesize = this.width * this.height; | ||
this.dataHeap = new Uint8Array(Module.HEAPU8.buffer, this.framepointer, this.framesize); | ||
this.videoLuma = new Uint8Array(Module.HEAPU8.buffer, this.videoLumaPointer, this.framesize / 4); | ||
this.videoLuma = new Uint8Array(this.framesize / 4); | ||
this.camera_mat = new Float64Array(Module.HEAPU8.buffer, params.camera, 16); | ||
this.camera_mat = artoolkitNFT.getCameraLens(this.id); | ||
@@ -749,6 +743,6 @@ this.setProjectionNearPlane(0.1); | ||
/** | ||
Init the necessary kpm handle for NFT and the settings for the CPU. | ||
@return {number} 0 (void) | ||
*/ | ||
/** | ||
Init the necessary kpm handle for NFT and the settings for the CPU. | ||
@return {number} 0 (void) | ||
*/ | ||
ARControllerNFT.prototype._initNFT = function () { | ||
@@ -758,6 +752,6 @@ artoolkitNFT.setupAR2(this.id); | ||
/** | ||
Copy the Image data to the HEAP for the debugSetup function. | ||
@return {number} 0 (void) | ||
*/ | ||
/** | ||
Copy the Image data to the HEAP for the debugSetup function. | ||
@return {number} 0 (void) | ||
*/ | ||
ARControllerNFT.prototype._copyImageToHeap = function (image) { | ||
@@ -788,6 +782,7 @@ if (!image) { | ||
if (this.dataHeap) { | ||
this.dataHeap.set(data); | ||
if (this.videoLuma) { | ||
artoolkitNFT.passVideoData(this.id, data, this.videoLuma); | ||
return true; | ||
} | ||
return false; | ||
@@ -797,20 +792,20 @@ }; | ||
// static | ||
/** | ||
ARCameraParamNFT is used for loading AR camera parameters for use with ARControllerNFT. | ||
Use by passing in an URL and a callback function. | ||
/** | ||
ARCameraParamNFT is used for loading AR camera parameters for use with ARControllerNFT. | ||
Use by passing in an URL and a callback function. | ||
var camera = new ARCameraParamNFT('Data/camera_para.dat', function() { | ||
console.log('loaded camera', this.id); | ||
}, | ||
function(err) { | ||
console.log('failed to load camera', err); | ||
}); | ||
var camera = new ARCameraParamNFT('Data/camera_para.dat', function() { | ||
console.log('loaded camera', this.id); | ||
}, | ||
function(err) { | ||
console.log('failed to load camera', err); | ||
}); | ||
@exports ARCameraParamNFT | ||
@constructor | ||
@exports ARCameraParamNFT | ||
@constructor | ||
@param {string} src URL to load camera parameters from. | ||
@param {Function} onload Onload callback to be called on successful parameter loading. | ||
@param {Function} onerror Error callback to called when things don't work out. | ||
*/ | ||
@param {string} src URL to load camera parameters from. | ||
@param {Function} onload Onload callback to be called on successful parameter loading. | ||
@param {Function} onerror Error callback to called when things don't work out. | ||
*/ | ||
var ARCameraParamNFT = function (src, onload, onerror) { | ||
@@ -842,9 +837,9 @@ this.id = -1; | ||
/** | ||
Loads the given URL as camera parameters definition file into this ARCameraParamNFT. | ||
/** | ||
Loads the given URL as camera parameters definition file into this ARCameraParamNFT. | ||
Can only be called on an unloaded ARCameraParamNFT instance. | ||
Can only be called on an unloaded ARCameraParamNFT instance. | ||
@param {string} src URL to load. | ||
*/ | ||
@param {string} src URL to load. | ||
*/ | ||
ARCameraParamNFT.prototype.load = function (src) { | ||
@@ -875,6 +870,6 @@ if (this._src !== '') { | ||
/** | ||
Destroys the camera parameter and frees associated Emscripten resources. | ||
/** | ||
Destroys the camera parameter and frees associated Emscripten resources. | ||
*/ | ||
*/ | ||
ARCameraParamNFT.prototype.dispose = function () { | ||
@@ -937,2 +932,5 @@ if (this.id !== -1) { | ||
'getImageProcMode', | ||
"getCameraLens", | ||
"passVideoData", | ||
]; | ||
@@ -939,0 +937,0 @@ |
@@ -0,0 +0,0 @@ import ARToolkitNFT from "../build/artoolkitNFT_embed_ES6_wasm.js"; |
{ | ||
"name": "@webarkit/jsartoolkit-nft", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"main": "dist/ARToolkitNFT.js", | ||
@@ -39,4 +39,4 @@ "types": "types/src/index.d.ts", | ||
"devDependencies": { | ||
"@babel/core": "^7.20.12", | ||
"@babel/plugin-transform-runtime": "^7.19.6", | ||
"@babel/core": "^7.21.0", | ||
"@babel/plugin-transform-runtime": "^7.21.0", | ||
"@babel/preset-env": "^7.20.2", | ||
@@ -51,3 +51,3 @@ "babel-loader": "^9.1.2", | ||
"ts-loader": "^9.4.2", | ||
"typedoc": "^0.23.25", | ||
"typedoc": "^0.23.26", | ||
"typescript": "^4.9.5", | ||
@@ -71,5 +71,5 @@ "webpack": "^5.75.0", | ||
"dependencies": { | ||
"@babel/runtime": "^7.20.13", | ||
"axios": "^1.3.3" | ||
"@babel/runtime": "^7.21.0", | ||
"axios": "^1.3.4" | ||
} | ||
} |
@@ -110,7 +110,7 @@ ![github releases](https://flat.badgen.net/github/release/webarkit/jsartoolkitNFT) | ||
Try [react-three-arnft](https://github.com/j-era/react-three-arnft) a specific project that use JsartoolkitNFT with React and Three.js. | ||
Try [react-three-arnft](https://github.com/j-era/react-three-arnft) a specific project that uses JsartoolkitNFT with React and Three.js. | ||
## ARnft library | ||
**JSARToolKitNFT** is used by [ARnft](https://github.com/webarkit/ARnft) a small libary that help developers to create **WebAR** apps. | ||
**JSARToolKitNFT** is used by [ARnft](https://github.com/webarkit/ARnft) a small library that helps developers to create **WebAR** apps. | ||
@@ -117,0 +117,0 @@ ## Project Structure 📂 |
@@ -13,3 +13,3 @@ import { IImageObj } from "./CommonInterfaces"; | ||
process: (image: IImageObj) => void; | ||
detectNFTMarker: () => void; | ||
detectNFTMarker: (videoLuma: any) => void; | ||
trackNFTMarkerId: (id: number, markerWidth?: number) => object; | ||
@@ -16,0 +16,0 @@ detectMarker: (image: any) => number; |
import { INFTMarkerInfo } from "./CommonInterfaces"; | ||
export interface IARToolkitNFT { | ||
getCameraLens: (cameraId: number) => any; | ||
passVideoData: ( | ||
id: number, | ||
videoFrame: Uint8ClampedArray, | ||
videoLuma: Uint8Array | ||
) => void; | ||
setup: { | ||
@@ -14,12 +20,2 @@ (width: number, height: number, cameraId: number): number; | ||
getLogLevel: () => number; | ||
frameMalloc: { | ||
framepointer: number; | ||
framesize: number; | ||
videoLumaPointer: number; | ||
camera: number; | ||
transform: number; | ||
}; | ||
HEAPU8: { | ||
buffer: Uint8Array; | ||
}; | ||
NFTMarkerInfo: INFTMarkerInfo; | ||
@@ -45,3 +41,3 @@ loadCamera: (cameraParam: string) => Promise<number>; | ||
detectNFTMarker: (arId: number) => void; | ||
getNFTMarker: (id: number, markerIndex: number) => number; | ||
getNFTMarker: (id: number, markerIndex: number) => INFTMarkerInfo; | ||
getNFTData: (id: number, index: number) => object; | ||
@@ -48,0 +44,0 @@ setImageProcMode: (id: number, mode: number) => number; |
@@ -57,3 +57,2 @@ /* | ||
private transform_mat: Float64Array; | ||
private marker_transform_mat: Float64Array; | ||
private transformGL_RH: Float64Array; | ||
@@ -63,5 +62,3 @@ private videoWidth: number; | ||
private videoSize: number; | ||
private framepointer: number; | ||
private framesize: number; | ||
private dataHeap: Uint8Array; | ||
private videoLuma: Uint8Array; | ||
@@ -71,3 +68,2 @@ private grayscaleEnabled: boolean; | ||
private camera_mat: Float64Array; | ||
private videoLumaPointer: number; | ||
private nftMarkerFound: boolean; // = false | ||
@@ -85,4 +81,4 @@ private nftMarkerFoundTime: number; | ||
* cameraLoaded, artoolkitNFT, listeners, nftMarkers, transform_mat, | ||
* transformGL_RH, marker_transform_mat, videoWidth, videoHeight, videoSize, | ||
* framepointer, framesize, dataHeap, videoLuma, camera_mat, videoLumaPointer | ||
* transformGL_RH, videoWidth, videoHeight, videoSize, | ||
* framesize, videoLuma, camera_mat. | ||
*/ | ||
@@ -95,4 +91,4 @@ constructor(); | ||
* cameraLoaded, artoolkitNFT, listeners, nftMarkers, transform_mat, | ||
* transformGL_RH, marker_transform_mat, videoWidth, videoHeight, videoSize, | ||
* framepointer, framesize, dataHeap, videoLuma, camera_mat, videoLumaPointer | ||
* transformGL_RH, videoWidth, videoHeight, videoSize, | ||
* framesize, videoLuma, camera_mat. | ||
* @param {number} width | ||
@@ -107,4 +103,4 @@ * @param {number} height | ||
* cameraLoaded, artoolkitNFT, listeners, nftMarkers, transform_mat, | ||
* transformGL_RH, marker_transform_mat, videoWidth, videoHeight, videoSize, | ||
* framepointer, framesize, dataHeap, videoLuma, camera_mat, videoLumaPointer | ||
* transformGL_RH, videoWidth, videoHeight, videoSize, | ||
* framesize, videoLuma, camera_mat. | ||
* @param {number} width | ||
@@ -138,3 +134,2 @@ * @param {number} height | ||
this.transformGL_RH = new Float64Array(16); | ||
this.marker_transform_mat = null; | ||
@@ -145,9 +140,6 @@ this.videoWidth = width; | ||
this.framepointer = null; | ||
this.framesize = null; | ||
this.dataHeap = null; | ||
this.videoLuma = null; | ||
this.grayscaleEnabled = false; | ||
this.camera_mat = null; | ||
this.videoLumaPointer = null; | ||
@@ -426,5 +418,3 @@ // this is to workaround the introduction of "self" variable | ||
getNFTMarker(markerIndex: number): INFTMarkerInfo { | ||
if (0 === this.artoolkitNFT.getNFTMarker(this.id, markerIndex)) { | ||
return this.artoolkitNFT.NFTMarkerInfo; | ||
} | ||
return this.artoolkitNFT.getNFTMarker(this.id, markerIndex); | ||
} | ||
@@ -875,28 +865,7 @@ | ||
const params: IARToolkitNFT["frameMalloc"] = this.artoolkitNFT.frameMalloc; | ||
this.framepointer = params.framepointer; | ||
this.framesize = params.framesize; | ||
this.videoLumaPointer = params.videoLumaPointer; | ||
this.framesize = this._width * this._height; | ||
this.dataHeap = new Uint8Array( | ||
this.artoolkitNFT.HEAPU8.buffer, | ||
this.framepointer, | ||
this.framesize | ||
); | ||
this.videoLuma = new Uint8Array( | ||
this.artoolkitNFT.HEAPU8.buffer, | ||
this.videoLumaPointer, | ||
this.framesize / 4 | ||
); | ||
this.videoLuma = new Uint8Array(this.framesize / 4); | ||
this.camera_mat = new Float64Array( | ||
this.artoolkitNFT.HEAPU8.buffer, | ||
params.camera, | ||
16 | ||
); | ||
this.marker_transform_mat = new Float64Array( | ||
this.artoolkitNFT.HEAPU8.buffer, | ||
params.transform, | ||
12 | ||
); | ||
this.camera_mat = this.artoolkitNFT.getCameraLens(this.id); | ||
@@ -962,8 +931,8 @@ this.setProjectionNearPlane(0.1); | ||
} else if (this.grayscaleEnabled == true) { | ||
this.videoLuma.set(this.grayscaleSource); | ||
this.videoLuma = this.grayscaleSource; | ||
} | ||
} | ||
if (this.dataHeap) { | ||
this.dataHeap.set(data); | ||
if (this.videoLuma) { | ||
this.artoolkitNFT.passVideoData(this.id, data, this.videoLuma); | ||
return true; | ||
@@ -970,0 +939,0 @@ } |
@@ -57,3 +57,2 @@ /* | ||
private transform_mat: Float64Array; | ||
private marker_transform_mat: Float64Array; | ||
private transformGL_RH: Float64Array; | ||
@@ -63,5 +62,3 @@ private videoWidth: number; | ||
private videoSize: number; | ||
private framepointer: number; | ||
private framesize: number; | ||
private dataHeap: Uint8Array; | ||
private videoLuma: Uint8Array; | ||
@@ -71,3 +68,2 @@ private grayscaleEnabled: boolean; | ||
private camera_mat: Float64Array; | ||
private videoLumaPointer: number; | ||
private nftMarkerFound: boolean; // = false | ||
@@ -85,4 +81,4 @@ private nftMarkerFoundTime: number; | ||
* cameraLoaded, artoolkitNFT, listeners, nftMarkers, transform_mat, | ||
* transformGL_RH, marker_transform_mat, videoWidth, videoHeight, videoSize, | ||
* framepointer, framesize, dataHeap, videoLuma, camera_mat, videoLumaPointer | ||
* transformGL_RH, videoWidth, videoHeight, videoSize, | ||
* videoLuma, framesize, camera_mat. | ||
*/ | ||
@@ -95,4 +91,4 @@ constructor(); | ||
* cameraLoaded, artoolkitNFT, listeners, nftMarkers, transform_mat, | ||
* transformGL_RH, marker_transform_mat, videoWidth, videoHeight, videoSize, | ||
* framepointer, framesize, dataHeap, videoLuma, camera_mat, videoLumaPointer | ||
* transformGL_RH, videoWidth, videoHeight, videoSize, | ||
* videoLuma, framesize, camera_mat. | ||
* @param {number} width | ||
@@ -107,4 +103,4 @@ * @param {number} height | ||
* cameraLoaded, artoolkitNFT, listeners, nftMarkers, transform_mat, | ||
* transformGL_RH, marker_transform_mat, videoWidth, videoHeight, videoSize, | ||
* framepointer, framesize, dataHeap, videoLuma, camera_mat, videoLumaPointer | ||
* transformGL_RH, videoWidth, videoHeight, videoSize, | ||
* framesize, camera_mat. | ||
* @param {number} width | ||
@@ -138,3 +134,2 @@ * @param {number} height | ||
this.transformGL_RH = new Float64Array(16); | ||
this.marker_transform_mat = null; | ||
@@ -145,9 +140,6 @@ this.videoWidth = width; | ||
this.framepointer = null; | ||
this.framesize = null; | ||
this.dataHeap = null; | ||
this.videoLuma = null; | ||
this.grayscaleEnabled = false; | ||
this.camera_mat = null; | ||
this.videoLumaPointer = null; | ||
@@ -426,5 +418,3 @@ // this is to workaround the introduction of "self" variable | ||
getNFTMarker(markerIndex: number): INFTMarkerInfo { | ||
if (0 === this.artoolkitNFT.getNFTMarker(this.id, markerIndex)) { | ||
return this.artoolkitNFT.NFTMarkerInfo; | ||
} | ||
return this.artoolkitNFT.getNFTMarker(this.id, markerIndex); | ||
} | ||
@@ -875,28 +865,7 @@ | ||
const params: IARToolkitNFT["frameMalloc"] = this.artoolkitNFT.frameMalloc; | ||
this.framepointer = params.framepointer; | ||
this.framesize = params.framesize; | ||
this.videoLumaPointer = params.videoLumaPointer; | ||
this.framesize = this._width * this._height; | ||
this.dataHeap = new Uint8Array( | ||
this.artoolkitNFT.HEAPU8.buffer, | ||
this.framepointer, | ||
this.framesize | ||
); | ||
this.videoLuma = new Uint8Array( | ||
this.artoolkitNFT.HEAPU8.buffer, | ||
this.videoLumaPointer, | ||
this.framesize / 4 | ||
); | ||
this.videoLuma = new Uint8Array(this.framesize / 4); | ||
this.camera_mat = new Float64Array( | ||
this.artoolkitNFT.HEAPU8.buffer, | ||
params.camera, | ||
16 | ||
); | ||
this.marker_transform_mat = new Float64Array( | ||
this.artoolkitNFT.HEAPU8.buffer, | ||
params.transform, | ||
12 | ||
); | ||
this.camera_mat = this.artoolkitNFT.getCameraLens(this.id); | ||
@@ -962,8 +931,8 @@ this.setProjectionNearPlane(0.1); | ||
} else if (this.grayscaleEnabled == true) { | ||
this.videoLuma.set(this.grayscaleSource); | ||
this.videoLuma = this.grayscaleSource; | ||
} | ||
} | ||
if (this.dataHeap) { | ||
this.dataHeap.set(data); | ||
if (this.videoLuma) { | ||
this.artoolkitNFT.passVideoData(this.id, data, this.videoLuma); | ||
return true; | ||
@@ -970,0 +939,0 @@ } |
@@ -38,2 +38,3 @@ /* | ||
import { IARToolkitNFT } from "./abstractions/IARToolkitNFT"; | ||
import { INFTMarkerInfo } from "./abstractions/CommonInterfaces"; | ||
import Utils from "./Utils"; | ||
@@ -46,6 +47,2 @@ import packageJson from "../package.json"; | ||
declare global { | ||
var artoolkitNFT: IARToolkitNFT; | ||
} | ||
export default class ARToolkitNFT implements IARToolkitNFT { | ||
@@ -71,16 +68,6 @@ static get UNKNOWN_MARKER() { | ||
public detectNFTMarker: (id: number) => number; | ||
public getNFTMarker: (id: number, markerIndex: number) => number; | ||
public getNFTMarker: (id: number, markerIndex: number) => INFTMarkerInfo; | ||
public getNFTData: (id: number, index: number) => object; | ||
public setLogLevel: (mode: boolean) => number; | ||
public getLogLevel: () => number; | ||
public frameMalloc: { | ||
framepointer: number; | ||
framesize: number; | ||
videoLumaPointer: number; | ||
camera: number; | ||
transform: number; | ||
}; | ||
public HEAPU8: { | ||
buffer: Uint8Array; | ||
}; | ||
public NFTMarkerInfo: { | ||
@@ -102,2 +89,8 @@ error: number; | ||
public getImageProcMode: (id: number) => number; | ||
public getCameraLens: (cameraId: number) => any; | ||
public passVideoData: ( | ||
id: number, | ||
videoFrame: Uint8ClampedArray, | ||
videoLuma: Uint8Array | ||
) => void; | ||
@@ -137,4 +130,4 @@ // construction | ||
let scope = typeof window !== "undefined" ? window : global; | ||
scope.artoolkitNFT = this; | ||
//let scope = typeof window !== "undefined" ? window : global; | ||
//scope.artoolkitNFT = this; | ||
@@ -171,3 +164,2 @@ return this; | ||
"frameMalloc", | ||
"NFTMarkerInfo", | ||
@@ -190,4 +182,6 @@ | ||
"getCameraLens", | ||
"passVideoData", | ||
"StringList", | ||
"HEAPU8", | ||
].forEach((method: string) => { | ||
@@ -194,0 +188,0 @@ this.converter()[method] = this.instance[method]; |
@@ -38,2 +38,3 @@ /* | ||
import { IARToolkitNFT } from "./abstractions/IARToolkitNFT"; | ||
import { INFTMarkerInfo } from "./abstractions/CommonInterfaces"; | ||
import Utils from "./Utils"; | ||
@@ -46,6 +47,2 @@ import packageJson from "../package.json"; | ||
declare global { | ||
var artoolkitNFT: IARToolkitNFT; | ||
} | ||
export default class ARToolkitNFT implements IARToolkitNFT { | ||
@@ -71,16 +68,6 @@ static get UNKNOWN_MARKER() { | ||
public detectNFTMarker: (id: number) => number; | ||
public getNFTMarker: (id: number, markerIndex: number) => number; | ||
public getNFTMarker: (id: number, markerIndex: number) => INFTMarkerInfo; | ||
public getNFTData: (id: number, index: number) => object; | ||
public setLogLevel: (mode: boolean) => number; | ||
public getLogLevel: () => number; | ||
public frameMalloc: { | ||
framepointer: number; | ||
framesize: number; | ||
videoLumaPointer: number; | ||
camera: number; | ||
transform: number; | ||
}; | ||
public HEAPU8: { | ||
buffer: Uint8Array; | ||
}; | ||
public NFTMarkerInfo: { | ||
@@ -102,2 +89,8 @@ error: number; | ||
public getImageProcMode: (id: number) => number; | ||
public getCameraLens: (cameraId: number) => any; | ||
public passVideoData: ( | ||
id: number, | ||
videoFrame: Uint8ClampedArray, | ||
videoLuma: Uint8Array | ||
) => void; | ||
@@ -137,4 +130,4 @@ // construction | ||
let scope = typeof window !== "undefined" ? window : global; | ||
scope.artoolkitNFT = this; | ||
//let scope = typeof window !== "undefined" ? window : global; | ||
//scope.artoolkitNFT = this; | ||
@@ -171,3 +164,2 @@ return this; | ||
"frameMalloc", | ||
"NFTMarkerInfo", | ||
@@ -190,4 +182,6 @@ | ||
"getCameraLens", | ||
"passVideoData", | ||
"StringList", | ||
"HEAPU8", | ||
].forEach((method: string) => { | ||
@@ -194,0 +188,0 @@ this.converter()[method] = this.instance[method]; |
@@ -37,3 +37,3 @@ /* | ||
import ARToolkitNFT from "./ARToolkitNFT_simd"; | ||
import ARControllerNFT from "./ARControllerNFT"; | ||
import ARControllerNFT from "./ARControllerNFT_simd"; | ||
@@ -40,0 +40,0 @@ export default { |
export default Module; | ||
declare function Module(Module: any): any; | ||
declare function Module(Module?: {}): any; |
export default Module; | ||
declare function Module(Module: any): any; | ||
declare function Module(Module?: {}): any; |
@@ -6,3 +6,3 @@ import { IImageObj } from "./CommonInterfaces"; | ||
process: (image: IImageObj) => void; | ||
detectNFTMarker: () => void; | ||
detectNFTMarker: (videoLuma: any) => void; | ||
trackNFTMarkerId: (id: number, markerWidth?: number) => object; | ||
@@ -9,0 +9,0 @@ detectMarker: (image: any) => number; |
@@ -0,0 +0,0 @@ export interface IImageObj extends HTMLCanvasElement { |
import { INFTMarkerInfo } from "./CommonInterfaces"; | ||
export interface IARToolkitNFT { | ||
getCameraLens: (cameraId: number) => any; | ||
passVideoData: (id: number, videoFrame: Uint8ClampedArray, videoLuma: Uint8Array) => void; | ||
setup: { | ||
@@ -14,12 +16,2 @@ (width: number, height: number, cameraId: number): number; | ||
getLogLevel: () => number; | ||
frameMalloc: { | ||
framepointer: number; | ||
framesize: number; | ||
videoLumaPointer: number; | ||
camera: number; | ||
transform: number; | ||
}; | ||
HEAPU8: { | ||
buffer: Uint8Array; | ||
}; | ||
NFTMarkerInfo: INFTMarkerInfo; | ||
@@ -40,3 +32,3 @@ loadCamera: (cameraParam: string) => Promise<number>; | ||
detectNFTMarker: (arId: number) => void; | ||
getNFTMarker: (id: number, markerIndex: number) => number; | ||
getNFTMarker: (id: number, markerIndex: number) => INFTMarkerInfo; | ||
getNFTData: (id: number, index: number) => object; | ||
@@ -43,0 +35,0 @@ setImageProcMode: (id: number, mode: number) => number; |
@@ -14,3 +14,2 @@ import { INFTMarkerInfo, IImageObj, INFTMarker } from "./abstractions/CommonInterfaces"; | ||
private transform_mat; | ||
private marker_transform_mat; | ||
private transformGL_RH; | ||
@@ -20,5 +19,3 @@ private videoWidth; | ||
private videoSize; | ||
private framepointer; | ||
private framesize; | ||
private dataHeap; | ||
private videoLuma; | ||
@@ -28,3 +25,2 @@ private grayscaleEnabled; | ||
private camera_mat; | ||
private videoLumaPointer; | ||
private nftMarkerFound; | ||
@@ -31,0 +27,0 @@ private nftMarkerFoundTime; |
@@ -14,3 +14,2 @@ import { INFTMarkerInfo, IImageObj, INFTMarker } from "./abstractions/CommonInterfaces"; | ||
private transform_mat; | ||
private marker_transform_mat; | ||
private transformGL_RH; | ||
@@ -20,5 +19,3 @@ private videoWidth; | ||
private videoSize; | ||
private framepointer; | ||
private framesize; | ||
private dataHeap; | ||
private videoLuma; | ||
@@ -28,3 +25,2 @@ private grayscaleEnabled; | ||
private camera_mat; | ||
private videoLumaPointer; | ||
private nftMarkerFound; | ||
@@ -31,0 +27,0 @@ private nftMarkerFoundTime; |
import { IARToolkitNFT } from "./abstractions/IARToolkitNFT"; | ||
declare global { | ||
var artoolkitNFT: IARToolkitNFT; | ||
} | ||
import { INFTMarkerInfo } from "./abstractions/CommonInterfaces"; | ||
export default class ARToolkitNFT implements IARToolkitNFT { | ||
@@ -20,16 +18,6 @@ static get UNKNOWN_MARKER(): number; | ||
detectNFTMarker: (id: number) => number; | ||
getNFTMarker: (id: number, markerIndex: number) => number; | ||
getNFTMarker: (id: number, markerIndex: number) => INFTMarkerInfo; | ||
getNFTData: (id: number, index: number) => object; | ||
setLogLevel: (mode: boolean) => number; | ||
getLogLevel: () => number; | ||
frameMalloc: { | ||
framepointer: number; | ||
framesize: number; | ||
videoLumaPointer: number; | ||
camera: number; | ||
transform: number; | ||
}; | ||
HEAPU8: { | ||
buffer: Uint8Array; | ||
}; | ||
NFTMarkerInfo: { | ||
@@ -51,2 +39,4 @@ error: number; | ||
getImageProcMode: (id: number) => number; | ||
getCameraLens: (cameraId: number) => any; | ||
passVideoData: (id: number, videoFrame: Uint8ClampedArray, videoLuma: Uint8Array) => void; | ||
constructor(); | ||
@@ -53,0 +43,0 @@ init(): Promise<this>; |
import { IARToolkitNFT } from "./abstractions/IARToolkitNFT"; | ||
declare global { | ||
var artoolkitNFT: IARToolkitNFT; | ||
} | ||
import { INFTMarkerInfo } from "./abstractions/CommonInterfaces"; | ||
export default class ARToolkitNFT implements IARToolkitNFT { | ||
@@ -20,16 +18,6 @@ static get UNKNOWN_MARKER(): number; | ||
detectNFTMarker: (id: number) => number; | ||
getNFTMarker: (id: number, markerIndex: number) => number; | ||
getNFTMarker: (id: number, markerIndex: number) => INFTMarkerInfo; | ||
getNFTData: (id: number, index: number) => object; | ||
setLogLevel: (mode: boolean) => number; | ||
getLogLevel: () => number; | ||
frameMalloc: { | ||
framepointer: number; | ||
framesize: number; | ||
videoLumaPointer: number; | ||
camera: number; | ||
transform: number; | ||
}; | ||
HEAPU8: { | ||
buffer: Uint8Array; | ||
}; | ||
NFTMarkerInfo: { | ||
@@ -51,2 +39,4 @@ error: number; | ||
getImageProcMode: (id: number) => number; | ||
getCameraLens: (cameraId: number) => any; | ||
passVideoData: (id: number, videoFrame: Uint8ClampedArray, videoLuma: Uint8Array) => void; | ||
constructor(); | ||
@@ -53,0 +43,0 @@ init(): Promise<this>; |
import ARToolkitNFT from "./ARToolkitNFT_simd"; | ||
import ARControllerNFT from "./ARControllerNFT"; | ||
import ARControllerNFT from "./ARControllerNFT_simd"; | ||
declare const _default: { | ||
@@ -4,0 +4,0 @@ ARToolkitNFT: typeof ARToolkitNFT; |
@@ -0,0 +0,0 @@ import ARToolkitNFT from "./ARToolkitNFT"; |
@@ -0,0 +0,0 @@ export default class Utils { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
18
34
11874905
25457
Updated@babel/runtime@^7.21.0
Updatedaxios@^1.3.4