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 element
string | 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: none
in CSS or with jQuery's.hide()
.callback
function When the snapshot has been taken, this is called with the Snapshot as an argument.
errorCallback
function 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.
Argument Type Description opts
Object Cropping options
Properties
Argument Type Attributes Description left
Number <optional>
Number of pixels to remove from the left. Defaults to 0.
top
Number <optional>
Number of pixels to remove from the top. Defaults to 0.
width
Number <optional>
Width of the cropped image. Defaults to the width of the image, minus opts.left.
height
Number <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.
Argument Type Attributes Description opts.width
Number <optional>
The width of the new Snapshot
opts.height
Number <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
-
Converts the snapshot to an image.
HTML image element.