Module: lampix

Function: getLampixInfo

Returns the lampix info.

getLampixInfo(cb)
Arguments:
  • cb (LampixInfoCallback) – Returns the lampix info.

Function: registerMovement

Listen for movement events inside the specified rectangles.

registerMovement(rectArray, cb)
Arguments:
  • rectArray (Array.<Rect>) – Listen for movement events inside the specified rectangles.
  • cb (MovementCallback|null) – Listen for movement events inside the specified rectangles.

Function: registerSimpleClassifier

Listen for simple classifier events inside the specified rectangles. A simple classifier event does not contain the position or outline of the detected object. The events generated are useful for simple UI elements like buttons. This method has better reliability and speed than {@link registerPositionClassifier}

registerSimpleClassifier(classRectArray, cb)
Arguments:
  • classRectArray (Array.<ClassifierRect>) – Listen for simple classifier events inside the specified rectangles. A simple classifier event does not contain the position or outline of the detected object. The events generated are useful for simple UI elements like buttons. This method has better reliability and speed than {@link registerPositionClassifier}
  • cb (SimpleClassifierCallback|null) – Listen for simple classifier events inside the specified rectangles. A simple classifier event does not contain the position or outline of the detected object. The events generated are useful for simple UI elements like buttons. This method has better reliability and speed than {@link registerPositionClassifier}

Function: registerPositionClassifier

Listen for classifier events inside the specified rectangles. The events contain the object ID and shape (outline). For buttons see {@link registerSimpleClassifier}.

registerPositionClassifier(classRectArray, cb, preCb)
Arguments:
  • classRectArray (Array.<ClassifierRect>) – Listen for classifier events inside the specified rectangles. The events contain the object ID and shape (outline). For buttons see {@link registerSimpleClassifier}.
  • cb (PositionClassifierCallback|null) – Listen for classifier events inside the specified rectangles. The events contain the object ID and shape (outline). For buttons see {@link registerSimpleClassifier}.
  • preCb (prePositionClassifierCallback|null) – Listen for classifier events inside the specified rectangles. The events contain the object ID and shape (outline). For buttons see {@link registerSimpleClassifier}.

Function: registerDrawingDetector

Listen for drawings being made inside the specified rectangles.

registerDrawingDetector(classRectArray, cb)
Arguments:
  • classRectArray (Array.<ClassifierRect>) – Listen for drawings being made inside the specified rectangles.
  • cb (DrawingDetector|null) – Listen for drawings being made inside the specified rectangles.

Function: setIgnoredRects

The rectangle areas are ignored by {@link registerMovement} and {@link registerPositionClassifier}. This does not apply to {@link registerSimpleClassifier}

setIgnoredRects(rectArray)
Arguments:
  • rectArray (Array.<Rect>) – The rectangle areas are ignored by {@link registerMovement} and {@link registerPositionClassifier}. This does not apply to {@link registerSimpleClassifier}

Member: rectArray:

Member: classRectArray:

Member: classRectArray:

Member: classRectArray:

Typedef: LampixInfo

Properties

  • string id: The Lampix unique hardware id
  • string version: The Lampix OS version
  • boolean isSimulator: Return true if the app is run inside a simulator

Typedef: Rect

Properties

  • number posX: The X coordinate of the left side of the rectangle
  • number posY: The Y coordinate of the left side of the rectangle
  • number width: The width of the rectangle
  • number height: The height of the rectangle

Typedef: ClassifierRect

Properties

  • number posX: The X coordinate of the left side of the rectangle
  • number posY: The Y coordinate of the left side of the rectangle
  • number width: The width of the rectangle
  • number height: The height of the rectangle
  • string classifier: The classifier to run inside the rectangle

Typedef: Outline

Properties

  • Array.<Point> points: The array of points that compose this outline shape

Typedef: Point

Properties

  • number posX: The X coordinate of the point
  • number posY: The Y coordinate of the point

Typedef: ClassifiedObject

Properties

  • string objectId: Is used to track the same object over a span of multiple frames
  • string classTag: Is the class returned by the classifier
  • Outline outline: The outline of the detected object

Typedef: LampixInfoCallback

Interface definition for a callback to be invoked when info is available.

Typedef: MovementCallback

Interface definition for a callback to be invoked when a movement is detected.

Typedef: SimpleClassifierCallback

Interface definition for a callback to be invoked when an object is detected and classified.

Typedef: PositionClassifierCallback

Interface definition for a callback to be invoked when an object is detected and classified.

Typedef: prePositionClassifierCallback

Callback invoked when an object is detected, but before it is classified.

Typedef: DrawingDetectorCallback

Callback invoked when drawing is detected.