@webarkit/jsartoolkit-nft
    Preparing search index...

    Threaded build: serve ARToolkitNFT_td.worker.js next to the script that loads this bundle (with a plain <script> tag, the folder of ARToolkitNFT_td.js; with importScripts(), the calling worker's folder; in re-bundled apps, see the README section "Threaded build: deploying"), with the COOP/COEP headers.

    Hierarchy

    • ARToolkitNFTBase
      • ARToolkitNFT
    Index
    • The ARToolkitNFT constructor. It has no arguments. These properties are initialized:

      • instance
      • markerNFTCount
      • cameraCount
      • version A message is displayed in the browser console during the intitialization, for example: "ARToolkitNFT 1.5.0"

      Returns ARToolkitNFT

    free: any
    FS: any
    malloc: any
    NFTMarkerInfo: { error: number; found: number; id: number; pose: Float64Array }
    nftMarkers: any
    StringList: any
    videoFramePtr: number
    videoLumaPtr: number
    AR_DEBUG_DISABLE: number
    AR_DEBUG_ENABLE: number
    AR_DEFAULT_DEBUG_MODE: number
    AR_DEFAULT_IMAGE_PROC_MODE: number
    AR_DEFAULT_LABELING_THRESH: number
    AR_IMAGE_PROC_FIELD_IMAGE: number
    AR_IMAGE_PROC_FRAME_IMAGE: number
    AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE: number
    AR_LABELING_THRESH_MODE_AUTO_MEDIAN: number
    AR_LABELING_THRESH_MODE_AUTO_OTSU: number
    AR_LABELING_THRESH_MODE_MANUAL: number
    AR_LOG_LEVEL_DEBUG: number
    AR_LOG_LEVEL_ERROR: number
    AR_LOG_LEVEL_INFO: number
    AR_LOG_LEVEL_REL_INFO: number
    AR_LOG_LEVEL_WARN: number
    AR_LOOP_BREAK_THRESH: number
    AR_MARKER_INFO_CUTOFF_PHASE_HEURISTIC_TROUBLESOME_MATRIX_CODES: number
    AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_EDC_FAIL: number
    AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_NOT_FOUND: number
    AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONFIDENCE: number
    AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONTRAST: number
    AR_MARKER_INFO_CUTOFF_PHASE_MATCH_GENERIC: number
    AR_MARKER_INFO_CUTOFF_PHASE_NONE: number
    AR_MARKER_INFO_CUTOFF_PHASE_PATTERN_EXTRACTION: number
    AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR: number
    AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR_MULTI: number
    AR_MAX_LOOP_COUNT: number
    ERROR_MARKER_INDEX_OUT_OF_BOUNDS: number
    • get HEAPU8(): any

      The WASM heap view. Read from the module on every access rather than cached: the build enables ALLOW_MEMORY_GROWTH, and Emscripten replaces this typed array when the heap grows, detaching any previously captured reference.

      Returns any

    • get teardownBlocksMainThread(): boolean
      Internal

      The native teardown() joins the KPM detection thread; with no pthread pool that join waits on the main thread for a thread that needs the event loop, so it never returns (#695). The tracker facade's dispose() skips it (#720). A static getter, not a field: variant subclasses declare no fields.

      Returns boolean

    • get UNKNOWN_MARKER(): number

      static properties

      Returns number

    • Loads NFT markers and registers them as one batch.

      Each entry is either a URL without extension (.zft is probed first, then .fset, .iset and .fset3), a URL ending in .zft, or an explicit list of file URLs for one marker.

      All or nothing: if any marker fails, none of this call's markers is registered and its files are removed. Markers loaded by earlier calls stay.

      • Promise style (no callbacks): resolves to the marker ids, or rejects with an NFTLoadError, or with signal.reason (AbortError, TimeoutError) when opts.signal aborts.
      • Callback style (callback and/or onError): never rejects for a load failure. onError(code) is called once, with the HTTP status or -1 (or console.error when there is no onError), and the Promise resolves to [].

      Errors from different bundles are different classes, so test err.name === "NFTLoadError" and err.kind rather than instanceof.

      Parameters

      • urls: (string | string[])[]

        the markers to load, one entry per marker.

      • Optionalcallback: (ids: number[]) => void

        deprecated: receives the ids on success.

      • OptionalonError: (code: number) => void

        deprecated: receives the error code on failure.

      • Optionalopts: NFTLoadOptions

        signal cancels the downloads; probeZFT (default true) probes for a .zft before the three files.

      Returns Promise<number[]>

      the ids the native core assigned, in the order of urls.

    • Changes several runtime settings at once (#720). The patch is deep-merged into getRuntimeSettings (ar2 field by field) and applied in one native call, which validates everything first and changes nothing on failure.

      logLevel is per controller: the level lives in the WASM module's globals, and each init() creates its own module.

      Parameters

      Returns void

      on an unknown key (including the deprecated square-marker keys threshold, thresholdMode, imageProcMode, debugMode), a value of the wrong type, or a non-integer for an integer field (logLevel, ar2.searchFeatureNum, ar2.templateSize1/2, ar2.searchSize); nothing is changed.

      when the values are out of range; nothing is changed.

    • Returns whether the square-marker detector's debug mode is enabled.

      Returns boolean

      true when debug mode is enabled

      Has no effect on NFT tracking: only the square-marker labeling reads it, and NFT tracking never runs it. Will be removed in the next major version (#659).

    • Returns the square-marker detector's image processing mode.

      Returns number

      The current image processing mode.

      Has no effect on NFT tracking: only the square-marker labeling reads it, and NFT tracking never runs it. Will be removed in the next major version (#659).

    • Parameters

      • index: number

      Returns object

    • Returns the Emscripten HEAP offset of the square-marker detector's debug image.

      Returns number

      HEAP offset of the debug image.

      The image is never filled for NFT tracking: only the square-marker labeling writes it, and NFT tracking never runs it. Will be removed in the next major version (#659).

    • Returns number

    • Returns number

    • The current runtime settings (#720), with the effective values: detectionInterval and ar2.searchSize are the build's resolved defaults when they were not set, and logLevel is the module's current level.

      Returns NFTRuntimeSettings

      a fresh object; changing it changes nothing until passed to configure().

    • Returns the square-marker labeling threshold.

      Returns number

      The current threshold value.

      Has no effect on NFT tracking: only the square-marker labeling reads it, and NFT tracking never runs it. Will be removed in the next major version (#659).

    • Returns the square-marker labeling threshold mode.

      Returns number

      The current threshold mode.

      Has no effect on NFT tracking: only the square-marker labeling reads it, and NFT tracking never runs it. Will be removed in the next major version (#659).

    • Init the class injecting the Wasm Module, link the instanced methods and create a global artoolkitNFT variable.

      Parameters

      • Optionaloptions: ARInitOptions & { moduleOptions?: Record<string, unknown> }

        logLevel is applied to the fresh module before the core is constructed (#677, D10), so the start-up lines follow it. moduleOptions is handed to the Emscripten module factory as its Module object: the tracker facade's threaded worker host sets mainScriptUrlOrBlob through it (#720 D16).

      Returns Promise<ARToolkitNFT>

      the this object

    • Load the camera, this is an important and required step, Internally fill the ARParam struct.

      Parameters

      • urlOrData: string | Uint8Array<ArrayBufferLike>

        the camera parameter, usually a path to a .dat file

      Returns Promise<number>

      a promise that resolves to a number, the internal id. A download failure rejects with the NFTLoadError from the fetch (kind http or network), which names the URL.

    • Parameters

      • videoFrame: Uint8ClampedArray
      • videoLuma: Uint8Array
      • lumaInternal: boolean

      Returns void

    • Rebuilds the camera frustum from the near and far planes. Kept for compatibility: since WebARKitLib 0.12.0 the lens follows the planes, as the projection setters and configure() rebuild it themselves, so calling this changes nothing.

      Returns void

    • Parameters

      • enabled: boolean

      Returns void

    • Enables or disables the square-marker detector's debug mode.

      Parameters

      • mode: boolean

        true to enable debug mode, false to disable it

      Returns number

      Has no effect on NFT tracking: only the square-marker labeling reads it, and NFT tracking never runs it. Will be removed in the next major version (#659).

    • Parameters

      • ms: number

      Returns void

    • Parameters

      • enableFiltering: boolean

      Returns void

    • Sets the square-marker detector's image processing mode (frame or field).

      Parameters

      • mode: number

        AR_IMAGE_PROC_FRAME_IMAGE or AR_IMAGE_PROC_FIELD_IMAGE.

      Returns number

      Has no effect on NFT tracking: only the square-marker labeling reads it, and NFT tracking never runs it. Will be removed in the next major version (#659).

    • Set the logging verbosity.

      Lower is more verbose: ARLogLevel.Debug (0) shows everything, ARLogLevel.RelInfo (4) the least. The library starts at ARLogLevel.Info.

      Parameters

      • level: number

        one of the ARLogLevel values. Returns nothing: the native setter is void. Use getLogLevel() to read back the effective level, which also reveals when a negative value was rejected by the guard.

      Returns void

    • Sets the far plane of the projection. Once a camera is loaded the camera lens is rebuilt at once (WebARKitLib 0.12.0); before that the value is stored.

      Parameters

      • value: number

        the far plane, > the near plane.

      Returns void

    • Sets the near plane of the projection. Once a camera is loaded the camera lens is rebuilt at once (WebARKitLib 0.12.0); before that the value is stored.

      Parameters

      • value: number

        the near plane, > 0.

      Returns void

    • Sets the square-marker labeling threshold.

      Parameters

      • threshold: number

        An integer in the range [0,255] (inclusive).

      Returns number

      Has no effect on NFT tracking: only the square-marker labeling reads it, and NFT tracking never runs it. Will be removed in the next major version (#659).

    • Sets the square-marker labeling threshold mode (auto/manual).

      Parameters

      • mode: number

        One of the AR_LABELING_THRESH_MODE_* values.

      Returns number

      Has no effect on NFT tracking: only the square-marker labeling reads it, and NFT tracking never runs it. Will be removed in the next major version (#659).

    • Parameters

      • width: number
      • height: number
      • cameraId: number

      Returns number