Class: CraftARSDK

CraftARSDK

new CraftARSDK()

The CraftAR object exposes an interface to the CraftAR image recognition service.

Members

camera

Returns the CraftAR camera object that provides access to camera level operations.

searchController

The search controller is in charge of performing searches using images coming from the camera (either from the Finder Mode or the Single shot search) Set this to the CraftARCloudRecognition.searchController to use the Cloud Image recognition.

See:

Methods

closeView()

Close the catchoom camera view

isFinding()

Returns whether the SDK's Finder mode search is running

onStartCapture()

Set a callback for when the camera capture has started

See:

setAutoInstantiateARContents(instantiateARContents)

Autoinstantiate AR contents (For AR SDK or Pro SDK only)

Name Type Description
instantiateARContents

setCaptureResolution(captureResolution)

Set the preferred capture resolution. This method must be called before calling StartView.

Name Type Description
captureResolution

must be a string with the values "SD" or "HD"

setMaxFPS(maxFPS)

Set the Max FPS for the capture. This method must be called before calling StartView. This will only work on iOS.

Name Type Description
maxFPS

accepted values: 30-240

singleShotSearch()

Takes a picture and performs a Image Recognition search to the CraftAR service. I

startCapture()

Call to start the capture or after the capture was frozen. Triggers a callback when the capture has started

See:

startFinder()

Starts a visual search session in Finder Mode passing the camera capture frames to the searchControllerDelegate.

startFinderWithTimeout(timeout, callback)

Starts a visual search session in Finder Mode passing the camera capture frames to the searchControllerDelegate. The Finder stops after timeoutSeconds and the callback is called. Calling stopFinder cancels the notification.

Name Type Description
timeout

seconds to wait until before giving up

callback

called when the time is over

startView(success, error, options)

Open a View with a CraftAR camera. This is required to start the Plugin. You always need to start a view to be able to use the CraftAR Plugin

Name Type Description
success function

Callback function executed on success.

error function

Callback function executed on error. The first argument is a CatchoomError object.

options CraftAROptions

The CraftAR options. {"loadUrl":"YOUR_PAGE_WITH_CRAFTAR.html"}

stopFinder()

Stops the visual search session if started.