Class: Lens.ContourSearch

ContourSearch locations are areas that LuminAR will watch. If new objects appear in the region, new Contour objects will be created and move/disappear callbacks will be fired.

Lens.ContourSearch(opts) ARCore/contour_search.js, line 66

Registers a new ContourSearch. When a Contour object appear in the ContourSearch area, new Contour objects will be created, and changes of the Contour objects will be tracked.

Argument Type Attributes Description
opts Object <optional>

Parameters specifying the bounds of the search.

Properties
Argument Type Attributes Description
x Array.<Number> <optional>

A pair of numbers specifying the upper and lower x-axis bounds.

y Array.<Number> <optional>

A pair of number specifying the upper and lower y-axis bounds.

el String | Element | jQuery <optional>

A selector, element, or jQuery object. If this parameter is given, the bounding box of the element will be used to provide x- and y-axis bounds. The opts.x and opts.y parameters take precedence over this. Note that the bounds are not recalculated if the element moves.

threshold Number <optional>

The number of points that must be inside the x and y bounds for the contour to be considered inside this search. Defaults to 1.

classification Number <optional>

Desired classification for the contour. Must be one of the constants from @link{Lens.ContourSearch}

Static Properties

Lens.ContourSearch.CLASSIFICATION_CIRCLE ARCore/contour_search.js, line 270

The circle contour classification number.

Lens.ContourSearch.CLASSIFICATION_MAX ARCore/contour_search.js, line 276

The maximum classification value (for verification).

Lens.ContourSearch.CLASSIFICATION_NONE ARCore/contour_search.js, line 264

The classification number for an unclassified contour.

Static Methods

Lens.ContourSearch.clear() ARCore/contour_search.js, line 256

Stops all existing ContourSearches.

Instance Methods

appeared(callback) → {Binding} ARCore/contour_search.js, line 204

Registers a function to be called whenever a Contour appears in this region.

Argument Type Description
callback function

The function to call. Gets one Contour as an argument. Use Contour#move orContour#disappeared to register additional handlers for that Contour.

Returns:

A Binding that allows this handler to be cleared.

disappeared(callback) → {Binding} ARCore/contour_search.js, line 232

Registers a function to be called whenever a contour leaves this search area.

Argument Type Description
callback function

The function to call. Gets a Contour as an argument.

Returns:

A Binding that allows this handler to be cleared.

moved(callback) → {Binding} ARCore/contour_search.js, line 218

Registers a function to be called whenever a contour in this search area moves.

Argument Type Description
callback function

The function to call. Gets a Contour as an argument.

Returns:

A Binding that allows this handler to be cleared.

stop() ARCore/contour_search.js, line 240

Stops watching the search area. No more callbacks will be called.