Static Methods
-
Lens.Snapshot.capture(element, callback, errorCallback) ARCore/snapshot.js, line 237
-
Captures a snapshot from the Lens HD camera.
Argument Type Attributes Description elementstring | Element | jQuery <optional>
If given, this snapshot will be of just the contents of this div. Otherwise, it will be a full-size, full-resolution snapshot from the HD LuminAR camera. This can be a CSS selector string, DOM element, or jQuery object. This element must be rendered to the screen; it can't have been hidden with
display: nonein CSS or with jQuery's.hide().callbackfunction When the snapshot has been taken, this is called with the Snapshot as an argument.
errorCallbackfunction If an error occurs when a snapshot is taken, this callback is called with the error message as an argument.
Instance Methods
-
crop(opts) → {Snapshot} ARCore/snapshot.js, line 147
-
Returns a new Snapshot that's a cropped version of this one.
Returns:Argument Type Description optsObject Cropping options
Properties
Argument Type Attributes Description leftNumber <optional>
Number of pixels to remove from the left. Defaults to 0.
topNumber <optional>
Number of pixels to remove from the top. Defaults to 0.
widthNumber <optional>
Width of the cropped image. Defaults to the width of the image, minus opts.left.
heightNumber <optional>
Height of the cropped image. Defaults to the height of the image, minus opts.top.
The cropped Snapshot.
-
scale() → {Snapshot} ARCore/snapshot.js, line 181
-
Returns a new Snapshot that's a scaled version of this one.
Returns:Argument Type Attributes Description opts.widthNumber <optional>
The width of the new Snapshot
opts.heightNumber <optional>
The height of the new Snapshot
The resized new Snapshot.
-
toBase64() → {String} ARCore/snapshot.js, line 128
-
Returns the base64-encoded JPEG data of this snapshot.
-
toCanvas() → {Canvas} ARCore/snapshot.js, line 120
-
Returns a canvas element that contains the snapshot.
-
toImage() → {Image} ARCore/snapshot.js, line 110
-
Returns:
Converts the snapshot to an image.
HTML image element.