com.craftar
Class CraftARSDK
- java.lang.Object
-
- com.craftar.CraftARGenericSDK
-
- com.craftar.CraftARSDK
public class CraftARSDK extends CraftARGenericSDK
TheCraftARSDK
class for image recognition is the main controller for managing the camera capture and the visual search operations (Single shot and Finder Mode search)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interface
CraftARSDK.TakeARSceneCallback
Interface for receiving AR scene capture images-
Nested classes/interfaces inherited from class com.craftar.CraftARGenericSDK
CraftARGenericSDK.OnFinderTimeoutListener
-
-
Field Summary
Fields Modifier and Type Field and Description protected OFAndroid
mOFAndroid
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
getAutoInstantiateARContents()
Whether the SDK automatically creates and adds the AR contents when creating an AR item.CraftARCamera
getCamera()
Returns theCraftARCamera
object that provides access to camera level operations.CraftARTouchEventInterface.OnContentClickListener
getContentClickListener()
Returns the ContentClickListener, if set, null otherwiseCraftARTouchEventInterface.OnTouchEventListener
getContentTouchListener()
Returns the ContentTouchListener, if set, null otherwisestatic CraftARSDK
Instance()
Get the shared instance of the CraftARSDK for image recognitionboolean
isFinding()
Returns whether the SDK's Finder mode is activeprotected void
requestRender()
void
setAutoInstantiateARContents(boolean instantiateARContents)
Whether the SDK automatically creates and adds the AR contents when creating an AR item.void
setOnContentClickListener(CraftARTouchEventInterface.OnContentClickListener clickEventListener)
Set a listener for the click events on any CraftARContent * @param clickEventListener Listener that will receive the eventsvoid
setOnContentTouchListener(CraftARTouchEventInterface.OnTouchEventListener touchEventListener)
Set a listener for the touch events on any CraftARContentvoid
setSearchController(SearchController searchController)
Set the controller that will receive messages to perform visual search based on the SDK commands (singleShotSearch, startFinder, stopFinder).void
singleShotSearch()
Takes a picture and performs a visual search using theSearchController
boolean
startCapture(CraftARActivity activity)
Start the camera capture.boolean
startCapture(CraftARActivityCompat activity)
Start the camera capture.void
startFinder()
Starts a visual search session in Finder Mode passing the camera capture frames to theSearchController
.void
stopFinder()
Stops the visual search session if started.boolean
takeARSceneCapture(CraftARSDK.TakeARSceneCallback callback)
Take a capture of the AR scene (screenshot)-
Methods inherited from class com.craftar.CraftARGenericSDK
getSearchController, init, startFinder
-
-
-
-
Method Detail
-
Instance
public static CraftARSDK Instance()
Get the shared instance of the CraftARSDK for image recognition
-
startCapture
public boolean startCapture(CraftARActivity activity)
Start the camera capture.- Parameters:
activity
- The Activity that is running while the preview is open.
-
startCapture
public boolean startCapture(CraftARActivityCompat activity)
Start the camera capture.- Parameters:
activity
- The Activity that is running while the preview is open.
-
setOnContentTouchListener
public void setOnContentTouchListener(CraftARTouchEventInterface.OnTouchEventListener touchEventListener)
Set a listener for the touch events on any CraftARContent- Parameters:
touchEventListener
- Listener that will receive the events
-
getContentClickListener
public CraftARTouchEventInterface.OnContentClickListener getContentClickListener()
Returns the ContentClickListener, if set, null otherwise
-
setOnContentClickListener
public void setOnContentClickListener(CraftARTouchEventInterface.OnContentClickListener clickEventListener)
Set a listener for the click events on any CraftARContent * @param clickEventListener Listener that will receive the events
-
getContentTouchListener
public CraftARTouchEventInterface.OnTouchEventListener getContentTouchListener()
Returns the ContentTouchListener, if set, null otherwise
-
setSearchController
public void setSearchController(SearchController searchController)
Set the controller that will receive messages to perform visual search based on the SDK commands (singleShotSearch, startFinder, stopFinder).- Specified by:
setSearchController
in classCraftARGenericSDK
-
singleShotSearch
public void singleShotSearch()
Takes a picture and performs a visual search using theSearchController
- Specified by:
singleShotSearch
in classCraftARGenericSDK
-
startFinder
public void startFinder()
Starts a visual search session in Finder Mode passing the camera capture frames to theSearchController
.- Overrides:
startFinder
in classCraftARGenericSDK
-
stopFinder
public void stopFinder()
Stops the visual search session if started.- Overrides:
stopFinder
in classCraftARGenericSDK
-
isFinding
public boolean isFinding()
Returns whether the SDK's Finder mode is active- Overrides:
isFinding
in classCraftARGenericSDK
-
getCamera
public CraftARCamera getCamera()
Returns theCraftARCamera
object that provides access to camera level operations.- Specified by:
getCamera
in classCraftARGenericSDK
-
takeARSceneCapture
public boolean takeARSceneCapture(CraftARSDK.TakeARSceneCallback callback)
Take a capture of the AR scene (screenshot)- Parameters:
callback
- this callback will be triggered when the AR scene capture is taken.- Returns:
- Returns false if another capture process is still pending. The operation will not be performed.
-
setAutoInstantiateARContents
public void setAutoInstantiateARContents(boolean instantiateARContents)
Whether the SDK automatically creates and adds the AR contents when creating an AR item. true by default, this triggers the download of the AR item contents as well. When set to NO, call CraftARItemAR.instantiateContents() to trigger contents download.
-
getAutoInstantiateARContents
public boolean getAutoInstantiateARContents()
Whether the SDK automatically creates and adds the AR contents when creating an AR item. true by default, this triggers the download of the AR item contents as well. When set to NO, call CraftARItemAR.instantiateContents() to trigger contents download.
-
requestRender
protected void requestRender()
-
-