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MAAM,UAAY,CAChB,OAAQ,OACR,OAAQ,OACR,OAAQ,OACR,YAAa,YACb,eAAgB,eAChB,iBAAkB,iBAClB,sBAAuB,sBACvB,aAAc,aACd,WAAY,WACZ,eAAgB,eAChB,oBAAqB,oBACrB,oBAAqB,oBACrB,gBAAiB,iBAMnB,SAAS,UACP,SAAS,UACT,IAAI,eACN,CAiBA,SAAS,WACP,OAAO,IAAI,UACb,CAEA,OAAO,QAAU,CACf,QAAS,QACT,SAAU,SACV,mBAAoB,mBAEpB,QAAS,QACT,SAAU,SACV,gBAAiB,gBACjB,OAAQ,OACR,UAAW,UACX,OAAQ,OACR,IAAK,IACL,WAAY,WACZ,UAAW,UACX,OAAQ,OACR,YAAa,YACb,UAAW,UACX,cAAe,cACf,mBAAoB,mBACpB,oBAAqB,oBACrB,MAAO,MACP,SAAU,SACV,WAAY,WACZ,WAAY,WACZ,eAAgB,eAChB,YAAa,YACb,UAAW,UACX,MAAO,MACP,WAAY,WACZ,OAAQ,OACR,OAAQ,OACR,eAAgB,eAChB,eAAgB,eAChB,iBAAkB,iBAClB,eAAgB,eAChB,cAAe,cACf,kBAAmB,kBACnB,0BAA2B,0BAC3B,0BAA2B,0BAG3B,OAAQ,OACR,OAAQ,OACR,OAAQ,OACR,YAAa,YACb,eAAgB,eAChB,iBAAkB,iBAClB,sBAAuB,sBACvB,aAAc,aACd,WAAY,WACZ,eAAgB,eAChB,oBAAqB,oBACrB,oBAAqB,oBACrB,gBAAiB,gBAEjB,KAAM,KACN,SAAU,SAEV,6BAA8B,SAGhC,SAAS","file":"/npm/node-librealsense@0.2130.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/node-librealsense@0.2130.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Copyright (c) 2017 Intel Corporation. All rights reserved.\n// Use of this source code is governed by an Apache 2.0 license\n// that can be found in the LICENSE file.\n\n'use strict';\n\nconst RS2 = require('bindings')('node_librealsense');\nconst EventEmitter = require('events');\nconst PNG = require('pngjs').PNG;\nconst fs = require('fs');\n\n/**\n * UnrecoverableError is the type of error that jeopardized the modue that restart\n * is needed.\n */\nclass UnrecoverableError extends Error {\n  constructor(message) {\n    super('Unrecoverable! '+ message);\n  }\n}\n\n// TODO(tingshao): resolve the potential disabled eslint errors\n/* eslint-disable prefer-rest-params, valid-jsdoc, no-unused-vars, camelcase */\n/**\n * A RealSense camera\n */\nclass Device {\n  constructor(cxxDev, autoDelete = true) {\n    this.cxxDev = cxxDev;\n    if (autoDelete) {\n      internal.addObject(this);\n    }\n  }\n\n  /**\n   * Check if everything is OK, e.g. if the device object is connected to underlying hardware\n   * @return {Boolean}\n   */\n  get isValid() {\n    return (this.cxxDev !== null);\n  }\n\n  /**\n   * get an array of adjacent sensors, sharing the same physical parent composite device\n   * @return {Sensor[]}\n   */\n  querySensors() {\n    let sensors = this.cxxDev.querySensors();\n    if (!sensors) return undefined;\n\n    const array = [];\n    sensors.forEach((s) => {\n      if (s.isDepthSensor()) {\n        array.push(new DepthSensor(s));\n      } else {\n        array.push(new Sensor(s));\n      }\n    });\n    return array;\n  }\n\n  /**\n   * Get the first sensor\n   * @return {Sensor|undefined}\n   */\n  get first() {\n    let sensors = this.querySensors();\n    if (sensors && sensors.length > 0) {\n      return sensors[0];\n    }\n    return undefined;\n  }\n\n  /**\n   * Information that can be queried from the device.\n   * Not all information attributes are available on all camera types.\n   * This information is mainly available for camera debug and troubleshooting and should not be\n   * used in applications.\n   * @typedef {Object} CameraInfoObject\n   * @property {String|undefined} name - Device friendly name. <br> undefined is not\n   * supported.\n   * @property {String|undefined} serialNumber - Device serial number. <br> undefined is not\n   * supported.\n   * @property {String|undefined} firmwareVersion - Primary firmware version.\n   * <br> undefined is not supported.\n   * @property {String|undefined} physicalPort - Unique identifier of the port the device is\n   * connected to (platform specific). <br> undefined is not supported.\n   * @property {String|undefined} debugOpCode - If device supports firmware logging, this is the\n   * command to send to get logs from firmware. <br> undefined is not supported.\n   * @property {String|undefined} advancedMode - True if the device is in advanced mode.\n   * <br> undefined is not supported.\n   * @property {String|undefined} productId - Product ID as reported in the USB descriptor.\n   * <br> undefined is not supported.\n   * @property {Boolean|undefined} cameraLocked - True if EEPROM is locked. <br> undefined is not\n   * supported.\n   * @property {String|undefined} usbTypeDescriptor - Designated USB specification: USB2/USB3.\n   * <br> undefined is not supported.\n   * @property {String|undefined} recommendedFirmwareVersion - Latest firmware version.\n   * <br> undefined is not supported.\n   * @see [Device.getCameraInfo()]{@link Device#getCameraInfo}\n   */\n\n  /**\n   * Get camera information\n   * There are 2 acceptable forms of syntax:\n   * <pre><code>\n   *  Syntax 1. getCameraInfo()\n   *  Syntax 2. getCameraInfo(info)\n   * </code></pre>\n   *\n   * @param {String|Integer} [info] - the camera_info type, see {@link camera_info} for available\n   * values\n   * @return {CameraInfoObject|String|undefined} if no argument is provided, {CameraInfoObject} is\n   * returned. If a camera_info is provided, the specific camera info value string is returned.\n   */\n  getCameraInfo(info) {\n    const funcName = 'Device.getCameraInfo()';\n    checkArgumentLength(0, 1, arguments.length, funcName);\n    if (arguments.length === 0) {\n      let result = {};\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_NAME)) {\n        result.name = this.cxxDev.getCameraInfo(camera_info.CAMERA_INFO_NAME);\n      }\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_SERIAL_NUMBER)) {\n        result.serialNumber = this.cxxDev.getCameraInfo(camera_info.CAMERA_INFO_SERIAL_NUMBER);\n      }\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_FIRMWARE_VERSION)) {\n        result.firmwareVersion = this.cxxDev.getCameraInfo(\n            camera_info.CAMERA_INFO_FIRMWARE_VERSION);\n      }\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_PHYSICAL_PORT)) {\n        result.physicalPort = this.cxxDev.getCameraInfo(camera_info.CAMERA_INFO_PHYSICAL_PORT);\n      }\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_DEBUG_OP_CODE)) {\n        result.debugOpCode = this.cxxDev.getCameraInfo(camera_info.CAMERA_INFO_DEBUG_OP_CODE);\n      }\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_ADVANCED_MODE)) {\n        result.advancedMode = this.cxxDev.getCameraInfo(camera_info.CAMERA_INFO_ADVANCED_MODE);\n      }\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_PRODUCT_ID)) {\n        result.productId = this.cxxDev.getCameraInfo(camera_info.CAMERA_INFO_PRODUCT_ID);\n      }\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_CAMERA_LOCKED)) {\n        result.cameraLocked = this.cxxDev.getCameraInfo(camera_info.CAMERA_INFO_CAMERA_LOCKED);\n      }\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_USB_TYPE_DESCRIPTOR)) {\n        result.usbTypeDescriptor = this.cxxDev.getCameraInfo(\n            camera_info.CAMERA_INFO_USB_TYPE_DESCRIPTOR);\n      }\n      if (this.cxxDev.supportsCameraInfo(camera_info.CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION)) {\n        result.recommendedFirmwareVersion = this.cxxDev.getCameraInfo(\n            camera_info.CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION);\n      }\n      return result;\n    } else {\n      const val = checkArgumentType(arguments, constants.camera_info, 0, funcName);\n      return (this.cxxDev.supportsCameraInfo(val) ? this.cxxDev.getCameraInfo(val) : undefined);\n    }\n  }\n\n  get cameraInfo() {\n    return this.getCameraInfo();\n  }\n\n  /**\n   * Check if specific camera info is supported.\n   * @param {String|Integer} info - info type to query. See {@link camera_info} for available values\n   * @return {Boolean|undefined} Returns undefined if an invalid info type was specified.\n   * @see enum {@link camera_info}\n   * @example <caption>Example of 3 equivalent calls of the same query</caption>\n   * device.supportsCameraInfo('name');\n   * device.supportsCameraInfo(realsense2.camera_info.camera_info_name);\n   * device.supportsCameraInfo(realsense2.camera_info.CAMERA_INFO_NAME);\n   */\n  supportsCameraInfo(info) {\n    const funcName = 'Device.supportsCameraInfo()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.camera_info, 0, funcName);\n    return this.cxxDev.supportsCameraInfo(i);\n  }\n\n  /**\n   * Send hardware reset request to the device.\n   * @return {undefined}\n   */\n  reset() {\n    this.cxxDev.reset();\n  }\n\n  /**\n   * Release resources associated with the object\n   */\n  destroy() {\n    if (this.cxxDev) {\n      this.cxxDev.destroy();\n      this.cxxDev = undefined;\n    }\n    this._events = undefined;\n  }\n\n  static _internalCreateDevice(cxxDevice) {\n    return cxxDevice.isTm2() ? new Tm2(cxxDevice) : new Device(cxxDevice);\n  }\n}\n\n/**\n * This class represents the tm2 device\n */\nclass Tm2 extends Device {\n  constructor(dev) {\n    super(dev);\n  }\n\n  /**\n   * Enter the given device into loopback operation mode that uses the given file as input for\n   * raw data\n   * @param {String} file Path to bag file with raw data for loopback\n   * @return {undefined}\n   */\n  enableLoopback(file) {\n    const funcName = 'Tm2.enableLoopback()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'string', 0, funcName);\n    checkFileExistence(file);\n    this.cxxDev.enableLoopback(file);\n  }\n\n  /**\n   * Restores the given device into normal operation mode\n   * @return {undefined}\n   */\n  disableLoopback() {\n    this.cxxDev.disableLoopback();\n  }\n\n  /**\n   * Checks if the device is in loopback mode or not\n   * @return {Boolean}\n   */\n  get loopbackEnabled() {\n    return this.cxxDev.isLoopbackEnabled();\n  }\n\n  /**\n   * Connects to a given tm2 controller\n   * @param {ArrayBuffer} macAddress The MAC address of the desired controller\n   * @return {undefined}\n   */\n  connectController(macAddress) {\n    const funcName = 'Tm2.connectController()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'ArrayBuffer', 0, funcName);\n    this.cxxDev.connectController(macAddress);\n  }\n\n  /**\n   * Disconnects a given tm2 controller\n   * @param {Integer} id The ID of the desired controller\n   * @return {undefined}\n   */\n  disconnectController(id) {\n    const funcName = 'Tm2.disconnectController()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'integer', 0, funcName);\n    this.cxxDev.disconnectController(id);\n  }\n}\n\n/**\n * Class represents a stream configuration\n */\nclass StreamProfile {\n  constructor(cxxProfile) {\n    this.cxxProfile = cxxProfile;\n    this.streamValue = this.cxxProfile.stream();\n    this.formatValue = this.cxxProfile.format();\n    this.fpsValue = this.cxxProfile.fps();\n    this.indexValue = this.cxxProfile.index();\n    this.uidValue = this.cxxProfile.uniqueID();\n    this.isDefaultValue = this.cxxProfile.isDefault();\n  }\n\n  /**\n   * Get stream index the input profile in case there are multiple streams of the same type\n   *\n   * @return {Integer}\n   */\n  get streamIndex() {\n    return this.indexValue;\n  }\n\n  /**\n   * Get stream type\n   *\n   * @return {Integer}\n   */\n  get streamType() {\n    return this.streamValue;\n  }\n\n  /**\n   * Get binary data format\n   *\n   * @return {Integer}\n   */\n  get format() {\n    return this.formatValue;\n  }\n\n  /**\n   * Expected rate for data frames to arrive, meaning expected number of frames per second\n   *\n   * @return {Integer}\n   */\n  get fps() {\n    return this.fpsValue;\n  }\n\n  /**\n   * Get the identifier for the stream profile, unique within the application\n   *\n   * @return {Integer}\n   */\n  get uniqueID() {\n    return this.uidValue;\n  }\n\n  /**\n   * Returns non-zero if selected profile is recommended for the sensor\n   * This is an optional hint we offer to suggest profiles with best performance-quality tradeof\n   *\n   * @return {Boolean}\n   */\n  get isDefault() {\n    return this.isDefaultValue;\n  }\n\n  /**\n   * Extrinsics:\n   * @typedef {Object} ExtrinsicsObject\n   * @property {Float32[]} rotation - Array(9), Column-major 3x3 rotation matrix\n   * @property {Float32[]} translation - Array(3), Three-element translation vector, in meters\n   * @see [StreamProfile.getExtrinsicsTo()]{@link StreamProfile#getExtrinsicsTo}\n   */\n\n  /**\n   * Get extrinsics from a this stream to the target stream\n   *\n   * @param {StreamProfile} toProfile the target stream profile\n   * @return {ExtrinsicsObject}\n   */\n  getExtrinsicsTo(toProfile) {\n    const funcName = 'StreamProfile.getExtrinsicsTo()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, StreamProfile, 0, funcName);\n    return this.cxxProfile.getExtrinsicsTo(toProfile.cxxProfile);\n  }\n\n  destroy() {\n    if (this.cxxProfile) {\n      this.cxxProfile.destroy();\n      this.cxxProfile = undefined;\n    }\n  }\n\n  static _internalCreateStreamProfile(cxxProfile) {\n    if (cxxProfile.isMotionProfile()) {\n      return new MotionStreamProfile(cxxProfile);\n    } else if (cxxProfile.isVideoProfile()) {\n      return new VideoStreamProfile(cxxProfile);\n    } else {\n      return new StreamProfile(cxxProfile);\n    }\n  }\n}\n\n/**\n * Motion intrinsics: scale, bias, and variances.\n * @typedef {Object} MotionIntrinsics\n * @property {Float32[]} data - Array(12), Interpret data array values. Indices are:\n *   <br>[0 - Scale X, 1 - cross axis, 2 - cross axis, 3 - Bias X,\n *   <br> 4 - cross axis, 5 - Scale Y, 6 - cross axis, 7 - Bias Y,\n *   <br> 8 - cross axis, 9 - cross axis, 10 - Scale Z, 11 - Bias Z]\n * @property {Float32[]} noiseVariances - Array(3), Variance of noise for X, Y, and Z axis\n * @property {Float32[]} biasVariances - Array(3), Variance of bias for X, Y, and Z axis\n * @see [MotionStreamProfile.getMotionIntrinsics()]{@link MotionStreamProfile#getMotionIntrinsics}\n */\n\n/**\n * This represent the stream profile of motion stream\n */\nclass MotionStreamProfile extends StreamProfile {\n  constructor(cxxProfile) {\n    super(cxxProfile);\n  }\n\n  /**\n   * Returns scale and bias of a motion stream.\n   * @return {MotionIntrinsics} {@link MotionIntrinsics}\n   */\n  getMotionIntrinsics() {\n    return this.cxxProfile.getMotionIntrinsics();\n  }\n}\n\n/**\n * List of devices\n */\nclass DeviceList {\n  constructor(cxxList) {\n    this.cxxList = cxxList;\n    internal.addObject(this);\n  }\n\n  /**\n   * Release resources associated with the object\n   */\n  destroy() {\n    if (this.cxxList) {\n      this.cxxList.destroy();\n      this.cxxList = undefined;\n    }\n  }\n\n  /**\n   * Checks if a specific device is contained inside a device list.\n   *\n   * @param {Device} device the camera to be checked\n   * @return {Boolean} true if the camera is contained in the list, otherwise false\n   */\n  contains(device) {\n    const funcName = 'DeviceList.contains()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, Device, 0, funcName);\n    return this.cxxList.contains(device.cxxDev);\n  }\n\n  /**\n   * Creates a device by index. The device object represents a physical camera and provides the\n   * means to manipulate it.\n   *\n   * @param {Integer} index the zero based index of the device in the device list\n   * @return {Device|undefined}\n   */\n  getDevice(index) {\n    const funcName = 'DeviceList.getDevice()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'number', 0, funcName, 0, this.size);\n    let dev = this.cxxList.getDevice(index);\n    return dev ? Device._internalCreateDevice(dev) : undefined;\n  }\n\n  get devices() {\n    let len = this.cxxList.size();\n    if (!len) {\n      return undefined;\n    }\n    let output = [];\n    for (let i = 0; i < len; i++) {\n      output[i] = Device._internalCreateDevice(this.cxxList.getDevice(i));\n    }\n    return output;\n  }\n  /**\n   * Determines number of devices in a list.\n   * @return {Integer}\n   */\n  get size() {\n    return this.cxxList.size();\n  }\n\n  /**\n   * Get the first device\n   * @return {Device|undefined}\n   */\n  get front() {\n    return this.getDevice(0);\n  }\n\n  /**\n   * Get the last device\n   * @return {Device|undefined}\n   */\n  get back() {\n    if (this.size > 0) {\n      return this.getDevice(this.size - 1);\n    }\n    return undefined;\n  }\n}\n\nclass VideoStreamProfile extends StreamProfile {\n  /**\n   * Construct a device object, representing a RealSense camera\n   */\n  constructor(cxxProfile) {\n    super(cxxProfile);\n\n    // TODO(tinshao): determine right width and height value\n    this.widthValue = this.cxxProfile.width();\n    this.heightValue = this.cxxProfile.height();\n  }\n\n  /**\n   * Width in pixels of the video stream\n   *\n   * @return {Integer}\n   */\n  get width() {\n    return this.widthValue;\n  }\n\n\n  /**\n   * height in pixels of the video stream\n   *\n   * @return {Integer}\n   */\n  get height() {\n    return this.heightValue;\n  }\n\n  /**\n   * Stream intrinsics:\n   * @typedef {Object} IntrinsicsObject\n   * @property {Integer} width - Width of the image in pixels\n   * @property {Integer} height - Height of the image in pixels\n   * @property {Float32} ppx - Horizontal coordinate of the principal point of the image, as a\n   * pixel offset from the left edge\n   * @property {Float32} ppy - Vertical coordinate of the principal point of the image, as a pixel\n   * offset from the top edge\n   * @property {Float32} fx - Focal length of the image plane, as a multiple of pixel width\n   * @property {Float32} fy - Focal length of the image plane, as a multiple of pixel height\n   * @property {Integer} model - Distortion model of the image, see\n   * @property {Float32[]} coeffs - Array(5), Distortion coefficients\n   * @see [StreamProfile.getIntrinsics()]{@link StreamProfile#getIntrinsics}\n   */\n\n  /**\n   * When called on a VideoStreamProfile, returns the intrinsics of specific stream configuration\n   * @return {IntrinsicsObject|undefined}\n   */\n  getIntrinsics() {\n    return this.cxxProfile.getVideoStreamIntrinsics();\n  }\n}\n\nclass Options {\n  constructor(cxxObj) {\n    this.cxxObj = cxxObj;\n  }\n\n  setCxxOptionsObject(cxxObj) {\n    this.cxxObj = cxxObj;\n  }\n  /**\n  * Check if particular option is read-only\n  * @param {String|Number} option The option to be checked\n  * @return {Boolean|undefined} true if option is read-only and undefined if not supported\n  */\n  isOptionReadOnly(option) {\n    const funcName = 'Options.isOptionReadOnly()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const o = checkArgumentType(arguments, constants.option, 0, funcName);\n    if (!this.cxxObj.supportsOption(o)) {\n      return undefined;\n    }\n\n    return this.cxxObj.isOptionReadonly(o);\n  }\n\n  /**\n   * Read option value from the sensor.\n   * @param {String|Number} option  The option to be queried\n   * @return {Float32|undefined} The value of the option, or <code>undefined</code> if invalid\n   * option\n   * @see {@link option}\n   */\n  getOption(option) {\n    const funcName = 'Options.getOption()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const o = checkArgumentType(arguments, constants.option, 0, funcName);\n    if (!this.cxxObj.supportsOption(o)) {\n      return undefined;\n    }\n\n    return this.cxxObj.getOption(o);\n  }\n\n  /**\n   * @typedef {Object} OptionRangeObject\n   * @property {Float32} minValue - the minimum value which will be accepted for this option\n   * @property {Float32} maxValue - the maximum value which will be accepted for this option\n   * @property {Float32} defaultValue - the default value of the option\n   * @property {Float32} step - the granularity of options which accept discrete values, or zero if\n   * the option accepts continuous values\n   * @see [Sensor.getOptionRange()]{@link Sensor#getOptionRange}\n   */\n\n  /**\n   * Retrieve the available range of values of a supported option.\n   * @param {String|Integer} option - the option that is being queried. See {@link option} for\n   * available values\n   * @return {OptionRangeObject|undefined} Returns undefined if an invalid option was specified\n   * @see {@link OptionRangeObject}\n   * @see {@link option}\n   *\n   * @example <caption>Example of 3 equivalent calls of the same option range</caption>\n   * Sensor.getOptionRange('backlight-compensation');\n   * Sensor.getOptionRange(realsense2.option.option_backlight_compensation);\n   * Sensor.getOptionRange(realsense2.option.OPTION_BACKLIGHT_COMPENSATION);\n   */\n  getOptionRange(option) {\n    const funcName = 'Options.getOptionRange()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const o = checkArgumentType(arguments, constants.option, 0, funcName);\n    if (!this.cxxObj.supportsOption(o)) {\n      return undefined;\n    }\n    return this.cxxObj.getOptionRange(o);\n  }\n\n  /**\n   * Write new value to device option.\n   * @param {String|Integer} option - the option that is being queried. See {@link option} for\n   * available values\n   * @param {Float32} value - the new value to be set\n   * @see {@link option}\n   * @return {undefined}\n   */\n  setOption(option, value) {\n    const funcName = 'Options.setOption()';\n    checkArgumentLength(2, 2, arguments.length, funcName);\n    const o = checkArgumentType(arguments, constants.option, 0, funcName);\n    checkArgumentType(arguments, 'number', 1, funcName);\n    if (!this.cxxObj.supportsOption(o) || this.cxxObj.isOptionReadonly(o)) {\n      return undefined;\n    }\n    if (!this._internalIsOptionValueInRange(o, value)) {\n      return undefined;\n    }\n    this.cxxObj.setOption(o, value);\n  }\n\n  /**\n   * Check if particular option is supported by a subdevice.\n   * @param {String|Integer} option - the option that is being queried. See {@link option} for\n   * available values\n   * @return {Boolean|undefined} Returns undefined if an invalid option was specified\n   * @see {@link option}\n   */\n  supportsOption(option) {\n    const funcName = 'Options.supportsOption()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const o = checkArgumentType(arguments, constants.option, 0, funcName);\n    return this.cxxObj.supportsOption(o);\n  }\n\n  /**\n   * Get option description.\n   * @param {String|Integer} option - the option that is being queried. See {@link option} for\n   * available values\n   * @return {String|undefined} the human readable description of the option. Returns undefined if\n   * an invalid option was specified\n   * @see {@link option}\n   */\n  getOptionDescription(option) {\n    const funcName = 'Options.getOptionDescription()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const o = checkArgumentType(arguments, constants.option, 0, funcName);\n    if (!this.cxxObj.supportsOption(o)) {\n      return undefined;\n    }\n    return this.cxxObj.getOptionDescription(o);\n  }\n\n  /**\n   * Get option value description (in case specific option value hold special meaning).\n   * @param {String|Integer} option - the option that is being queried. See {@link option} for\n   * available values\n   * @return {String|undefined} the human readable description of the option value. Returns\n   * undefined if an invalid option was specified\n   * @see {@link option}\n   */\n  getOptionValueDescription(option, value) {\n    const funcName = 'Options.getOptionValueDescription()';\n    checkArgumentLength(2, 2, arguments.length, funcName);\n    const o = checkArgumentType(arguments, constants.option, 0, funcName);\n    checkArgumentType(arguments, 'number', 1, funcName);\n    if (!this.cxxObj.supportsOption(o)) {\n      return undefined;\n    }\n    return this.cxxObj.getOptionValueDescription(o, value);\n  }\n\n  _internalIsOptionValueInRange(option, value) {\n    let range = this.getOptionRange(option);\n    return (range && value >= range.minValue && value <= range.maxValue);\n  }\n}\n\n/**\n * A sensor device in a RealSense camera\n */\nclass Sensor extends Options {\n  /**\n   * Construct a Sensor object, representing a RealSense camera subdevice\n   * By default, native resources associated with a Sensor object are freed\n   * automatically during cleanup.\n   */\n  constructor(cxxSensor, autoDelete = true) {\n    super(cxxSensor);\n    this.cxxSensor = cxxSensor;\n    this._events = new EventEmitter();\n    if (autoDelete === true) {\n      internal.addObject(this);\n    }\n  }\n\n  /**\n   * Check if everything is OK, e.g. if the device object is connected to underlying hardware\n   * @return {Boolean}\n   */\n  get isValid() {\n    return (this.cxxSensor !== null);\n  }\n\n  /**\n   * Open subdevice for exclusive access, by committing to a configuration.\n   *  There are 2 acceptable forms of syntax:\n   * <pre><code>\n   *  Syntax 1. open(streamProfile)\n   *  Syntax 2. open(profileArray)\n   * </code></pre>\n   *  Syntax 2 is for opening multiple profiles in one function call\n   *\n   * @param {StreamProfile} streamProfile configuration commited by the device\n   * @param {StreamProfile[]} profileArray configurations array commited by the device\n   * @see [Sensor.getStreamProfiles]{@link Sensor#getStreamProfiles} for a list of all supported\n   * stream profiles\n   */\n  open(streamProfile) {\n    const funcName = 'Sensor.open()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    if (Array.isArray(streamProfile) && streamProfile.length > 0) {\n      let cxxStreamProfiles = [];\n      for (let i = 0; i < streamProfile.length; i++) {\n        if (!(streamProfile[i] instanceof StreamProfile)) {\n          throw new TypeError(\n              'Sensor.open() expects a streamProfile object or an array of streamProfile objects'); // eslint-disable-line\n        }\n        cxxStreamProfiles.push(streamProfile[i].cxxProfile);\n      }\n      this.cxxSensor.openMultipleStream(cxxStreamProfiles);\n    } else {\n      checkArgumentType(arguments, StreamProfile, 0, funcName);\n      this.cxxSensor.openStream(streamProfile.cxxProfile);\n    }\n  }\n\n  /**\n   * Check if specific camera info is supported\n   * @param {String|Integer} info - info type to query. See {@link camera_info} for available values\n   * @return {Boolean|undefined} Returns undefined if an invalid info type was specified.\n   * @see enum {@link camera_info}\n   */\n  supportsCameraInfo(info) {\n    const funcName = 'Sensor.supportsCameraInfo()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.camera_info, 0, funcName);\n    return this.cxxSensor.supportsCameraInfo(i);\n  }\n\n  /**\n   * Get camera information of the sensor\n   *\n   * @param {String|Integer} info - the camera_info type, see {@link camera_info} for available\n   * values\n   * @return {String|undefined}\n   */\n  getCameraInfo(info) {\n    const funcName = 'Sensor.getCameraInfo()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.camera_info, 0, funcName);\n    return (this.cxxSensor.supportsCameraInfo(i) ? this.cxxSensor.getCameraInfo(i) : undefined);\n  }\n\n  /**\n  * Stops any streaming and close subdevice.\n  * @return {undefined} No return value\n  */\n  close() {\n    this.cxxSensor.close();\n  }\n\n  /**\n  * Delete the resource for accessing the subdevice. The device would not be accessable from\n  * this object after the operation.\n  * @return {undefined} No return value\n  */\n  destroy() {\n    this._events = null;\n    if (this.cxxSensor) {\n      this.cxxSensor.destroy();\n      this.cxxSensor = undefined;\n    }\n  }\n\n  /**\n   * This callback is called when a frame is captured\n   * @callback FrameCallback\n   * @param {Frame} frame - The captured frame\n   *\n   * @see [Sensor.start]{@link Sensor#start}\n   */\n\n  /**\n   * Start passing frames into user provided callback\n   * There are 2 acceptable syntax:\n   * <pre><code>\n   *  Syntax 1. start(callback)\n   *  Syntax 2. start(Syncer)\n   * </code></pre>\n   *\n   * @param {FrameCallback} callback\n   * @param {Syncer} syncer, the syncer to synchronize frames\n   *\n   * @example <caption>Simply do logging when a frame is captured</caption>\n   *  sensor.start((frame) => {\n   *    console.log(frame.timestamp, frame.frameNumber, frame.data);\n   *  });\n   *\n   */\n  start(callback) {\n    const funcName = 'Sensor.start()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    if (arguments[0] instanceof Syncer) {\n      this.cxxSensor.startWithSyncer(arguments[0].cxxSyncer, false, 0);\n    } else {\n      checkArgumentType(arguments, 'function', 0, funcName);\n      // create object to hold frames generated from native.\n      this.frame = new Frame();\n      this.depthFrame = new DepthFrame();\n      this.videoFrame = new VideoFrame();\n      this.disparityFrame = new DisparityFrame();\n      this.motionFrame = new MotionFrame();\n      this.poseFrame = new PoseFrame();\n\n      let inst = this;\n      this.cxxSensor.frameCallback = function() {\n        // When the callback is triggered, the underlying frame bas been saved in the objects\n        // created above, we need to update it and callback.\n        if (inst.disparityFrame.isValid) {\n          inst.disparityFrame.updateProfile();\n          callback(inst.disparityFrame);\n        } else if (inst.depthFrame.isValid) {\n          inst.depthFrame.updateProfile();\n          callback(inst.depthFrame);\n        } else if (inst.videoFrame.isValid) {\n          inst.videoFrame.updateProfile();\n          callback(inst.videoFrame);\n        } else if (inst.motionFrame.isValid) {\n          inst.motionFrame.updateProfile();\n          callback(inst.motionFrame);\n        } else if (inst.poseFrame.isValid) {\n          inst.poseFrame.updateProfile();\n          callback(inst.poseFrame);\n        } else {\n          inst.frame.updateProfile();\n          callback(inst.frame);\n        }\n      };\n      this.cxxSensor.startWithCallback('frameCallback', this.frame.cxxFrame,\n          this.depthFrame.cxxFrame, this.videoFrame.cxxFrame, this.disparityFrame.cxxFrame,\n          this.motionFrame.cxxFrame, this.poseFrame.cxxFrame);\n    }\n  }\n\n  /**\n   * stop streaming\n   * @return {undefined} No return value\n   */\n  stop() {\n    if (this.cxxSensor) {\n      this.cxxSensor.stop();\n    }\n    if (this.frame) this.frame.release();\n    if (this.videoFrame) this.videoFrame.release();\n    if (this.depthFrame) this.depthFrame.release();\n  }\n\n  /**\n   * @typedef {Object} NotificationEventObject\n   * @property {String} descr - The human readable literal description of the notification\n   * @property {Float}  timestamp - The timestamp of the notification\n   * @property {String} severity - The severity of the notification\n   * @property {String} category - The category of the notification\n   * @property {String} serializedData - The serialized data of the notification\n   */\n\n  /**\n   * This callback is called when there is a device notification\n   * @callback NotificationCallback\n   * @param {NotificationEventObject} info\n   * @param {String} info.descr - See {@link NotificationEventObject} for details\n   * @param {Float}  info.timestamp - See {@link NotificationEventObject} for details\n   * @param {String} info.severity - See {@link NotificationEventObject} for details\n   * @param {String} info.category - See {@link NotificationEventObject} for details\n   * @param {String} info.serializedData - See {@link NotificationEventObject} for details\n   *\n   * @see {@link NotificationEventObject}\n   * @see [Sensor.setNotificationsCallback()]{@link Sensor#setNotificationsCallback}\n   */\n\n  /**\n   * @event Sensor#notification\n   * @param {NotificationEventObject} evt\n   * @param {String} evt.descr - See {@link NotificationEventObject} for details\n   * @param {Float}  evt.timestamp - See {@link NotificationEventObject} for details\n   * @param {String} evt.severity - See {@link NotificationEventObject} for details\n   * @param {String} evt.category - See {@link NotificationEventObject} for details\n   * @param {String} evt.serializedData - See {@link NotificationEventObject} for details\n   * @see {@link NotificationEventObject}\n   * @see [Sensor.setNotificationsCallback()]{@link Sensor#setNotificationsCallback}\n   */\n\n  /**\n   * register notifications callback\n   * @param {NotificationCallback} callback The user-provied notifications callback\n   * @see {@link NotificationEventObject}\n   * @see [Sensor 'notification']{@link Sensor#event:notification} event\n   * @return {undefined}\n   */\n  setNotificationsCallback(callback) {\n    const funcName = 'Sensor.setNotificationsCallback()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'function', 0, funcName);\n\n    this._events.on('notification', (info) => {\n      callback(info);\n    });\n    let inst = this;\n    if (!this.cxxSensor.notificationCallback) {\n      this.cxxSensor.notificationCallback = function(info) {\n        // convert the severity and category properties from numbers to strings to be\n        // consistent with documentation which are more meaningful to users\n        info.severity = log_severity.logSeverityToString(info.severity);\n        info.category = notification_category.notificationCategoryToString(info.category);\n        inst._events.emit('notification', info);\n      };\n      this.cxxSensor.setNotificationCallback('notificationCallback');\n    }\n    return undefined;\n  }\n\n  /**\n   * Get a list of stream profiles that given subdevice can provide. The returned profiles should be\n   * destroyed by calling its destroy() method.\n   *\n   * @return {StreamProfile[]} all of the supported stream profiles\n   * See {@link StreamProfile}\n   */\n  getStreamProfiles() {\n    let profiles = this.cxxSensor.getStreamProfiles();\n    if (profiles) {\n      const array = [];\n      profiles.forEach((profile) => {\n        array.push(StreamProfile._internalCreateStreamProfile(profile));\n      });\n      return array;\n    }\n  }\n}\n\n/**\n * Sensor for managing region of interest.\n */\nclass ROISensor extends Sensor {\n  /**\n   * Create a ROISensor out of another sensor\n   * @param {Sensor} sensor a sensor object\n   * @return {ROISensor|undefined} return a ROISensor if the sensor can be\n   * treated as a ROISensor, otherwise return undefined.\n   */\n  static from(sensor) {\n    if (sensor.cxxSensor.isROISensor()) {\n      return new ROISensor(sensor.cxxSensor);\n    }\n    return undefined;\n  }\n\n  /**\n   * Construct a ROISensor object, representing a RealSense camera subdevice\n   * The newly created ROISensor object shares native resources with the sensor\n   * argument. So the new object shouldn't be freed automatically to make\n   * sure resources released only once during cleanup.\n   */\n   constructor(cxxSensor) {\n    super(cxxSensor, false);\n  }\n\n  /**\n   * @typedef {Object} RegionOfInterestObject\n   * @property {Float32} minX - lower horizontal bound in pixels\n   * @property {Float32} minY - lower vertical bound in pixels\n   * @property {Float32} maxX - upper horizontal bound in pixels\n   * @property {Float32} maxY - upper vertical bound in pixels\n   * @see [Device.getRegionOfInterest()]{@link Device#getRegionOfInterest}\n   */\n\n  /**\n   * Get the active region of interest to be used by auto-exposure algorithm.\n   * @return {RegionOfInterestObject|undefined} Returns undefined if failed\n   * @see {@link RegionOfInterestObject}\n   */\n  getRegionOfInterest() {\n    return this.cxxSensor.getRegionOfInterest();\n  }\n\n  /**\n   * Set the active region of interest to be used by auto-exposure algorithm\n   * There are 2 acceptable forms of syntax:\n   * <pre><code>\n   *  Syntax 1. setRegionOfInterest(region)\n   *  Syntax 2. setRegionOfInterest(minX, minY, maxX, maxY)\n   * </code></pre>\n   *\n   * @param {RegionOfInterestObject} region - the region of interest to be used.\n   * @param {Float32} region.minX - see {@link RegionOfInterestObject} for details.\n   * @param {Float32} region.minY - see {@link RegionOfInterestObject} for details.\n   * @param {Float32} region.maxX - see {@link RegionOfInterestObject} for details.\n   * @param {Float32} region.maxY - see {@link RegionOfInterestObject} for details.\n   *\n   * @param {Float32} minX - see {@link RegionOfInterestObject} for details.\n   * @param {Float32} minY - see {@link RegionOfInterestObject} for details.\n   * @param {Float32} maxX - see {@link RegionOfInterestObject} for details.\n   * @param {Float32} maxY - see {@link RegionOfInterestObject} for details.\n   */\n  setRegionOfInterest(region) {\n    const funcName = 'ROISensor.setRegionOfInterest()';\n    checkArgumentLength(1, 4, arguments.length, funcName);\n    let minX;\n    let minY;\n    let maxX;\n    let maxY;\n    if (arguments.length === 1) {\n      checkArgumentType(arguments, 'object', 0, funcName);\n      minX = region.minX;\n      minY = region.minY;\n      maxX = region.maxX;\n      maxY = region.maxY;\n    } else if (arguments.length === 4) {\n      checkArgumentType(arguments, 'number', 0, funcName);\n      checkArgumentType(arguments, 'number', 1, funcName);\n      checkArgumentType(arguments, 'number', 2, funcName);\n      checkArgumentType(arguments, 'number', 3, funcName);\n      minX = arguments[0];\n      minY = arguments[1];\n      maxX = arguments[2];\n      maxY = arguments[3];\n    } else {\n      throw new TypeError(\n          'setRegionOfInterest(region) expects a RegionOfInterestObject as argument');\n    }\n    this.cxxSensor.setRegionOfInterest(minX, minY, maxX, maxY);\n  }\n}\n\n/**\n * Depth sensor\n */\nclass DepthSensor extends Sensor {\n  /**\n   * Construct a device object, representing a RealSense camera\n   */\n  constructor(sensor) {\n    super(sensor);\n  }\n\n  /**\n   * Retrieves mapping between the units of the depth image and meters.\n   *\n   * @return {Float} depth in meters corresponding to a depth value of 1\n   */\n  get depthScale() {\n    return this.cxxSensor.getDepthScale();\n  }\n}\n\nconst internal = {\n  ctx: [],\n  objs: [],\n\n  // Register error callback to native code\n  registerErrorCallback: function() {\n    RS2.registerErrorCallback(this, 'errorCallback');\n  },\n\n  // The callback method called from native side\n  errorCallback: function(error) {\n    let msg = 'error native function ' + error.nativeFunction + ': ' + error.description;\n    if (error.recoverable) {\n      throw new Error(msg);\n    }\n    throw new UnrecoverableError(msg);\n  },\n\n  addContext: function(c) {\n    this.ctx.push(c);\n  },\n\n  addObject: function(o) {\n    this.objs.push(o);\n  },\n\n  cleanup: function() {\n    this.objs.forEach((obj) => {\n      obj.destroy();\n    });\n    this.objs = [];\n    this.ctx.forEach((context) => {\n      context.destroy();\n    });\n    this.ctx = [];\n  },\n\n  cleanupContext: function() {\n    let newArray = [];\n    this.ctx.forEach((c) => {\n      if (c.cxxCtx) {\n        newArray.push(c);\n      }\n    });\n    // Dropping reference to invalid context(s)\n    this.ctx = newArray;\n  },\n};\n\n/**\n * Default librealsense context class,\n */\nclass Context {\n  /**\n   * There are only one acceptable form of syntax to create a Context for users:\n   * <pre><code>\n   *  new Context();\n   * </code></pre>\n   * other forms are reserved for internal use only.\n   */\n  constructor(cxxCtx) {\n    const funcName = 'Context.constructor()';\n    // Internal code will create Context with cxxObject or other params\n    checkDiscreteArgumentLength([0, 1, 3, 4], arguments.length, funcName);\n    this._events = new EventEmitter();\n    if (arguments.length === 0) {\n      this.cxxCtx = new RS2.RSContext();\n      this.cxxCtx.create();\n    } else if (arguments.length === 1) {\n      checkArgumentType(arguments, RS2.RSContext, 0, funcName);\n      this.cxxCtx = cxxCtx;\n    } else {\n      checkArgumentType(arguments, 'string', 0, funcName);\n      checkDiscreteArgumentValue(arguments, 0, ['recording', 'playback'], funcName);\n      this.cxxCtx = new (Function.prototype.bind.apply(\n          RS2.RSContext, [null].concat(Array.from(arguments))))();\n      this.cxxCtx.create();\n    }\n    this.cxxCtx._events = this._events;\n    internal.addContext(this);\n  }\n\n  /**\n   * Cleanup underlying C++ context, and release all resources that were created by this context.\n   * The JavaScript Context object(s) will not be garbage-collected without call(s) to this function\n   */\n  destroy() {\n    if (this.cxxCtx) {\n      this.cxxCtx.destroy();\n      this.cxxCtx = undefined;\n      internal.cleanupContext();\n    }\n  }\n\n  /**\n   * Get the events object of EventEmitter\n   * @return {EventEmitter}\n   */\n  get events() {\n    return this._events;\n  }\n\n  /**\n  * Create a static snapshot of all connected devices at the time of the call\n  * @return {DeviceList|undefined} connected devices at the time of the call\n  */\n  queryDevices() {\n    let list = this.cxxCtx.queryDevices();\n    return (list ? new DeviceList(list) : undefined);\n  }\n\n  /**\n  * Generate an array of all available sensors from all RealSense devices\n  * @return {Sensor[]|undefined}\n  */\n  querySensors() {\n    let devList = this.queryDevices();\n    if (!devList) {\n      return undefined;\n    }\n    let devices = devList.devices;\n    if (devices && devices.length) {\n      const array = [];\n      devices.forEach((dev) => {\n        const sensors = dev.querySensors();\n        sensors.forEach((sensor) => {\n          array.push(sensor);\n        });\n      });\n      return array;\n    }\n    return undefined;\n  }\n\n  /**\n   * Get the device from one of its sensors\n   *\n   * @param {Sensor} sensor\n   * @return {Device|undefined}\n   */\n  getSensorParent(sensor) {\n    const funcName = 'Context.getSensorParent()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, Sensor, 0, funcName);\n\n    let cxxDev = this.cxxCtx.createDeviceFromSensor(sensor.cxxSensor);\n    if (!cxxDev) {\n      return undefined;\n    }\n    return Device._internalCreateDevice(cxxDev);\n  }\n\n  /**\n   * When one or more devices are plugged or unplugged into the system\n   * @event Context#device-changed\n   * @param {DeviceList} removed - The devices removed from the system\n   * @param {DeviceList} added - The devices added to the system\n   */\n\n  /**\n   * This callback is called when number of devices is changed\n   * @callback devicesChangedCallback\n   * @param {DeviceList} removed - The devices removed from the system\n   * @param {DeviceList} added - The devices added to the system\n   *\n   * @see [Context.setDevicesChangedCallback]{@link Context#setDevicesChangedCallback}\n   */\n\n  /**\n   * Register a callback function to receive device-changed notification\n   * @param {devicesChangedCallback} callback - devices changed callback\n   */\n  setDevicesChangedCallback(callback) {\n    const funcName = 'Context.setDevicesChangedCallback()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'function', 0, funcName);\n\n    this._events.on('device-changed', (removed, added) => {\n      callback(removed, added);\n    });\n    let inst = this;\n    if (!this.cxxCtx.deviceChangedCallback) {\n      this.cxxCtx.deviceChangedCallback = function(removed, added) {\n        let rmList = (removed ? new DeviceList(removed) : undefined);\n        let addList = (added ? new DeviceList(added) : undefined);\n        inst._events.emit('device-changed', rmList, addList);\n      };\n      this.cxxCtx.setDevicesChangedCallback('deviceChangedCallback');\n    }\n  }\n\n  /**\n   * Create a PlaybackDevice to playback recored data file.\n   *\n   * @param {String} file - the file path\n   * @return {PlaybackDevice|undefined}\n   */\n  loadDevice(file) {\n    const funcName = 'Context.loadDevice()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'string', 0, funcName);\n    checkFileExistence(file);\n    const cxxDev = this.cxxCtx.loadDeviceFile(file);\n    if (!cxxDev) {\n      return undefined;\n    }\n    return new PlaybackDevice(cxxDev, true);\n  }\n\n  /**\n   * Removes a PlaybackDevice from the context, if exists\n   *\n   * @param {String} file The file name that was loaded to create the playback device\n   */\n  unloadDevice(file) {\n    const funcName = 'Context.unloadDevice()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'string', 0, funcName);\n    checkFileExistence(file);\n    this.cxxCtx.unloadDeviceFile(file);\n  }\n}\n\n/**\n * This class is for testing purpose.\n * It is used to record all operations over librealsense into a file\n * @extends Context\n */\nclass RecordingContext extends Context {\n  /**\n   * @param {String} fileName The file name to store the recorded data\n   * @param {String} section The section name within the recording\n   * @param {String|Integer} mode Recording mode, default to 'blank-frames'\n   * @see [enum recording_mode]{@link recording_mode}\n   */\n  constructor(fileName, section = '', mode = 'blank-frames') {\n    const funcName = 'RecordingContext.constructor()';\n    checkArgumentLength(1, 3, arguments.length, funcName);\n    checkArgumentType(arguments, 'string', 0, funcName);\n    checkArgumentType(arguments, 'string', 1, funcName);\n    let m = checkArgumentType(arguments, constants.recording_mode, 2, funcName);\n    m = (m === undefined ? recordingMode2Int(mode) : m);\n    super('recording', fileName, section, m);\n  }\n}\n\n/**\n * This class is for testing purpose.\n * It is used to reproduce the same responses for the same operations as\n * recording. The user must call the same methods as recorded in the file\n * to get correct response.\n * @extends Context\n */\nclass PlaybackContext extends Context {\n  /**\n   * @param {String} fileName The file name of the recording\n   * @param {String} section The section name used in recording\n   */\n  constructor(fileName, section = '') {\n    const funcName = 'PlaybackContext.constructor()';\n    checkArgumentLength(1, 2, arguments.length, funcName);\n    checkArgumentType(arguments, 'string', 0, funcName);\n    checkArgumentType(arguments, 'string', 1, funcName);\n    checkFileExistence(fileName);\n    super('playback', fileName, section);\n  }\n}\n\n/**\n * This class provides the ability to record a live session of streaming to a file\n *\n * There are 2 ways for users to create a RecorderDevice:\n * <pre><code>\n *  Syntax 1. RecorderDevice.from(device);\n *  Syntax 2. new RecorderDevice(file, device);\n * </code></pre>\n *\n * Syntax 1 can only be applied to device that can be converted to RecorderDevice, see\n * below example:\n * <pre><code>\n *  const file = 'record.bag';\n *  let cfg = new rs2.Config();\n *  cfg.enableRecordToFile(file);\n *  let pipe = new rs2.Pipeline();\n *  pipe.start(cfg);\n *  let device = pipe.getActiveProfile().getDevice();\n *  let recorder = rs2.RecorderDevice.from(device);\n *\n *  // record 10 frames.\n *  for (let i = 0; i < 10; i++) {\n *    let frames = pipe.waitForFrames();\n *  }\n *\n *  pipe.stop();\n *  // cleanup and make sure the recorded frames are flushed to file\n *  rs2.cleanup();\n * </code></pre>\n *\n * Syntax 2 is to create a RecorderDevice from a live device, see below example:\n * <pre><code>\n *  let ctx = new rs2.Context();\n *  let dev = ctx.queryDevices().devices[0];\n *  // record to file record.bag\n *  let recorder = new rs2.RecorderDevice('record.bag', dev);\n *  let sensors = recorder.querySensors();\n *  let sensor = sensors[0];\n *  let profiles = sensor.getStreamProfiles();\n *\n *  for (let i =0; i < profiles.length; i++) {\n *    if (profiles[i].streamType === rs2.stream.STREAM_DEPTH &&\n *        profiles[i].fps === 30 &&\n *        profiles[i].width === 640 &&\n *        profiles[i].height === 480 &&\n *        profiles[i].format === rs2.format.FORMAT_Z16) {\n *      sensor.open(profiles[i]);\n *    }\n *  }\n *\n *  // record 10 frames\n *  let cnt = 0;\n *  sensor.start((frame) => {\n *    cnt++;\n *    if (cnt === 10) {\n *      // stop recording\n *      recorder.reset();\n *      rs2.cleanup();\n *      console.log('Recorded ', cnt, ' frames');\n *    }\n *  })\n * </code></pre>\n * @extends Device\n */\nclass RecorderDevice extends Device {\n  /**\n   * Create a RecorderDevice from another device\n   *\n   * @param {Device} device another existing device\n   * @return {RecorderDevice|undefined} If the the input device can be\n   * converted to a RecorderDevice, return the newly created RecorderDevice,\n   * otherwise, undefined is returned.\n   */\n  static from(device) {\n    return device.cxxDev.isRecorder() ?\n        new RecorderDevice(null, null, device.cxxDev, false) : undefined;\n  }\n\n  /**\n   * @param {String} file the file name to store the recorded data\n   * @param {Device} device the actual device to be recorded\n   */\n  constructor(file, device, cxxDev = undefined, autoDelete = true) {\n    const funcName = 'RecorderDevice.constructor()';\n    checkArgumentLength(2, 4, arguments.length, funcName);\n    if (arguments[0] && arguments[1]) {\n      checkArgumentType(arguments, 'string', 0, funcName);\n      checkArgumentType(arguments, Device, 1, funcName);\n    } else if (arguments[2]) {\n      checkArgumentType(arguments, 'object', 2, funcName);\n      checkArgumentType(arguments, 'boolean', 3, funcName);\n    } else {\n      throw new TypeError('Invalid parameters for new RecorderDevice()');\n    }\n    super(cxxDev ? cxxDev : device.cxxDev.spawnRecorderDevice(file), autoDelete);\n  }\n  /**\n   * Pause the recording device without stopping the actual device from streaming.\n   */\n  pause() {\n    this.cxxDev.pauseRecord();\n  }\n  /**\n   * Resume the recording\n   */\n  resume() {\n    this.cxxDev.resumeRecord();\n  }\n  /**\n   * Gets the name of the file to which the recorder is writing\n   * @return {String}\n   */\n  get fileName() {\n    return this.cxxDev.getFileName();\n  }\n}\n\n/**\n * This class is used to playback the file recorded by RecorderDevice\n * There are 2 ways for users to create a PlaybackDevice:\n * <pre><code>\n *  Syntax 1: PlaybackDevice.from(device)\n *  Syntax 2: Context.loadDevice(filePath)\n * </code></pre>\n *\n * Syntax 1 is to convert an existing device to a PlaybackDevice which can only be\n * applied to device that can be converted. Here is an example:\n * <pre><code>\n *  const file = 'record.bag';\n *  let cfg = new rs2.Config();\n *  cfg.enableDeviceFromFile(file);\n *  let pipe = new rs2.Pipeline();\n *  pipe.start(cfg);\n *  let device = pipe.getActiveProfile().getDevice();\n *  let playback = rs2.PlaybackDevice.from(device);\n *\n *  for (let i = 0; i < 10; i++) {\n *    let frames = pipe.waitForFrames();\n *  }\n *\n *  pipe.stop();\n *  rs2.cleanup();\n * </code></pre>\n *\n * Syntax 2 is to create a PlaybackDevice through Context. Here is an example:\n * <pre><code>\n *  let ctx = new rs2.Context();\n *  // load the recorded file\n *  let dev = ctx.loadDevice('record.bag');\n *  let sensors = dev.querySensors();\n *  let sensor = sensors[0];\n *  let profiles = sensor.getStreamProfiles();\n *  let cnt = 0;\n *\n *  // when received 'stopped' status, stop playback\n *  dev.setStatusChangedCallback((status) => {\n *    console.log('playback status: ', status);\n *    if (status.description === 'stopped') {\n *      dev.stop();\n *      ctx.unloadDevice('record.bag');\n *      rs2.cleanup();\n *      console.log('Playback ', cnt, ' frames');\n *    }\n *  });\n *\n *  // start playback\n *  sensor.open(profiles);\n *  sensor.start((frame) => {\n *    cnt ++;\n *  });\n * </code></pre>\n * @extends Device\n * @see [Context.loadDevice]{@link Context#loadDevice}\n */\nclass PlaybackDevice extends Device {\n  /**\n   * Create a PlaybackDevice from another device\n   *\n   * @param {Device} device another existing device that can be converted to a\n   * PlaybackDevice\n   * @return {PlaybackDevice|undefined} If the the input device can be\n   * converted to a PlaybackDevice, return the newly created PlaybackDevice,\n   * otherwise, undefined is returned.\n   */\n  static from(device) {\n    return device.cxxDev.isPlayback() ?\n        new PlaybackDevice(device.cxxDev, false) : undefined;\n  }\n\n  constructor(cxxdevice, autoDelete) {\n    super(cxxdevice, autoDelete);\n    this._events = new EventEmitter();\n  }\n  /**\n   * Pauses the playback\n   * Calling pause() in \"paused\" status does nothing\n   * If pause() is called while playback status is \"playing\" or \"stopped\", the playback will not\n   * play until resume() is called\n   * @return {undefined}\n   */\n  pause() {\n    this.cxxDev.pausePlayback();\n  }\n  /**\n   * Resumes the playback\n   * Calling resume() while playback status is \"playing\" or \"stopped\" does nothing\n   * @return {undefined}\n   */\n  resume() {\n    this.cxxDev.resumePlayback();\n  }\n  /**\n   * Stops playback\n   * @return {undefined}\n   */\n  stop() {\n    this.cxxDev.stopPlayback();\n  }\n  /**\n   * Retrieves the name of the playback file\n   * @return {String}\n   */\n  get fileName() {\n    return this.cxxDev.getFileName();\n  }\n  /**\n   * Retrieves the current position of the playback in the file in terms of time. Unit is\n   * millisecond\n   * @return {Integer}\n   */\n  get position() {\n    return this.cxxDev.getPosition();\n  }\n  /**\n   * Retrieves the total duration of the file, unit is millisecond.\n   * @return {Integer}\n   */\n  get duration() {\n    return this.cxxDev.getDuration();\n  }\n  /**\n   * Sets the playback to a specified time point of the played data\n   * @param {time} time the target time to seek to, unit is millisecond\n   * @return {undefined}\n   */\n  seek(time) {\n    const funcName = 'PlaybackDevice.seek()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'number', 0, funcName);\n    this.cxxDev.seek(time);\n  }\n  /**\n   * Indicates if playback is in real time mode or non real time\n   * In real time mode, playback will play the same way the file was recorded. If the application\n   * takes too long to handle the callback, frames may be dropped.\n   * In non real time mode, playback will wait for each callback to finish handling the data before\n   * reading the next frame. In this mode no frames will be dropped, and the application controls\n   * the frame rate of the playback (according to the callback handler duration).\n   * @return {Boolean}\n   */\n  get isRealTime() {\n    return this.cxxDev.isRealTime();\n  }\n  /**\n   * Set the playback to work in real time or non real time\n   * @param {boolean} val whether real time mode is used\n   * @return {undefined}\n   */\n  set isRealTime(val) {\n    const funcName = 'PlaybackDevice.isRealTime()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'boolean', 0, funcName);\n    this.cxxDev.setIsRealTime(val);\n  }\n  /**\n   * Set the playing speed\n   * @param {Float} speed indicates a multiplication of the speed to play (e.g: 1 = normal,\n   * 0.5 half normal speed)\n   */\n  setPlaybackSpeed(speed) {\n    const funcName = 'PlaybackDevice.setPlaybackSpeed()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'number', 0, funcName);\n    this.cxxDev.setPlaybackSpeed(speed);\n  }\n\n  /**\n   * @typedef {Object} PlaybackStatusObject\n   * @property {Integer} status - The status of the notification, see {@link playback_status}\n   * for details\n   * @property {String} description - The human readable literal description of the status\n   */\n\n  /**\n   * This callback is called when the status of the playback device changed\n   * @callback StatusChangedCallback\n   * @param {PlaybackStatusObject} status\n   *\n   * @see [PlaybackDevice.setStatusChangedCallback]{@link PlaybackDevice#setStatusChangedCallback}\n   */\n\n  /**\n   * Returns the current state of the playback device\n   * @return {PlaybackStatusObject}\n   */\n  get currentStatus() {\n    let cxxStatus = this.cxxDev.getCurrentStatus();\n    if (!cxxStatus) {\n      return undefined;\n    }\n    return {status: cxxStatus, description: playback_status.playbackStatusToString(cxxStatus)};\n  }\n\n  /**\n   * Register a callback to receive the playback device's status changes\n   * @param {StatusChangedCallback} callback the callback method\n   * @return {undefined}\n   */\n  setStatusChangedCallback(callback) {\n    const funcName = 'PlaybackDevice.setStatusChangedCallback()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'function', 0, funcName);\n    this._events.on('status-changed', (status) => {\n      callback({status: status, description: playback_status.playbackStatusToString(status)});\n    });\n    let inst = this;\n    if (!this.cxxDev.statusChangedCallback) {\n      this.cxxDev.statusChangedCallback = (status) => {\n        inst._events.emit('status-changed', status);\n      };\n      this.cxxDev.setStatusChangedCallbackMethodName('statusChangedCallback');\n    }\n  }\n}\n\ninternal.RecordingContext = RecordingContext;\ninternal.PlaybackContext = PlaybackContext;\n\n/**\n * PointCloud accepts depth frames and outputs Points frames\n * In addition, given non-depth frame, the block will align texture coordinate to the non-depth\n * stream\n */\nclass PointCloud extends Options {\n  constructor() {\n    super();\n    this.cxxPointCloud = new RS2.RSPointCloud();\n    this.setCxxOptionsObject(this.cxxPointCloud);\n    this.pointsFrame = new Points();\n  }\n\n  /**\n   * Calculate to get a frame of type {@link Points}, from the data of specified DepthFrame\n   * @param {DepthFrame} depthFrame the depth frame\n   * @return {Points|undefined}\n   */\n  calculate(depthFrame) {\n    const funcName = 'PointCloud.calculate()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, DepthFrame, 0, funcName);\n    this.pointsFrame.release();\n    if (this.cxxPointCloud.calculate(depthFrame.cxxFrame, this.pointsFrame.cxxFrame)) {\n      return this.pointsFrame;\n    }\n    return undefined;\n  }\n\n  /**\n   * Align texture coordinate to the mappedFrame\n   * @param {Frame} mappedFrame the frame being mapped to\n   * @return {undefined}\n   */\n  mapTo(mappedFrame) {\n    const funcName = 'PointCloud.mapTo()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, Frame, 0, funcName);\n    this.cxxPointCloud.mapTo(mappedFrame.cxxFrame);\n  }\n\n  release() {\n    if (this.cxxPointCloud) this.cxxPointCloud.destroy();\n    if (this.pointsFrame) this.pointsFrame.destroy();\n  }\n\n  /**\n   * Destroy all resources associated with the object\n   */\n  destroy() {\n    this.release();\n    this.cxxPointCloud = undefined;\n    this.pointsFrame = undefined;\n  }\n}\n\n/**\n * The Colorizer can be used to quickly visualize the depth data by tranform data into RGB8 format\n */\nclass Colorizer extends Options {\n  constructor() {\n    super();\n    this.cxxColorizer = new RS2.RSColorizer();\n    this.cxxColorizer.create();\n    this.setCxxOptionsObject(this.cxxColorizer);\n    this.depthRGB = new VideoFrame();\n  }\n\n  release() {\n    if (this.cxxColorizer) this.cxxColorizer.destroy();\n    if (this.depthRGB) this.depthRGB.destroy();\n  }\n\n  /**\n   * Destroy all resources associated with the colorizer\n   */\n  destroy() {\n    this.release();\n    this.cxxColorizer = undefined;\n    this.depthRGB = undefined;\n  }\n\n  get colorizedFrame() {\n    return this.depthRGB;\n  }\n\n  /**\n   * Tranform depth data into RGB8 format\n   *\n   * @param {DepthFrame} depthFrame the depth frame\n   * @return {VideoFrame|undefined}\n   */\n  colorize(depthFrame) {\n    const funcName = 'Colorizer.colorize()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    // Though depth frame is expected, color frame could also be processed, so\n    // only check whether the type is Frame\n    checkArgumentType(arguments, Frame, 0, funcName);\n    const success = this.cxxColorizer.colorize(depthFrame.cxxFrame, this.depthRGB.cxxFrame);\n    this.depthRGB.updateProfile();\n    return success ? this.depthRGB : undefined;\n  }\n}\n\n/**\n * This class can be used to perform alignment between a depth frame and another frame.\n */\nclass Align {\n  /**\n   * @param {Integer|String} stream the stream type to be aligned to. see {@link stream} for\n   * avaiable values. To perform alignment of a depth frame to the other frame, set the stream\n   * argument to the other stream type. To perform alignment of a non depth frame to a depth frame,\n   * set the stream argument to stream type of depth.\n   */\n  constructor(stream) {\n    const funcName = 'Align.constructor()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const s = checkArgumentType(arguments, constants.stream, 0, funcName);\n    this.cxxAlign = new RS2.RSAlign(s);\n    this.frameSet = new FrameSet();\n    internal.addObject(this);\n  }\n\n  /**\n   * Run the alignment process on the given frameset to get an aligned set of frames\n   * @param {FrameSet} frameSet the frames which at least has a depth frame\n   * @return {FrameSet}\n   */\n  process(frameSet) {\n    const funcName = 'Align.process()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, FrameSet, 0, funcName);\n    this.frameSet.release(); // Destroy all attached-frames (depth/color/etc.)\n    if (this.cxxAlign.process(frameSet.cxxFrameSet, this.frameSet.cxxFrameSet)) {\n      this.frameSet.__update();\n      return this.frameSet;\n    }\n    return undefined;\n  }\n\n  release() {\n    if (this.cxxAlign) this.cxxAlign.destroy();\n    if (this.frameSet) this.frameSet.destroy();\n  }\n\n  /**\n   * Destroy resources associated with the object\n   */\n  destroy() {\n    this.release();\n    this.cxxAlign = undefined;\n    this.frameSet = undefined;\n  }\n}\n\n/**\n * This class resprents a picture frame\n *\n * @property {Boolean} isValid - True if the frame is valid, otherwise false.\n * @property {Uint16Array|Uint8Array} data - A typed array representing the data.\n *  <br>The type of the typed array depends on the <code>format</code> specified in camera\n * configuration.\n * @property {Integer} width - The width of the frame.\n * @property {Integer} height - The height of the frame.\n * @property {Integer|Int64} frameNumber - An integer or an object representing the frame number.\n *  <br>If the frame number is less than 2^53, then the return value is an integer number;\n *  <br>Otherwise it will be an <code>Int64</code> object defined in npm module \"node-int64\"\n * @property {Number} timestamp - The timestamp of the frame.\n * @property {Integer} streamType - The stream type of the frame.\n * see <code>enum {@link stream}</code>\n * @property {Integer} bitsPerPixel - The number of bits per pixel\n * @property {Integer} timestampDomain - Get the domain (clock name) of timestamp value.\n */\nclass Frame {\n  constructor(cxxFrame) {\n    this.cxxFrame = cxxFrame || new RS2.RSFrame();\n    this.updateProfile();\n    internal.addObject(this);\n  }\n\n  updateProfile() {\n    this.streamProfile = undefined;\n    if (this.cxxFrame) {\n      let cxxProfile = this.cxxFrame.getStreamProfile();\n      if (cxxProfile) {\n        this.streamProfile = StreamProfile._internalCreateStreamProfile(cxxProfile);\n      }\n    }\n  }\n\n  release() {\n    if (this.cxxFrame) this.cxxFrame.destroy();\n    if (this.streamProfile) this.streamProfile.destroy();\n    this.arrayBuffer = undefined;\n    this.typedArray = undefined;\n  }\n\n  /**\n   * Destroy the frame and its resource\n   */\n  destroy() {\n    this.release();\n    this.cxxFrame = undefined;\n    this.StreamProfile = undefined;\n  }\n\n  /**\n   * Retrieve pixel format of the frame\n   * @return {Integer} see enum {@link format} for available values\n   */\n  get format() {\n    return this.streamProfile.format;\n  }\n\n  /**\n   * Retrieve the origin stream type that produced the frame\n   * @return {Integer} see {@link stream} for avaiable values\n   */\n  get streamType() {\n    return this.streamProfile.streamType;\n  }\n\n  get profile() {\n    return this.streamProfile;\n  }\n\n  get width() {\n    return this.streamProfile.width ? this.streamProfile.width : this.cxxFrame.getWidth();\n  }\n\n  get height() {\n    return this.streamProfile.height ? this.streamProfile.height : this.cxxFrame.getHeight();\n  }\n\n  /**\n   * Check if the frame is valid\n   * @return {Boolean}\n   */\n  get isValid() {\n    return (this.cxxFrame && this.cxxFrame.isValid());\n  }\n\n  /**\n   * Retrieve timestamp from the frame in milliseconds\n   * @return {Integer}\n   */\n  get timestamp() {\n    return this.cxxFrame.getTimestamp();\n  }\n\n  /**\n   * Retrieve timestamp domain. timestamps can only be comparable if they are in common domain\n   * (for example, depth timestamp might come from system time while color timestamp might come\n   * from the device)\n   * this method is used to check if two timestamp values are comparable (generated from the same\n   * clock)\n   * @return {Integer} see {@link timestamp_domain} for avaiable values\n   */\n  get timestampDomain() {\n    return this.cxxFrame.getTimestampDomain();\n  }\n\n  /**\n   * Retrieve the current value of a single frame metadata\n   * @param {String|Number} metadata the type of metadata, see {@link frame_metadata} for avaiable\n   * values\n   * @return {Uint8Array} The metadata value, 8 bytes, byte order is bigendian.\n   */\n  frameMetadata(metadata) {\n    const funcName = 'Frame.frameMetadata()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const m = checkArgumentType(arguments, constants.frame_metadata, 0, funcName);\n    const array = new Uint8Array(8);\n    return this.cxxFrame.getFrameMetadata(m, array) ? array : undefined;\n  }\n\n  /**\n   * Determine if the device allows a specific metadata to be queried\n   * @param {String|Number} metadata The type of metadata\n   * @return {Boolean} true if supported, and false if not\n   */\n  supportsFrameMetadata(metadata) {\n    const funcName = 'Frame.supportsFrameMetadata()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const m = checkArgumentType(arguments, constants.frame_metadata, 0, funcName);\n    return this.cxxFrame.supportsFrameMetadata(m);\n  }\n\n  /**\n   * Retrieve frame number\n   * @return {Integer}\n   */\n  get frameNumber() {\n    return this.cxxFrame.getFrameNumber();\n  }\n\n  /**\n   * Retrieve the frame data\n   * @return {Float32Array|Uint16Array|Uint8Array|undefined}\n   * if the frame is from the depth stream, the return value is Uint16Array;\n   * if the frame is from the XYZ32F or MOTION_XYZ32F stream, the return value is Float32Array;\n   * for other cases, return value is Uint8Array.\n   */\n  get data() {\n    if (this.typedArray) return this.typedArray;\n\n    if (!this.arrayBuffer) {\n      this.arrayBuffer = this.cxxFrame.getData();\n      this.typedArray = undefined;\n    }\n\n    if (!this.arrayBuffer) return undefined;\n\n    this.updateProfile();\n    switch (this.format) {\n      case constants.format.FORMAT_Z16:\n      case constants.format.FORMAT_DISPARITY16:\n      case constants.format.FORMAT_Y16:\n      case constants.format.FORMAT_RAW16:\n        this.typedArray = new Uint16Array(this.arrayBuffer);\n        return this.typedArray;\n      case constants.format.FORMAT_YUYV:\n      case constants.format.FORMAT_UYVY:\n      case constants.format.FORMAT_RGB8:\n      case constants.format.FORMAT_BGR8:\n      case constants.format.FORMAT_RGBA8:\n      case constants.format.FORMAT_BGRA8:\n      case constants.format.FORMAT_Y8:\n      case constants.format.FORMAT_RAW8:\n      case constants.format.FORMAT_MOTION_RAW:\n      case constants.format.FORMAT_GPIO_RAW:\n      case constants.format.FORMAT_RAW10:\n      case constants.format.FORMAT_ANY:\n        this.typedArray = new Uint8Array(this.arrayBuffer);\n        return this.typedArray;\n      case constants.format.FORMAT_XYZ32F:\n      case constants.format.FORMAT_MOTION_XYZ32F:\n      case constants.format.FORMAT_6DOF:\n      case constants.format.FORMAT_DISPARITY32:\n        this.typedArray = new Float32Array(this.arrayBuffer);\n        return this.typedArray;\n    }\n  }\n\n  /**\n   * Get the frame buffer data\n   *  There are 2 acceptable forms of syntax:\n   * <pre><code>\n   *  Syntax 1. getData()\n   *  Syntax 2. getData(ArrayBuffer)\n   * </code></pre>\n   *\n   * @param {ArrayBuffer} [buffer] The buffer that will be written to.\n   * @return {Float32Array|Uint16Array|Uint8Array|undefined}\n   *  Returns a <code>TypedArray</code> or <code>undefined</code> for syntax 1,\n   *   see {@link Frame#data};\n   *  if syntax 2 is used, return value is not used (<code>undefined</code>).\n   *\n   * @see [VideoFrame.dataByteLength]{@link VideoFrame#dataByteLength} to determine the buffer size\n   * in bytes.\n   */\n  getData(buffer) {\n    const funcName = 'Frame.supportsFrameMetadata()';\n    checkArgumentLength(0, 1, arguments.length, funcName);\n    if (arguments.length === 0) {\n      return this.data;\n    } else if (arguments.length === 1) {\n      checkArgumentType(arguments, 'ArrayBuffer', 0, funcName);\n      return this.cxxFrame.writeData(buffer);\n    }\n  }\n\n  /**\n   * communicate to the library you intend to keep the frame alive for a while\n   * this will remove the frame from the regular count of the frame pool\n   * once this function is called, the SDK can no longer guarantee 0-allocations during frame\n   * cycling\n   * @return {undefined}\n   */\n  keep() {\n    this.cxxFrame.keep();\n  }\n\n  static _internalCreateFrame(cxxFrame) {\n    if (!cxxFrame) return undefined;\n    if (cxxFrame.isPoseFrame()) return new PoseFrame(cxxFrame);\n    if (cxxFrame.isMotionFrame()) return new MotionFrame(cxxFrame);\n    if (cxxFrame.isDisparityFrame()) return new DisparityFrame(cxxFrame);\n    if (cxxFrame.isDepthFrame()) return new DepthFrame(cxxFrame);\n    if (cxxFrame.isVideoFrame()) return new VideoFrame(cxxFrame);\n    return new Frame(cxxFrame);\n  }\n}\n\n/**\n * This class resprents a video frame and is a subclass of Frame\n *\n * @property {Integer} width - The image width in pixels.\n * @property {Integer} height - The image height in pixels.\n * @property {Integer} dataByteLength - The length in bytes\n * @property {Integer} strideInBytes - The stride of the frame. The unit is number of bytes.\n * @property {Integer} bitsPerPixel - The number of bits per pixel\n * @property {Integer} bytesPerPixel - The number of bytes per pixel\n */\nclass VideoFrame extends Frame {\n  constructor(frame) {\n    super(frame);\n  }\n\n  /**\n   * Get image width in pixels\n   * @return {Integer}\n   */\n  get width() {\n    return this.cxxFrame.getWidth();\n  }\n\n  /**\n   * Get image height in pixels\n   * @return {Integer}\n   */\n  get height() {\n    return this.cxxFrame.getHeight();\n  }\n\n  /**\n   * Get the data length in bytes\n   * @return {Integer}\n   */\n  get dataByteLength() {\n    return this.strideInBytes * this.height;\n  }\n\n  /**\n   * Retrieve frame stride, the actual line width in bytes (not the logical image width)\n   * @return {Integer}\n   */\n  get strideInBytes() {\n    return this.cxxFrame.getStrideInBytes();\n  }\n\n  /**\n   * Retrieve count of bits per pixel\n   * @return {Integer}\n   */\n  get bitsPerPixel() {\n    return this.cxxFrame.getBitsPerPixel();\n  }\n\n  /**\n   * Retrieve bytes per pixel\n   * @return {Integer}\n   */\n  get bytesPerPixel() {\n    return this.cxxFrame.getBitsPerPixel()/8;\n  }\n}\n\n/**\n * Class used to get 3D vertices and texture coordinates\n */\nclass Points extends Frame {\n  constructor(cxxFrame) {\n    super(cxxFrame);\n  }\n\n  /**\n   * Get an array of 3D vertices.\n   * The coordinate system is: X right, Y up, Z away from the camera. Units: Meters\n   *\n   * @return {Float32Array|undefined}\n   */\n  get vertices() {\n    if (this.verticesArray) return this.verticesArray;\n\n    if (this.cxxFrame.canGetPoints()) {\n      const newLength = this.cxxFrame.getVerticesBufferLen();\n      if (!this.verticesData || newLength !== this.verticesData.byteLength) {\n        this.verticesData = new ArrayBuffer(newLength);\n      }\n      if (this.cxxFrame.writeVertices(this.verticesData)) {\n        this.verticesArray = new Float32Array(this.verticesData);\n        return this.verticesArray;\n      }\n    }\n    return undefined;\n  }\n\n  release() {\n    if (this.cxxFrame) this.cxxFrame.destroy();\n    this.verticesArray = undefined;\n    this.verticesCoordArray = undefined;\n  }\n\n  destroy() {\n    this.release();\n    this.verticesData = undefined;\n    this.textureCoordData = undefined;\n    this.cxxFrame = undefined;\n  }\n\n  /**\n   * Creates a ply file of the model with the given file name.\n   * @param {String} fileName name of the ply file\n   * @param {VideoFrame} texture texture frame\n   * @return {undefined}\n   */\n  exportToPly(fileName, texture) {\n    const funcName = 'Points.exportToPly()';\n    checkArgumentLength(2, 2, arguments.length, funcName);\n    checkArgumentType(arguments, 'string', 0, funcName);\n    checkArgumentType(arguments, VideoFrame, 1, funcName);\n    if (this.cxxFrame) {\n      this.cxxFrame.exportToPly(fileName, texture.cxxFrame);\n    }\n  }\n\n  /**\n   * Get an array of texture coordinates per vertex\n   * Each coordinate represent a (u,v) pair within [0,1] range, to be mapped to texture image\n   *\n   * @return {Int32Array|undefined}\n   */\n  get textureCoordinates() {\n    if (this.verticesCoordArray) return this.verticesCoordArray;\n\n    if (this.cxxFrame.canGetPoints()) {\n      const newLength = this.cxxFrame.getTexCoordBufferLen();\n      if (!this.textureCoordData || newLength !== this.textureCoordData.byteLength) {\n        this.textureCoordData = new ArrayBuffer(newLength);\n      }\n      if (this.cxxFrame.writeTextureCoordinates(this.textureCoordData)) {\n        this.verticesCoordArray = new Int32Array(this.textureCoordData);\n        return this.verticesCoordArray;\n      }\n    }\n    return undefined;\n  }\n\n  /**\n   * Get number of vertices\n   *\n   * @return {Integer}\n   */\n  get size() {\n    if (this.cxxFrame.canGetPoints()) {\n      return this.cxxFrame.getPointsCount();\n    }\n\n    throw new TypeError('Can\\'t get size due to invalid frame type');\n  }\n}\n\n/**\n * This class represents depth stream\n */\nclass DepthFrame extends VideoFrame {\n  constructor(cxxFrame) {\n    super(cxxFrame);\n  }\n\n  /**\n   * Get the distance of a point from the camera\n   * @param {Integer} x x coordinate of the point\n   * @param {Integer} y y coordinate of the point\n   * @return {Float}\n   */\n  getDistance(x, y) {\n    const funcName = 'DepthFrame.getDistance()';\n    checkArgumentLength(2, 2, arguments.length, funcName);\n    checkArgumentType(arguments, 'number', 0, funcName);\n    checkArgumentType(arguments, 'number', 1, funcName);\n    return this.cxxFrame.getDistance(x, y);\n  }\n}\n\n/**\n * Disparity Frame\n */\nclass DisparityFrame extends DepthFrame {\n  constructor(cxxFrame) {\n    super(cxxFrame);\n  }\n\n  /**\n   * Retrieve the stereoscopic baseline value. Applicable to stereo-based depth modules\n   * @return {Float} Stereoscopic baseline in millimeters\n   */\n  get baseLine() {\n    return this.cxxFrame.getBaseLine();\n  }\n}\n\n/**\n * 3D vector in Euclidean coordinate space\n * @typedef {Object} Vector\n * @property {Float32} x - value of x coordinate\n * @property {Float32} y - value of y coordinate\n * @property {Float32} z - value of z coordinate\n * @see [MotionFrame.getMotionData()]{@link MotionFrame#getMotionData}\n */\n\n/**\n * Quaternion used to represent rotation\n * @typedef {Object} Quaternion\n * @property {Float32} x\n * @property {Float32} y\n * @property {Float32} z\n * @property {Float32} w\n * @see [PoseFrame.getPoseData()]{@link PoseFrame#getPoseData}\n */\n\n/**\n * This class resprents a motion frame and is a subclass of Frame\n */\nclass MotionFrame extends Frame {\n  constructor(frame) {\n    super(frame);\n    this._motion = {x: 0, y: 0, z: 0};\n  }\n\n  /**\n   * Get the motion data\n   * @return {Vector} the motion data on x, y and z coordinates\n   */\n  get motionData() {\n    this.cxxFrame.getMotionData(this._motion);\n    return this._motion;\n  }\n}\n\n/**\n * PoseData\n * @typedef {Object} PoseData\n * @property {Vector} translation - X, Y, Z values of translation, in meters (relative to\n * initial position)\n * @property {Vector} velocity - X, Y, Z values of velocity, in meter/sec\n * @property {Vector} acceleration - X, Y, Z values of acceleration, in meter/sec^2\n * @property {Quaternion} rotation - Qi, Qj, Qk, Qr components of rotation as represented\n * in quaternion rotation (relative to initial position)\n * @property {Vector} angularVelocity - X, Y, Z values of angular velocity, in radians/sec\n * @property {Vector} angularAcceleration - X, Y, Z values of angular acceleration, in radians/sec^2\n * @property {Integer} trackerConfidence - pose data confidence 0 - Failed, 1 - Low, 2 - Medium,\n * 3 - High\n * @property {Integer} mapperConfidence - pose data confidence 0 - Failed, 1 - Low, 2 - Medium,\n * 3 - High\n * @see [PoseFrame.getPoseData()]{@link PoseFrame#getPoseData}\n */\n\n/**\n * This class resprents a pose frame and is a subclass of Frame\n */\nclass PoseFrame extends Frame {\n  constructor(frame) {\n    super(frame);\n    this._pose = {\n      translation: {x: 0, y: 0, z: 0},\n      velocity: {x: 0, y: 0, z: 0},\n      acceleration: {x: 0, y: 0, z: 0},\n      rotation: {x: 0, y: 0, z: 0, w: 0},\n      angularVelocity: {x: 0, y: 0, z: 0},\n      angularAcceleration: {x: 0, y: 0, z: 0},\n      trackerConfidence: 0,\n      mapperConfidence: 0,\n    };\n  }\n\n  /**\n   * Get the pose data\n   * @return {PoseData|undefined}\n   */\n  get poseData() {\n    return (this.cxxFrame.getPoseData(this._pose)) ? this._pose : undefined;\n  }\n}\n\n/**\n * Class containing a set of frames\n *\n * @property {Integer} size - count of frames.\n * @property {DepthFrame|undefined} depthFrame - The depth frame in the frameset.\n * @property {VideoFrame|undefined} colorFrame - The color frame in the frameset.\n */\nclass FrameSet {\n  constructor(cxxFrameSet) {\n    this.cxxFrameSet = cxxFrameSet || new RS2.RSFrameSet();\n    this.cache = [];\n    this.cacheMetadata = [];\n    this.__update();\n  }\n\n  /**\n   * Count of frames\n   *\n   * @return {Integer}\n   */\n  get size() {\n    return this.sizeValue;\n  }\n\n  /**\n   * Get the depth frame\n   *\n   * @return {DepthFrame|undefined}\n   */\n  get depthFrame() {\n    return this.getFrame(stream.STREAM_DEPTH, 0);\n  }\n\n  /**\n   * Get the color frame\n   *\n   * @return {VideoFrame|undefined}\n   */\n  get colorFrame() {\n    return this.getFrame(stream.STREAM_COLOR, 0);\n  }\n\n  /**\n   * Get the infrared frame\n   * @param {Integer} streamIndex index of the expected infrared stream\n   * @return {VideoFrame|undefined}\n   */\n  getInfraredFrame(streamIndex = 0) {\n    const funcName = 'FrameSet.getInfraredFrame()';\n    checkArgumentLength(0, 1, arguments.length, funcName);\n    if (arguments.length === 1) {\n      checkArgumentType(arguments, 'integer', 0, funcName);\n    }\n    return this.getFrame(stream.STREAM_INFRARED, streamIndex);\n  }\n\n  /**\n   * Get the frame at specified index\n   *\n   * @param {Integer} index the index of the expected frame (Note: this is not\n   * stream index)\n   * @return {DepthFrame|VideoFrame|Frame|undefined}\n   */\n  at(index) {\n    const funcName = 'FrameSet.at()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'number', 0, funcName, 0, this.size);\n    return this.getFrame(this.cxxFrameSet.indexToStream(index),\n        this.cxxFrameSet.indexToStreamIndex(index));\n  }\n\n  /**\n   * Run the provided callback function with each Frame inside the FrameSet\n   * @param {FrameCallback} callback the callback function to process each frame\n   * @return {undefined}\n   */\n  forEach(callback) {\n    const funcName = 'FrameSet.forEach()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'function', 0, funcName);\n    const size = this.size;\n    for (let i = 0; i < size; i++) {\n      callback(this.at(i));\n    }\n  }\n\n  __internalGetFrame(stream, streamIndex) {\n    let cxxFrame = this.cxxFrameSet.getFrame(stream, streamIndex);\n    return (cxxFrame ? Frame._internalCreateFrame(cxxFrame) : undefined);\n  }\n\n  __internalFindFrameInCache(stream, streamIndex) {\n    if (stream === stream.STREAM_ANY) {\n      return (this.cacheMetadata.size ? 0 : undefined);\n    }\n\n    for (const [i, data] of this.cacheMetadata.entries()) {\n      if (data.stream !== stream) {\n        continue;\n      }\n      if (!streamIndex || (streamIndex && streamIndex === data.streamIndex)) {\n        return i;\n      }\n    }\n    return undefined;\n  }\n\n  __internalGetFrameCache(stream, streamIndex, callback) {\n    let idx = this.__internalFindFrameInCache(stream, streamIndex);\n    if (idx === undefined) {\n      let frame = callback(stream, streamIndex);\n      if (!frame) return undefined;\n\n      this.cache.push(frame);\n      // the stream parameter may be stream.STREAM_ANY, but when we store the frame in\n      // cache, we shall store its actual stream type.\n      this.cacheMetadata.push({stream: frame.streamType, streamIndex: streamIndex});\n      idx = this.cache.length - 1;\n    } else {\n      let frame = this.cache[idx];\n      if (!frame.cxxFrame) {\n        frame.cxxFrame = new RS2.RSFrame();\n      }\n\n      // as cache metadata entries always use actual stream type, we use the actual\n      // stream types to easy native from processing stream.STREAM_ANY\n      if (! this.cxxFrameSet.replaceFrame(\n          this.cacheMetadata[idx].stream, streamIndex, frame.cxxFrame)) {\n        this.cache[idx] = undefined;\n        this.cacheMetadata[idx] = undefined;\n      }\n    }\n    return this.cache[idx];\n  }\n\n  /**\n   * Get the frame with specified stream\n   *\n   * @param {Integer|String} stream stream type of the frame\n   * @param {Integer} streamIndex index of the stream, 0 means the first\n   * matching stream\n   * @return {DepthFrame|VideoFrame|Frame|undefined}\n   */\n  getFrame(stream, streamIndex = 0) {\n    const funcName = 'FrameSet.getFrame()';\n    checkArgumentLength(1, 2, arguments.length, funcName);\n    const s = checkArgumentType(arguments, constants.stream, 0, funcName);\n    if (arguments.length === 2) {\n      checkArgumentType(arguments, 'integer', 1, funcName);\n    }\n    return this.__internalGetFrameCache(s, streamIndex, this.__internalGetFrame.bind(this));\n  }\n\n  __update() {\n    this.sizeValue = this.cxxFrameSet.getSize();\n  }\n\n  releaseCache() {\n    this.cache.forEach((f) => {\n      if (f && f.cxxFrame) {\n        f.release();\n      }\n    });\n    this.cache = [];\n    this.cacheMetadata = [];\n  }\n\n  release() {\n    this.releaseCache();\n    if (this.cxxFrameSet) this.cxxFrameSet.destroy();\n  }\n\n  /**\n   * Release resources associated with this object\n   *\n   * @return {undefined}\n   */\n  destroy() {\n    this.release();\n    this.cxxFrameSet = undefined;\n  }\n}\n\n/**\n * This class provides a simple way to retrieve frame data\n */\nclass Pipeline {\n  /**\n   * Construct a Pipeline object\n   * There are 2 acceptable syntax\n   *\n   * <pre><code>\n   *  Syntax 1. new Pipeline()\n   *  Syntax 2. new Pipeline(context)\n   * </code></pre>\n   * Syntax 1 uses the default context.\n   * Syntax 2 used the context created by application\n   * @param {Context} [context] - the {@link Context} that is being used by the pipeline\n   */\n  constructor(context) {\n    const funcName = 'Pipeline.constructor()';\n    checkArgumentLength(0, 1, arguments.length, funcName);\n    let ownCtx = true;\n    let ctx;\n\n    if (arguments.length === 1) {\n      checkArgumentType(arguments, Context, 0, funcName);\n      ownCtx = false;\n      this.ctx = arguments[0];\n    }\n\n    if (ownCtx === true) {\n      this.ctx = new Context();\n    }\n\n    this.cxxPipeline = new RS2.RSPipeline();\n    this.cxxPipeline.create(this.ctx.cxxCtx);\n    this.started = false;\n    this.frameSet = new FrameSet();\n    internal.addObject(this);\n  }\n\n  /**\n   * Destroy the resource associated with this pipeline\n   *\n   * @return {undefined}\n   */\n  destroy() {\n    if (this.started === true) this.stop();\n\n    if (this.cxxPipeline) {\n      this.cxxPipeline.destroy();\n      this.cxxPipeline = undefined;\n    }\n\n    if (this.ownCtx && this.ctx) {\n      this.ctx.destroy();\n    }\n    this.ctx = undefined;\n\n    if (this.frameSet) {\n      this.frameSet.destroy();\n    }\n    this.frameSet = undefined;\n  }\n\n  /**\n   * Start streaming\n   * There are 2 acceptable syntax\n   *\n   * <pre><code>\n   *  Syntax 1. start()\n   *  Syntax 2. start(config)\n   * </code></pre>\n   * Syntax 1 uses the default configuration.\n   * Syntax 2 used the configured streams and or device of the config parameter\n   *\n   * @param {Config} [config] - the {@link Config} object to use for configuration\n   * @return {@link PipelineProfile}\n   */\n  start() {\n    const funcName = 'Pipeline.start()';\n    checkArgumentLength(0, 1, arguments.length, funcName);\n    if (this.started === true) return undefined;\n\n    if (arguments.length === 0) {\n      this.started = true;\n      return new PipelineProfile(this.cxxPipeline.start());\n    } else {\n      checkArgumentType(arguments, Config, 0, funcName);\n      this.started = true;\n      return new PipelineProfile(this.cxxPipeline.startWithConfig(arguments[0].cxxConfig));\n    }\n  }\n\n  /**\n   * Stop streaming\n   *\n   * @return {undefined}\n   */\n  stop() {\n    if (this.started === false) return;\n\n    if (this.cxxPipeline ) {\n      this.cxxPipeline.stop();\n    }\n    this.started = false;\n\n    if (this.frameSet) this.frameSet.release();\n  }\n\n  /**\n   * Wait until a new set of frames becomes available.\n   * The returned frameset includes time-synchronized frames of each enabled stream in the pipeline.\n   * In case of different frame rates of the streams, the frames set include a matching frame of the\n   * slow stream, which may have been included in previous frames set.\n   * The method blocks the calling thread, and fetches the latest unread frames set.\n   * Device frames, which were produced while the function wasn't called, are dropped.\n   * To avoid frame drops, this method should be called as fast as the device frame rate.\n   *\n   * @param {Integer} timeout - max time to wait, in milliseconds, default to 5000 ms\n   * @return {FrameSet|undefined} a FrameSet object or Undefined\n   * @see See [Pipeline.latestFrame]{@link Pipeline#latestFrame}\n   */\n  waitForFrames(timeout = 5000) {\n    const funcName = 'Pipeline.waitForFrames()';\n    checkArgumentLength(0, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'number', 0, funcName);\n    this.frameSet.release();\n    if (this.cxxPipeline.waitForFrames(this.frameSet.cxxFrameSet, timeout)) {\n      this.frameSet.__update();\n      return this.frameSet;\n    }\n    return undefined;\n  }\n\n  get latestFrame() {\n    return this.frameSet;\n  }\n\n  /**\n   * Check if a new set of frames is available and retrieve the latest undelivered set.\n   * The frameset includes time-synchronized frames of each enabled stream in the pipeline.\n   * The method returns without blocking the calling thread, with status of new frames available\n   * or not. If available, it fetches the latest frames set.\n   * Device frames, which were produced while the function wasn't called, are dropped.\n   * To avoid frame drops, this method should be called as fast as the device frame rate.\n   *\n   * @return {FrameSet|undefined}\n   */\n  pollForFrames() {\n    this.frameSet.release();\n    if (this.cxxPipeline.pollForFrames(this.frameSet.cxxFrameSet)) {\n      this.frameSet.__update();\n      return this.frameSet;\n    }\n    return undefined;\n  }\n\n  /**\n   * Return the active device and streams profiles, used by the pipeline.\n   * The pipeline streams profiles are selected during {@link Pipeline.start}. The method returns a\n   * valid result only when the pipeline is active -\n   * between calls to {@link Pipeline.start} and {@link Pipeline.stop}.\n   * After {@link Pipeline.stop} is called, the pipeline doesn't own the device, thus, the pipeline\n   * selected device may change in\n   * subsequent activations.\n   *\n   * @return {PipelineProfile} the actual pipeline device and streams profile, which was\n   * successfully configured to the streaming device on start.\n   */\n  getActiveProfile() {\n    if (this.started === false) return undefined;\n\n    return new PipelineProfile(this.cxxPipeline.getActiveProfile());\n  }\n}\n\n/**\n * The pipeline profile includes a device and a selection of active streams, with specific profile.\n * The profile is a selection of the above under filters and conditions defined by the pipeline.\n * Streams may belong to more than one sensor of the device.\n */\nclass PipelineProfile {\n  constructor(profile) {\n    this.cxxPipelineProfile = profile;\n    internal.addObject(this);\n  }\n\n  /**\n   * Check if the object is valid\n   * @return {Boolean}\n   */\n  get isValid() {\n    return (this.cxxPipelineProfile != null);\n  }\n\n  /**\n   * Return the selected streams profiles, which are enabled in this profile.\n   *\n   * @return {StreamProfile[]} an array of StreamProfile\n   */\n  getStreams() {\n    let profiles = this.cxxPipelineProfile.getStreams();\n    if (!profiles) return undefined;\n\n    const array = [];\n    profiles.forEach((profile) => {\n      array.push(StreamProfile._internalCreateStreamProfile(profile));\n    });\n    return array;\n  }\n\n  /**\n   * Return the selected stream profile, which are enabled in this profile.\n   * @param {Integer|String} streamType the stream type of the desired profile,\n   * see {@link stream} for avaiable values\n   * @param {Integer} streamIndex stream index of the desired profile, -1 for any matching\n   * @return {StreamProfile} the first matching stream profile\n   */\n  getStream(streamType, streamIndex = -1) {\n    const funcName = 'PipelineProfile.getStream()';\n    checkArgumentLength(1, 2, arguments.length, funcName);\n    const s = checkArgumentType(arguments, constants.stream, 0, funcName);\n    checkArgumentType(arguments, 'number', 1, funcName);\n    let profiles = this.getStreams();\n    if (!profiles) {\n      return undefined;\n    }\n    for (let i = 0; i < profiles.length; i++) {\n      if (profiles[i].streamType === s &&\n          (streamIndex === -1 || (streamIndex === profiles[i].indexValue))) {\n        return profiles[i];\n      }\n    }\n    return undefined;\n  }\n\n  /**\n   * Retrieve the device used by the pipeline.\n   * The device class provides the application access to control camera additional settings -\n   * get device information, sensor options information, options value query and set, sensor\n   * specific extensions.\n   * Since the pipeline controls the device streams configuration, activation state and frames\n   * reading, calling the device API functions, which execute those operations, results in\n   * unexpected behavior. The pipeline streaming device is selected during {@link Pipeline.start}.\n   * Devices of profiles, which are not returned by\n   * {@link Pipeline.start} or {@link Pipeline.getActiveProfile}, are not guaranteed to be used by\n   * the pipeline.\n   *\n   * @return {Device} the pipeline selected device\n   */\n  getDevice() {\n    return Device._internalCreateDevice(this.cxxPipelineProfile.getDevice());\n  }\n\n  /**\n   * Destroy the resource associated with this object\n   *\n   * @return {undefined}\n   */\n  destroy() {\n    if (this.cxxPipelineProfile) {\n      this.cxxPipelineProfile.destroy();\n      this.cxxPipelineProfile = undefined;\n    }\n  }\n}\n\n/**\n * The config allows pipeline users to request filters for the pipeline streams and device selection\n * and configuration.\n * This is an optional step in pipeline creation, as the pipeline resolves its streaming device\n * internally.\n * Config provides its users a way to set the filters and test if there is no conflict with the\n * pipeline requirements from the device. It also allows the user to find a matching device for\n * the config filters and the pipeline, in order to select a device explicitly, and modify its\n * controls before streaming starts.\n */\nclass Config {\n  constructor() {\n    this.cxxConfig = new RS2.RSConfig();\n    internal.addObject(this);\n  }\n\n /**\n  * Enable a device stream explicitly, with selected stream parameters.\n  * The method allows the application to request a stream with specific configuration. If no stream\n  * is explicitly enabled, the pipeline configures the device and its streams according to the\n  * attached computer vision modules and processing blocks requirements, or default configuration\n  * for the first available device.\n  * The application can configure any of the input stream parameters according to its requirement,\n  * or set to 0 for don't care value. The config accumulates the application calls for enable\n  * configuration methods, until the configuration is applied. Multiple enable stream calls for the\n  * same stream override each other, and the last call is maintained.\n  * Upon calling {@link Config.resolve}, the config checks for conflicts between the application\n  * configuration requests and the attached computer vision modules and processing blocks\n  * requirements, and fails if conflicts are found.\n  * Before {@link Config.resolve} is called, no conflict check is done.\n  *\n  * @param {Integer|String} stream  stream type to be enabled\n  * @param {Integer} index stream index, used for multiple streams of the same type. -1 indicates\n  * any.\n  * @param {Integer} width stream image width - for images streams. 0 indicates any.\n  * @param {Integer} height stream image height - for images streams. 0 indicates any.\n  * @param {Integer|String} format stream data format - pixel format for images streams, of data\n  * type for other streams. format.FORMAT_ANY indicates any.\n  * @param {Integer} fps stream frames per second. 0 indicates any.\n  */\n  enableStream(stream, index, width, height, format, fps) {\n    const funcName = 'Config.enableStream()';\n    checkArgumentLength(6, 6, arguments.length, funcName);\n    const s = checkArgumentType(arguments, constants.stream, 0, funcName);\n    checkArgumentType(arguments, 'number', 1, funcName);\n    checkArgumentType(arguments, 'number', 2, funcName);\n    checkArgumentType(arguments, 'number', 3, funcName);\n    const f = checkArgumentType(arguments, constants.format, 4, funcName);\n    checkArgumentType(arguments, 'number', 5, funcName);\n    this.cxxConfig.enableStream(s, index, width, height, f, fps);\n  }\n\n  /**\n   * Disable a device stream explicitly, to remove any requests on this stream profile.\n   */\n  disableStream(stream) {\n    const funcName = 'Config.disableStream()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const s = checkArgumentType(arguments, constants.stream, 0, funcName);\n    this.cxxConfig.disableStream(s);\n  }\n\n  /**\n   * Enable all device streams explicitly.\n   */\n  enableAllStreams() {\n    this.cxxConfig.enableAllStreams();\n  }\n\n  /**\n   * Disable all device streams explicitly.\n   */\n  disableAllStreams() {\n    this.cxxConfig.disableAllStreams();\n  }\n\n  /**\n   * Select a specific device explicitly by its serial number, to be used by the pipeline.\n   * The conditions and behavior of this method are similar to those of {@link Config.enableStream}.\n   * This method is required if the application needs to set device or sensor settings prior to\n   * pipeline streaming, to enforce the pipeline to use the configured device.\n   *\n   * @param {String} serial device serial number, as returned by\n   * Device.getCameraInfo(camera_info.CAMERA_INFO_SERIAL_NUMBER).\n   */\n  enableDevice(serial) {\n    const funcName = 'Config.enableDevice()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'string', 0, funcName);\n    this.cxxConfig.enableDevice(serial);\n  }\n\n  /**\n   * Select a recorded device from a file, to be used by the pipeline through playback.\n   * The device available streams are as recorded to the file, and {@link Config.resolve} considers\n   * only this device and configuration as available.\n   * This request cannot be used if {@link Config.enableRecordToFile} is called for the current\n   * config, and vise versa\n   *\n   * @param {String} fileName the playback file of the device\n   * @param {Boolean} repeat whether to repeat the playback automatically\n   */\n  enableDeviceFromFile(fileName, repeat = true) {\n    const funcName = 'Config.enableDeviceFromFile()';\n    checkArgumentLength(1, 2, arguments.length, funcName);\n    checkArgumentType(arguments, 'string', 0, funcName);\n    checkArgumentType(arguments, 'boolean', 1, funcName);\n    checkFileExistence(fileName);\n    this.cxxConfig.enableDeviceFromFileRepeatOption(fileName, repeat);\n  }\n\n  /**\n   * Requires that the resolved device would be recorded to file\n   * This request cannot be used if {@link Config.enableDeviceFromFile} is called for the current\n   * config, and vise versa as available.\n   *\n   * @param {String} fileName the desired file for the output record\n   */\n  enableRecordToFile(fileName) {\n    const funcName = 'Config.enableRecordToFile()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'string', 0, funcName);\n    this.cxxConfig.enableRecordToFile(fileName);\n  }\n\n  /**\n   * Resolve the configuration filters, to find a matching device and streams profiles.\n   * The method resolves the user configuration filters for the device and streams, and combines\n   * them with the requirements of the computer vision modules and processing blocks attached to the\n   * pipeline. If there are no conflicts of requests,\n   * it looks for an available device, which can satisfy all requests, and selects the first\n   * matching streams configuration. In the absence of any request, the config selects the first\n   * available device and the first color and depth streams configuration.\n   * The pipeline profile selection during {@link Pipeline.start} follows the same method. Thus,\n   * the selected profile is the same, if no change occurs to the available devices occurs.\n   * Resolving the pipeline configuration provides the application access to the pipeline selected\n   * device for advanced control.\n   * The returned configuration is not applied to the device, so the application doesn't own the\n   * device sensors. However, the application can call {@link Cofnig.enableDevice}, to enforce the\n   * device returned by this method is selected by pipeline start, and configure the device and\n   * sensors options or extensions before streaming starts.\n   *\n   * @param {Pipeline} pipeline the pipeline for which the selected filters are applied\n   * @return {PipelineProfile|undefined} a matching device and streams profile, which satisfies the\n   * filters and pipeline requests.\n   */\n  resolve(pipeline) {\n    const funcName = 'Config.resolve()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, Pipeline, 0, funcName);\n    return new PipelineProfile(this.cxxConfig.resolve(arguments[0].cxxPipeline));\n  }\n\n  /**\n   * Check if the config can resolve the configuration filters, to find a matching device and\n   * streams profiles. The resolution conditions are as described in {@link Config.resolve}.\n   *\n   * @param {Pipeline} pipeline the pipeline for which the selected filters are applied\n   * @return {boolean} true if a valid profile selection exists, false if no selection can be found\n   * under the config filters and the available devices.\n   */\n  canResolve(pipeline) {\n    const funcName = 'Config.canResolve()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, Pipeline, 0, funcName);\n    return this.cxxConfig.canResolve(arguments[0].cxxPipeline);\n  }\n\n  /**\n   * Release resources associated with the object\n   */\n  destroy() {\n    if (this.cxxConfig) {\n      this.cxxConfig.destroy();\n      this.cxxConfig = null;\n    }\n  }\n}\n\n/**\n * Syncer class, which is used to group synchronized frames into coherent frame-sets.\n */\nclass Syncer {\n  constructor() {\n    this.cxxSyncer = new RS2.RSSyncer();\n    this.frameSet = new FrameSet();\n  }\n\n  /*\n   * Wait until coherent set of frames becomes available\n   * @param {Number} timeout Max time in milliseconds to wait until an exception will be thrown\n   * @return {Frame[]|undefined} Set of coherent frames or undefined if no frames.\n   */\n  waitForFrames(timeout = 5000) {\n    const funcName = 'Syncer.waitForFrames()';\n    checkArgumentLength(0, 1, arguments.length, funcName);\n    checkArgumentType(arguments, 'number', 0, funcName);\n    this.frameSet.release();\n    if (this.cxxSyncer.waitForFrames(this.frameSet.cxxFrameSet, timeout)) {\n      this.frameSet.__update();\n      return this.frameSet;\n    }\n    return undefined;\n  }\n\n  /**\n   * Check if a coherent set of frames is available, if yes return them\n   * @return {Frame[]|undefined} an array of frames if available and undefined if not.\n   */\n  pollForFrames() {\n    this.frameSet.release();\n    if (this.cxxSyncer.pollForFrames(this.frameSet.cxxFrameSet)) {\n      this.frameSet.__update();\n      return this.frameSet;\n    }\n    return undefined;\n  }\n\n  /**\n   * Release resources associated with the object\n   */\n  destroy() {\n    if (this.cxxSyncer) {\n      this.cxxSyncer.destroy();\n      this.cxxSyncer = undefined;\n    }\n\n    if (this.frameset) {\n      this.frameSet.destroy();\n      this.frameSet = undefined;\n    }\n  }\n}\n\n/**\n * Encapsulate the handling of 'device-changed' notification, when devices are conncted or\n * disconnected. It can connect to the existing device(s) in system, and/or wait for the\n * arrival/removal of devices.\n */\nclass DeviceHub {\n  /**\n   * @param {Context} context - a librealsense2 Context\n   */\n  constructor(context) {\n    const funcName = 'DeviceHub.constructor()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, Context, 0, funcName);\n    this.context = context;\n    this.cxxHub = new RS2.RSDeviceHub(context.cxxCtx);\n    internal.addObject(this);\n  }\n\n  /**\n   * If any device is connected return it, otherwise wait until next RealSense device connects.\n   * Calling this method multiple times will cycle through connected devices\n   * @return {Device|undefined}\n   */\n  waitForDevice() {\n    let dev = this.cxxHub.waitForDevice();\n    return (dev ? Device._internalCreateDevice(dev) : undefined);\n  }\n\n  /**\n   * Check if a device is connected\n   * @return {Boolean}\n   */\n  isConnected(device) {\n    const funcName = 'DeviceHub.isConnected()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, Device, 0, funcName);\n    return this.cxxHub.isConnected(device.cxxDev);\n  }\n\n  /**\n   * Release resources associated with the object\n   */\n  destroy() {\n    if (this.cxxHub) {\n      this.cxxHub.destroy();\n      this.cxxHub = undefined;\n    }\n  }\n}\n\n/**\n * Base class of specific filter classes, see {@link DecimationFilter}.\n * Don't create Filter objects directly from this class, use child classes,\n */\nclass Filter extends Options {\n  constructor(type) {\n    super(new RS2.RSFilter(type));\n    internal.addObject(this);\n  }\n\n  _internalGetInputType() {\n    return DepthFrame;\n  }\n\n  _internalPrepareOutputFrame() {\n    if (!this.frame) {\n      this.frame = new DepthFrame();\n    }\n  }\n  /**\n   * Apply the filter processing on the frame and return the processed frame\n   * @param {Frame} frame the depth frame to be processed\n   * @return {Frame}\n   */\n  process(frame) {\n    const funcName = 'Filter.process()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    checkArgumentType(arguments, this._internalGetInputType(), 0, funcName);\n    this._internalPrepareOutputFrame();\n    if (this.cxxObj && this.cxxObj.process(frame.cxxFrame, this.frame.cxxFrame)) {\n      this.frame.updateProfile();\n      return this.frame;\n    }\n    return undefined;\n  }\n\n  /**\n   * Release resources associated with the object\n   */\n  destroy() {\n    if (this.cxxObj) {\n      this.cxxObj.destroy();\n      this.cxxObj = null;\n    }\n    if (this.frame) {\n      this.frame.destroy();\n      this.frame = undefined;\n    }\n  }\n}\n\n/**\n * Depth post-processing filter block. This block can apply decimation filter on depth frame.\n */\nclass DecimationFilter extends Filter {\n  constructor() {\n    super('decimation');\n  }\n}\n\n/**\n * Depth post-processing filter block. This block can apply temporal filter on depth frame.\n */\nclass TemporalFilter extends Filter {\n  constructor() {\n    super('temporal');\n  }\n}\n\n/**\n * Depth post-processing filter block. This block can apply spatial filter on depth frame.\n */\nclass SpatialFilter extends Filter {\n  constructor() {\n    super('spatial');\n  }\n}\n\n/**\n * Depth post-processing filter block. This block replaces empty pixels with data from adjacent\n * pixels based on the method selected.\n */\nclass HoleFillingFilter extends Filter {\n  constructor() {\n    super('hole-filling');\n  }\n}\n\n/**\n * Post processing block that could transform disparity frame to depth frame\n */\nclass DisparityToDepthTransform extends Filter {\n  constructor() {\n    super('disparity-to-depth');\n  }\n\n  // override base implementation\n  _internalGetInputType() {\n    return DisparityFrame;\n  }\n}\n\n/**\n * Post processing block that could transform depth frame to disparity frame\n */\nclass DepthToDisparityTransform extends Filter {\n  constructor() {\n    super('depth-to-disparity');\n  }\n\n  // override base implementation\n  _internalPrepareOutputFrame() {\n    if (!this.frame) {\n      this.frame = new DisparityFrame();\n    }\n  }\n}\n\n/**\n * <code>util.preset_preference</code>: The enum for preset preference values.\n * @readonly\n * @enum {String}\n */\nconst preset_preference = {\n  /**\n   * String literal of <code>'best-quality'</code>. <br>Prefers the best overall quality that is\n   * available in the camera. <br>Equivalent to its uppercase counterpart.\n   */\n  best_quality: 'best-quality',\n  /**\n   * String literal of <code>'largest-image'</code>. <br>Prefers the largest image dimension that is\n   * available in the camera. <br>Equivalent to its uppercase counterpart.\n   */\n  largest_image: 'largest-image',\n  /**\n   * String literal of <code>'highest-framerate'</code>. <br>Prefers the highest frame rate that is\n   * available in the camera. <br>Equivalent to its uppercase counterpart.\n   */\n  highest_framerate: 'highest-framerate',\n\n  /**\n   * Prefers the best overall quality that is available in the camera <br>Equivalent to its\n   * lowercase counterpart.\n   * @type {Integer}\n   */\n  BEST_QUALITY: 0,\n  /**\n   * Prefers the largest image dimension that is available in the camera <br>Equivalent to its\n   * lowercase counterpart.\n   * @type {Integer}\n   */\n  LARGEST_IMAGE: 1,\n  /**\n   * Prefers the highest frame rate that is available in the camera <br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  HIGHEST_FRAMERATE: 2,\n\n  PRESET_BEGIN: 0,\n  PRESET_END: 3,\n};\n\nconst util = {};\n\nutil.preset_preference = preset_preference;\n\nObject.defineProperty(util, '__stack', {\n  get: function() {\n    let orig = Error.prepareStackTrace;\n    Error.prepareStackTrace = function(_, stack) {\n   return stack;\n  };\n    let err = new Error();\n    // TODO(kenny-y): fix the jshint error\n    /* jshint ignore:start */\n    Error.captureStackTrace(err, arguments.callee); // eslint-disable-line\n    /* jshint ignore:end */\n    let stack = err.stack;\n    Error.prepareStackTrace = orig;\n    return stack;\n  },\n});\n\nObject.defineProperty(util, '__line', {\n  get: function() {\n    // TODO(kenny-y): fix the jshint error\n    /* jshint ignore:start */\n    return __stack[1].getLineNumber();\n    /* jshint ignore:end */\n  },\n});\n\nObject.defineProperty(util, '__file', {\n  get: function() {\n    // TODO(kenny-y): fix the jshint error\n    /* jshint ignore:start */\n    return __stack[1].getFileName().split('/').slice(-1)[0];\n    /* jshint ignore:end */\n  },\n});\n\nfunction isString(s) {\n  return (typeof s === 'string');\n}\n\nfunction isNumber(s) {\n  return (typeof s === 'number');\n}\n\nfunction checkStringNumber(v, rangeStart, rangeEnd, convertFunc, typeErrMsg, rangeErrMsg) {\n  let r;\n  if (isString(v)) {\n    r = convertFunc(v);\n  } else if (isNumber(v)) {\n    r = parseInt(v);\n  } else {\n    throw new TypeError(typeErrMsg);\n  }\n  if (r < rangeStart || r >= rangeEnd || typeof r === 'undefined') {\n    throw new RangeError(rangeErrMsg);\n  }\n  return r;\n}\n\nfunction checkArgumentLength(minLengh, maxLength, actualLength, funcName) {\n  if (actualLength >= minLengh && actualLength <= maxLength) {\n    return;\n  }\n\n  if (minLengh === maxLength) {\n    throw new TypeError(funcName + ' expects ' + minLengh + ' arguments');\n  } else {\n    throw new TypeError(funcName + ' expects ' + minLengh + '~' + maxLength + ' arguments');\n  }\n}\n\nfunction checkArgumentType(args, expectedType, argIndex, funcName, start, end) {\n  if (argIndex >= args.length) {\n    return undefined;\n  }\n  let arg = args[argIndex];\n  let errMsgPrefix = 'argument ' + argIndex + ' of ' + funcName;\n  let wrongTypeErrMsgPrefix = errMsgPrefix + ' should be a/an ';\n  let unsupportedErrMsg = errMsgPrefix + ' is an unsupported type';\n  let rangeErrMsg = errMsgPrefix + ' has an invalid value';\n\n  switch (expectedType) {\n    case 'number':\n    case 'string':\n    case 'object':\n    case 'boolean':\n    case 'function':\n      if (typeof arg !== expectedType) {\n        throw new TypeError(wrongTypeErrMsgPrefix + expectedType);\n      }\n      if (expectedType === 'number' && (start !== undefined) && (end !== undefined)) {\n        if (arg < start || arg > end) {\n          throw new TypeError(rangeErrMsg);\n        }\n      }\n      break;\n    case 'ArrayBuffer':\n      if (!(isArrayBuffer(arg))) {\n        throw new TypeError(wrongTypeErrMsgPrefix + expectedType);\n      }\n      break;\n    case 'integer':\n      if (!Number.isInteger(arg)) {\n        throw new TypeError(wrongTypeErrMsgPrefix + expectedType);\n      }\n      break;\n    default:\n      if (typeof expectedType === 'function') {\n        if (!(arg instanceof expectedType)) {\n          throw new TypeError(wrongTypeErrMsgPrefix + expectedType.name);\n        }\n      } else if (typeof expectedType === 'object') {\n        for (let mem in constants) {\n          if (constants[mem] === expectedType) {\n            return checkEnumObjectArgument(args, expectedType, argIndex, funcName, start, end);\n          }\n        }\n        throw new TypeError(unsupportedErrMsg);\n      } else {\n        throw new TypeError(unsupportedErrMsg);\n      }\n      break;\n  }\n}\n\nfunction checkEnumObjectArgument(args, expectedType, argIndex, funcName, start, end) {\n  let rangeStart;\n  let rangeEnd;\n  let convertFunc;\n  let errMsgPrefix = 'argument ' + argIndex + ' of ' + funcName;\n  let wrongTypeErrMsgPrefix = errMsgPrefix + ' should be a/an ';\n  let unsupportedErrMsg = errMsgPrefix + ' is an unsupported type';\n  let rangeErrMsg = errMsgPrefix + ' has an invalid value';\n  let typeErrMsg;\n\n  switch (expectedType) {\n    case constants.stream:\n      rangeStart = constants.stream.STREAM_ANY;\n      rangeEnd = constants.stream.STREAM_COUNT;\n      convertFunc = stream2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'stream';\n      break;\n    case constants.format:\n      rangeStart = constants.format.FORMAT_ANY;\n      rangeEnd = constants.format.FORMAT_COUNT;\n      convertFunc = format2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'format';\n      break;\n    case constants.option:\n      rangeStart = constants.option.OPTION_BACKLIGHT_COMPENSATION;\n      rangeEnd = constants.option.OPTION_COUNT;\n      convertFunc = option2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'option';\n      break;\n    case constants.camera_info:\n      rangeStart = constants.camera_info.CAMERA_INFO_NAME;\n      rangeEnd = constants.camera_info.CAMERA_INFO_COUNT;\n      convertFunc = cameraInfo2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'camera_info';\n      break;\n    case constants.recording_mode:\n      rangeStart = constants.recording_mode.RECORDING_MODE_BLANK_FRAMES;\n      rangeEnd = constants.recording_mode.RECORDING_MODE_COUNT;\n      convertFunc = recordingMode2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'recording_mode';\n      break;\n    case constants.frame_metadata:\n      rangeStart = constants.frame_metadata.FRAME_METADATA_FRAME_COUNTER;\n      rangeEnd = constants.frame_metadata.FRAME_METADATA_COUNT;\n      convertFunc = frameMetadata2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'frame_metadata';\n      break;\n    case constants.distortion:\n      rangeStart = constants.distortion.DISTORTION_NONE;\n      rangeEnd = constants.distortion.DISTORTION_COUNT;\n      convertFunc = distortion2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'distortion';\n      break;\n    case constants.notification_category:\n      rangeStart = constants.notification_category.NOTIFICATION_CATEGORY_FRAMES_TIMEOUT;\n      rangeEnd = constants.notification_category.NOTIFICATION_CATEGORY_COUNT;\n      convertFunc = notificationCategory2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'notification_category';\n      break;\n    case constants.timestamp_domain:\n      rangeStart = constants.timestamp_domain.TIMESTAMP_DOMAIN_HARDWARE_CLOCK;\n      rangeEnd = constants.timestamp_domain.TIMESTAMP_DOMAIN_COUNT;\n      convertFunc = timestampDomain2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'timestamp_domain';\n      break;\n    case constants.playback_status:\n      rangeStart = constants.playback_status.PLAYBACK_STATUS_UNKNOWN;\n      rangeEnd = constants.playback_status.PLAYBACK_STATUS_COUNT;\n      convertFunc = playbackStatus2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'playback_status';\n      break;\n    case constants.sr300_visual_preset:\n      rangeStart = constants.sr300_visual_preset.SR300_VISUAL_PRESET_SHORT_RANGE;\n      rangeEnd = constants.sr300_visual_preset.SR300_VISUAL_PRESET_COUNT;\n      convertFunc = sr300VisualPreset2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'sr300_visual_preset';\n      break;\n    case constants.rs400_visual_preset:\n      rangeStart = constants.rs400_visual_preset.RS2_RS400_VISUAL_PRESET_CUSTOM;\n      rangeEnd = constants.rs400_visual_preset.RS400_VISUAL_PRESET_COUNT;\n      convertFunc = rs400VisualPreset2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'rs400_visual_preset';\n      break;\n    case constants.log_severity:\n      rangeStart = constants.log_severity.LOG_SEVERITY_DEBUG;\n      rangeEnd = constants.log_severity.LOG_SEVERITY_COUNT;\n      convertFunc = logSeverity2Int;\n      typeErrMsg = wrongTypeErrMsgPrefix + 'log_severity';\n      break;\n    default:\n      throw new TypeError(unsupportedErrMsg);\n  }\n  return checkStringNumber(\n      args[argIndex], rangeStart, rangeEnd, convertFunc, typeErrMsg, rangeErrMsg);\n}\n\nfunction checkNumberRange(arg, start, end, argIndex, funcName) {\n  if (arg < start || arg > end) {\n    throw new TypeError('argument ' + argIndex + ' of ' + funcName + ' is invalid');\n  }\n}\n\nfunction checkDiscreteArgumentValue(args, argIndex, valueArray, funcName) {\n  if (valueArray.indexOf(args[argIndex]) === -1) {\n    throw new TypeError('argument ' + argIndex + ' of ' + funcName + ' is invalid');\n  }\n}\n\nfunction checkDiscreteArgumentLength(lenthArray, actualLength, funcName) {\n  if (lenthArray.indexOf(actualLength) === -1) {\n    throw new TypeError(funcName + ' expects ' + lenthArray.toString() + ' arguments');\n  }\n}\n\nfunction equalsToEither(arg, strConst, numConst) {\n  return (typeof arg === 'string' && arg === strConst) ||\n         (typeof arg === 'number' && arg === numConst);\n}\n\nfunction checkFileExistence(file) {\n  if (!fs.existsSync(file)) {\n    throw new TypeError('Can\\'t open file: ' + file);\n  }\n}\n\n/**\n * Given a point in 3D space, compute the corresponding pixel coordinates in an image with no\n * distortion or forward distortion coefficients produced by the same camera.\n * @param {Intrinsics} intrinsics - The intrinsics of the image stream\n * @param {Object} pointCoordinate - The 3D space coordinate of the point, linke {x: 0, y: 0, z:1}.\n * @return {Object} like {x: 0, y:0}.\n */\nutil.projectPointToPixel = function(intrinsics, pointCoordinate) {\n  const funcName = 'util.projectPointToPixel';\n  checkArgumentLength(2, 2, arguments.length, funcName);\n  checkArgumentType(arguments, 'object', 0, funcName);\n  checkArgumentType(arguments, 'object', 1, funcName);\n  if (equalsToEither(intrinsics.model,\n      distortion.distortion_inverse_brown_conrady,\n      distortion.DISTORTION_INVERSE_BROWN_CONRADY)) {\n    throw new TypeError('projectPointToPixel cannot project to an inverse-distorted image');\n  }\n\n  let x = pointCoordinate.x / pointCoordinate.z;\n  let y = pointCoordinate.y / pointCoordinate.z;\n\n  if (equalsToEither(intrinsics.model,\n      distortion.distortion_modified_brown_conrady,\n      distortion.DISTORTION_MODIFIED_BROWN_CONRADY)) {\n    const r2 = x * x + y * y;\n    const f = 1 + intrinsics.coeffs[0] * r2 + intrinsics.coeffs[1] * r2 * r2 +\n        intrinsics.coeffs[4] * r2 * r2 * r2;\n    x *= f;\n    y *= f;\n    const dx = x + 2 * intrinsics.coeffs[2] * x * y + intrinsics.coeffs[3] * (r2 + 2 * x * x);\n    const dy = y + 2 * intrinsics.coeffs[3] * x * y + intrinsics.coeffs[2] * (r2 + 2 * y * y);\n    x = dx;\n    y = dy;\n  }\n\n  if (equalsToEither(intrinsics.model,\n      distortion.distortion_ftheta,\n      distortion.DISTORTION_FTHETA)) {\n    const r = Math.sqrt(x * x + y * y);\n    const rd = (1.0 / intrinsics.coeffs[0] * Math.atan(2 * r * Math.tan(\n        intrinsics.coeffs[0] / 2.0)));\n    x *= rd / r;\n    y *= rd / r;\n  }\n  return {x: x * intrinsics.fx + intrinsics.ppx, y: y * intrinsics.fy + intrinsics.ppy};\n};\n\n/**\n * Given pixel coordinates and depth in an image with no distortion or inverse distortion\n * coefficients, compute the corresponding point in 3D space relative to the same camera\n * @param {Intrinsics} intrinsics - The intrinsics of the depth stream\n * @param {Object} pixelCoordinate - The pixel coordinate of the point, linke {x: 0, y: 0}.\n * @param {Number} depth - The depth value of the point\n * @return {Object} like {x: 0, y:0, z:0}.\n */\nutil.deprojectPixelToPoint = function(intrinsics, pixelCoordinate, depth) {\n  const funcName = 'util.deprojectPixelToPoint';\n  checkArgumentLength(3, 3, arguments.length, funcName);\n  checkArgumentType(arguments, 'object', 0, funcName);\n  checkArgumentType(arguments, 'object', 1, funcName);\n  checkArgumentType(arguments, 'number', 2, funcName);\n  if (equalsToEither(intrinsics.model,\n      distortion.distortion_modified_brown_conrady,\n      distortion.DISTORTION_MODIFIED_BROWN_CONRADY)) {\n    throw new TypeError('deprojectPixelToPoint cannot deproject from a forward-distorted image');\n  }\n\n  if (equalsToEither(intrinsics.model,\n      distortion.distortion_ftheta,\n      distortion.DISTORTION_FTHETA)) {\n    throw new TypeError('deprojectPixelToPoint cannot deproject to an ftheta image');\n  }\n\n  let x = (pixelCoordinate.x - intrinsics.ppx) / intrinsics.fx;\n  let y = (pixelCoordinate.y - intrinsics.ppy) / intrinsics.fy;\n\n  if (equalsToEither(intrinsics.model,\n      distortion.distortion_inverse_brown_conrady,\n      distortion.DISTORTION_INVERSE_BROWN_CONRADY)) {\n    const r2 = x * x + y * y;\n    const f = 1 + intrinsics.coeffs[0] * r2 + intrinsics.coeffs[1] * r2 * r2 +\n        intrinsics.coeffs[4] * r2 * r2 * r2;\n    const ux = x * f + 2 * intrinsics.coeffs[2] * x * y + intrinsics.coeffs[3] * (r2 + 2 * x * x);\n    const uy = y * f + 2 * intrinsics.coeffs[3] * x * y + intrinsics.coeffs[2] * (r2 + 2 * y * y);\n    x = ux;\n    y = uy;\n  }\n\n  return {x: depth * x, y: depth * y, z: depth};\n};\n\n/**\n * Transform 3D coordinates relative to one sensor to 3D coordinates relative to another viewpoint\n * @param {ExtrinsicsObject} extrinsics - The exrinsics from the original stream to the target\n * stream\n * @param {Object} pointCoordinate - The 3D space coordinate of the original point,\n * like {x: 0, y: 0, z:1}.\n * @return {Object} The tranformed 3D coordinate, like {x:0, y:0, z:0}.\n */\nutil.transformPointToPoint = function(extrinsics, pointCoordinate) {\n  const funcName = 'util.transformPointToPoint';\n  checkArgumentLength(2, 2, arguments.length, funcName);\n  checkArgumentType(arguments, 'object', 0, funcName);\n  checkArgumentType(arguments, 'object', 1, funcName);\n  const x = extrinsics.rotation[0] * pointCoordinate.x +\n            extrinsics.rotation[3] * pointCoordinate.y +\n            extrinsics.rotation[6] * pointCoordinate.z +\n            extrinsics.translation[0];\n  const y = extrinsics.rotation[1] * pointCoordinate.x +\n            extrinsics.rotation[4] * pointCoordinate.y +\n            extrinsics.rotation[7] * pointCoordinate.z +\n            extrinsics.translation[1];\n  const z = extrinsics.rotation[2] * pointCoordinate.x +\n            extrinsics.rotation[5] * pointCoordinate.y +\n            extrinsics.rotation[8] * pointCoordinate.z +\n            extrinsics.translation[2];\n  return {x: x, y: y, z: z};\n};\n\n/**\n * Save the frame to a file asynchronously\n *\n * @param {string} path target file path\n * @param {Frame} frame frame to be saved\n * @param {string} fileFormat the target file format, currently only 'png' is supported\n * @return {Promise}\n */\nutil.writeFrameToFileAsync = function(path, frame, fileFormat = 'png') {\n  const funcName = 'util.writeFrameToFileAsync';\n  checkArgumentLength(3, 3, arguments.length, funcName);\n  checkArgumentType(arguments, 'string', 0, funcName);\n  checkArgumentType(arguments, Frame, 1, funcName);\n  checkArgumentType(arguments, 'string', 2, funcName);\n  if (fileFormat.toLowerCase() === 'png') {\n    let png = new PNG({\n      width: frame.width,\n      height: frame.height,\n      inputColorType: 2,\n      inputHasAlpha: false});\n    png.data = frame.getData();\n    return new Promise((resolve, reject) => {\n      png.pack().pipe(fs.createWriteStream(path)).on('finish', () => {\n        resolve();\n      });\n    });\n  } else {\n    throw new TypeError('util.writeFrameToFileAsync expects a string as the 3rd argument and only \\'png\\' is supported now.'); // eslint-disable-line\n  }\n};\n\n/**\n * Field of view (FOV) info:\n * @typedef {Object} FOVObject\n * @property {Float32} h - horizontal field of view\n * @property {Float32} v - vertical field of view\n * @see [util.fov]{@link util#fov}\n */\n\n/**\n * Get the field of view from an IntrinsicsObject\n * @param {IntrinsicsObject} intrinsics the intrinsics to calculate field of view.\n * @return {FOVObject}\n */\nutil.fov = function(intrinsics) {\n  const funcName = 'util.fov';\n  checkArgumentLength(1, 1, arguments.length, funcName);\n  checkArgumentType(arguments, 'object', 0, funcName);\n  let ppx = intrinsics.ppx;\n  let ppy = intrinsics.ppy;\n  let width = intrinsics.width;\n  let height = intrinsics.height;\n  let fx = intrinsics.fx;\n  let fy = intrinsics.fy;\n  let h = (Math.atan(ppx + 0.5, fx) + Math.atan(width - ppx - 0.5, fx)) * 57.2957795;\n  let v = (Math.atan(ppy + 0.5, fy) + Math.atan(height - ppy - 0.5, fy)) * 57.2957795;\n  return {h: h, v: v};\n};\n\n/**\n * Save the frame to a file synchronously\n *\n * @param {string} path target file path\n * @param {Frame} frame frame to be saved\n * @param {string} fileFormat the target file format, currently only 'png' is supported\n * @return {undefined}\n */\nutil.writeFrameToFile = function(path, frame, fileFormat = 'png') {\n  const funcName = 'util.writeFrameToFile';\n  checkArgumentLength(3, 3, arguments.length, funcName);\n  checkArgumentType(arguments, 'string', 0, funcName);\n  checkArgumentType(arguments, Frame, 1, funcName);\n  checkArgumentType(arguments, 'string', 2, funcName);\n  if (fileFormat.toLowerCase() === 'png') {\n    const opt = {\n      width: frame.width,\n      height: frame.height,\n      inputColorType: 2,\n      inputHasAlpha: false};\n    const png = new PNG(opt);\n    png.data = frame.getData();\n    const buf = PNG.sync.write(png, opt);\n    fs.writeFileSync(path, buf);\n  } else {\n    throw new TypeError('util.writeFrameToFile expects a string as the 3rd argument and only \\'png\\' is supported now.'); // eslint-disable-line\n  }\n};\n\n/**\n * Get all the frame metadata representation as a string\n *\n * @param {frame} frame frame to be saved\n * @return {String} the string representation of all supported frame metadata.\n */\nfunction frameMetadataContent(frame) {\n  const funcName = 'frameMetadataContent';\n  checkArgumentLength(1, 1, arguments.length, funcName);\n  checkArgumentType(arguments, Frame, 0, funcName);\n  let content = 'Stream,' + stream.streamToString(frame.profile.streamType)+'\\nMetadata Attribute,Value\\n'; // eslint-disable-line\n  for (let i = 0; i < frame_metadata.FRAME_METADATA_COUNT; i++) {\n    if (frame.supportsFrameMetadata(i)) {\n      content += frame_metadata.frameMetadataToString(i) + ',' + frame.frameMetadata(i) + '\\n';\n    }\n  }\n  return content;\n}\n\n/**\n * Save the frame metadata string representation to a file asynchronously\n *\n * @param {string} path target file path\n * @param {Frame} frame frame to extract metadata from\n * @return {undefined}\n */\nutil.writeFrameMetadataToFileAsync = function(path, frame) {\n  const funcName = 'util.writeFrameMetadataToFileAsync';\n  checkArgumentLength(2, 2, arguments.length, funcName);\n  checkArgumentType(arguments, 'string', 0, funcName);\n  checkArgumentType(arguments, Frame, 1, funcName);\n  return new Promise((resolve, reject) => {\n    const content = frameMetadataContent(frame);\n    fs.writeFile(path, content, (err) => {\n      if (err) {\n        reject(err);\n      } else {\n        resolve();\n      }\n    });\n  });\n};\n\n/**\n * Save the frame metadata string representation to a file asynchronously\n *\n * @param {String} path target file path\n * @param {Frame} frame to extract metadata from\n * @return {undefined}\n */\nutil.writeFrameMetadataToFile = function(path, frame) {\n  const funcName = 'util.writeFrameMetadataToFile';\n  checkArgumentLength(2, 2, arguments.length, funcName);\n  checkArgumentType(arguments, 'string', 0, funcName);\n  checkArgumentType(arguments, Frame, 1, funcName);\n  const content = frameMetadataContent(frame);\n  const fd = fs.openSync(path, 'w');\n  fs.writeSync(fd, content);\n  fs.closeSync(fd);\n};\n\n/**\n * Enum for format values.\n * @readonly\n * @enum {String}\n */\nconst format = {\n\n  /**\n   * String literal of <code>'any'</code>. <br>When passed to enable stream, librealsense will try\n   * to provide best suited format. <br>Equivalent to its uppercase counterpart.\n   */\n  format_any: 'any',\n  /**\n   * String literal of <code>'z16'</code>. <br>16-bit linear depth values. The depth is meters is\n   * equal to depth scale * pixel value. <br>Equivalent to its uppercase counterpart.\n   */\n  format_z16: 'z16',\n  /**\n   * String literal of <code>'disparity16'</code>. <br>16-bit linear disparity values. The depth in\n   * meters is equal to depth scale / pixel value. <br>Equivalent to its uppercase counterpart.\n   */\n  format_disparity16: 'disparity16',\n  /**\n   * String literal of <code>'xyz32f'</code>. <br>32-bit floating point 3D coordinates.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  format_xyz32f: 'xyz32f',\n  /**\n   * String literal of <code>'yuyv'</code>. <br>32-bit y0, u, y1, v data for every two pixels.\n   * Similar to YUV422 but packed in a different order - https://en.wikipedia.org/wiki/YUV\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  format_yuyv: 'yuyv',\n  /**\n   * String literal of <code>'rgb8'</code>. <br>8-bit red, green and blue channels.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  format_rgb8: 'rgb8',\n  /**\n   * String literal of <code>'bgr8'</code>. <br>8-bit blue, green, and red channels -- suitable for\n   * OpenCV. <br>Equivalent to its uppercase counterpart.\n   */\n  format_bgr8: 'bgr8',\n  /**\n   * String literal of <code>'rgba8'</code>. <br>8-bit red, green and blue channels + constant\n   * alpha channel equal to FF. <br>Equivalent to its uppercase counterpart.\n   */\n  format_rgba8: 'rgba8',\n  /**\n   * String literal of <code>'bgra8'</code>. <br>8-bit blue, green, and red channels + constant\n   * alpha channel equal to FF. <br>Equivalent to its uppercase counterpart.\n   */\n  format_bgra8: 'bgra8',\n  /**\n   * String literal of <code>'y8'</code>. <br>8-bit per-pixel grayscale image.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  format_y8: 'y8',\n  /**\n   * String literal of <code>'y16'</code>. <br>16-bit per-pixel grayscale image.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  format_y16: 'y16',\n  /**\n   * String literal of <code>'raw10'</code>. <br>Four 10-bit luminance values encoded into\n   * a 5-byte macropixel. <br>Equivalent to its uppercase counterpart.\n   */\n  format_raw10: 'raw10',\n  /**\n   * String literal of <code>'raw16'</code>. <br>16-bit raw image. <br>Equivalent to\n   * its uppercase counterpart.\n   */\n  format_raw16: 'raw16',\n  /**\n   * String literal of <code>'raw8'</code>. <br>8-bit raw image. <br>Equivalent to\n   * its uppercase counterpart.\n   */\n  format_raw8: 'raw8',\n  /**\n   * String literal of <code>'uyvy'</code>. <br>Similar to the standard YUYV pixel\n   * format, but packed in a different order. <br>Equivalent to its uppercase counterpart.\n   */\n  format_uyvy: 'uyvy',\n  /**\n   * String literal of <code>'motion_raw'</code>. <br>Raw data from the motion sensor.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  format_motion_raw: 'motion-raw',\n  /**\n   * String literal of <code>'motion_xyz32f'</code>. <br>Motion data packed as 3 32-bit\n   * float values, for X, Y, and Z axis. <br>Equivalent to its uppercase counterpart.\n   */\n  format_motion_xyz32f: 'motion-xyz32f',\n  /**\n   * String literal of <code>'gpio-raw'</code>. <br>Raw data from the external sensors\n   * hooked to one of the GPIO's. <br>Equivalent to its uppercase counterpart.\n   */\n  format_gpio_raw: 'gpio-raw',\n  /**\n   * String literal of <code>'6dof'</code>. <br>Pose data packed as floats array, containing\n   * translation vector, rotation quaternion and prediction velocities and accelerations vectors\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  format_6dof: '6dof',\n  /**\n   * String literal of <code>'disparity32'</code>. <br>32-bit float-point disparity values.\n   * Depth->Disparity conversion : Disparity = Baseline*FocalLength/Depth.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  format_disparity32: 'disparity32',\n  /**\n   * When passed to enable stream, librealsense will try to provide best suited\n   * format. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_ANY: RS2.RS2_FORMAT_ANY,\n  /**\n   * 16-bit linear depth values. The depth is meters is equal to depth\n   * scale * pixel value. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_Z16: RS2.RS2_FORMAT_Z16,\n  /**\n   * 16-bit linear disparity values. The depth in meters is equal to depth\n   * scale / pixel value. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_DISPARITY16: RS2.RS2_FORMAT_DISPARITY16,\n  /**\n   * 32-bit floating point 3D coordinates. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_XYZ32F: RS2.RS2_FORMAT_XYZ32F,\n  /**\n   * 32-bit y0, u, y1, v data for every two pixels. Similar to YUV422 but packed in a different\n   * order - https://en.wikipedia.org/wiki/YUV.\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_YUYV: RS2.RS2_FORMAT_YUYV,\n  /**\n   * 8-bit red, green and blue channels. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_RGB8: RS2.RS2_FORMAT_RGB8,\n  /**\n   * 8-bit blue, green, and red channels -- suitable for OpenCV. <br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  FORMAT_BGR8: RS2.RS2_FORMAT_BGR8,\n  /**\n   * 8-bit red, green and blue channels + constant alpha channel equal to FF. <br>Equivalent to\n   * its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_RGBA8: RS2.RS2_FORMAT_RGBA8,\n  /**\n   * 8-bit blue, green, and red channels + constant alpha channel equal to FF. <br>Equivalent to\n   * its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_BGRA8: RS2.RS2_FORMAT_BGRA8,\n  /**\n   * 8-bit per-pixel grayscale image. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_Y8: RS2.RS2_FORMAT_Y8,\n  /**\n   * 16-bit per-pixel grayscale image. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_Y16: RS2.RS2_FORMAT_Y16,\n  /**\n   * Four 10-bit luminance values encoded into a 5-byte macropixel. <br>Equivalent to its\n   * lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_RAW10: RS2.RS2_FORMAT_RAW10,\n  /**\n   * 16-bit raw image. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_RAW16: RS2.RS2_FORMAT_RAW16,\n  /**\n   * 8-bit raw image. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_RAW8: RS2.RS2_FORMAT_RAW8,\n  /**\n   * Similar to the standard YUYV pixel format, but packed in a different order. <br>Equivalent to\n   * its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_UYVY: RS2.RS2_FORMAT_UYVY,\n  /**\n   * Raw data from the motion sensor. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_MOTION_RAW: RS2.RS2_FORMAT_MOTION_RAW,\n  /**\n   * Motion data packed as 3 32-bit float values, for X, Y, and Z axis. <br>Equivalent to its\n   * lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_MOTION_XYZ32F: RS2.RS2_FORMAT_MOTION_XYZ32F,\n  /**\n   * Raw data from the external sensors hooked to one of the GPIO's. <br>Equivalent to its\n   * lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_GPIO_RAW: RS2.RS2_FORMAT_GPIO_RAW,\n  /**\n   * Pose data packed as floats array, containing translation vector, rotation quaternion\n   * and prediction velocities and accelerations vectors\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_6DOF: RS2.RS2_FORMAT_6DOF,\n  /**\n   * 32-bit float-point disparity values. Depth->Disparity conversion :\n   * Disparity = Baseline*FocalLength/Depth. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_DISPARITY32: RS2.RS2_FORMAT_DISPARITY32,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FORMAT_COUNT: RS2.RS2_FORMAT_COUNT,\n\n  /**\n   * Get the string representation out of the integer format type\n   * @param {Integer} format the format type\n   * @return {String}\n   */\n  formatToString: function(format) {\n    const funcName = 'format.formatToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.format, 0, funcName);\n    switch (i) {\n      case this.FORMAT_ANY:\n        return this.format_any;\n      case this.FORMAT_Z16:\n        return this.format_z16;\n      case this.FORMAT_DISPARITY16:\n        return this.format_disparity16;\n      case this.FORMAT_XYZ32F:\n        return this.format_xyz32f;\n      case this.FORMAT_YUYV:\n        return this.format_yuyv;\n      case this.FORMAT_RGB8:\n        return this.format_rgb8;\n      case this.FORMAT_BGR8:\n        return this.format_bgr8;\n      case this.FORMAT_RGBA8:\n        return this.format_rgba8;\n      case this.FORMAT_BGRA8:\n        return this.format_bgra8;\n      case this.FORMAT_Y8:\n        return this.format_y8;\n      case this.FORMAT_Y16:\n        return this.format_y16;\n      case this.FORMAT_RAW10:\n        return this.format_raw10;\n      case this.FORMAT_RAW16:\n        return this.format_raw16;\n      case this.FORMAT_RAW8:\n        return this.format_raw8;\n      case this.FORMAT_UYVY:\n        return this.format_uyvy;\n      case this.FORMAT_MOTION_RAW:\n        return this.format_motion_raw;\n      case this.FORMAT_MOTION_XYZ32F:\n        return this.format_motion_xyz32f;\n      case this.FORMAT_GPIO_RAW:\n        return this.format_gpio_raw;\n      case this.FORMAT_6DOF:\n        return this.format_6dof;\n      case this.FORMAT_DISPARITY32:\n        return this.format_disparity32;\n    }\n  },\n};\n\n\n/**\n * Enum for stream values.\n * @readonly\n * @enum {String}\n */\nconst stream = {\n    /**\n     * String literal of <code>'any'</code>. <br>Any stream. <br>Equivalent\n     * to its uppercase counterpart.\n     */\n    stream_any: 'any',\n    /**\n     * String literal of <code>'depth'</code>. <br>Native stream of depth data\n     * produced by RealSense device . <br>Equivalent to its uppercase counterpart.\n     */\n    stream_depth: 'depth',\n    /**\n     * String literal of <code>'color'</code>. <br>Native stream of color data\n     * captured by RealSense device . <br>Equivalent to its uppercase counterpart.\n     */\n    stream_color: 'color',\n    /**\n     * String literal of <code>'infrared'</code>. <br>Native stream of infrared data\n     * captured by RealSense device . <br>Equivalent to its uppercase counterpart.\n     */\n    stream_infrared: 'infrared',\n    /**\n     * String literal of <code>'fisheye'</code>. <br>Native stream of fish-eye(wide) data\n     * captured from the dedicate motion camera . <br>Equivalent to its uppercase counterpart.\n     */\n    stream_fisheye: 'fisheye',\n    /**\n     * String literal of <code>'gyro'</code>. <br>Native stream of gyroscope motion\n     * data produced by RealSense device . <br>Equivalent to its uppercase counterpart.\n     */\n    stream_gyro: 'gyro',\n    /**\n     * String literal of <code>'accel'</code>. <br>Native stream of accelerometer motion\n     * data produced by RealSense device . <br>Equivalent to its uppercase counterpart.\n     */\n    stream_accel: 'accel',\n    /**\n     * String literal of <code>'gpio'</code>. <br>Signals from external device connected\n     * through GPIO . <br>Equivalent to its uppercase counterpart.\n     */\n    stream_gpio: 'gpio',\n    /**\n     * String literal of <code>'pose'</code>. <br>6 Degrees of Freedom pose data, calculated by\n     * RealSense device. <br>Equivalent to its uppercase counterpart.\n     */\n    stream_pose: 'pose',\n    /**\n     * String literal of <code>'confidence'</code>. <br>Confidence stream\n     * <br>Equivalent to its uppercase counterpart.\n     */\n    stream_confidence: 'confidence',\n\n    /**\n     * Any stream. <br>Equivalent to its lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_ANY: RS2.RS2_STREAM_ANY,\n    /**\n     * Native stream of depth data produced by RealSense device. <br>Equivalent to its\n     * lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_DEPTH: RS2.RS2_STREAM_DEPTH,\n    /**\n     * Native stream of color data captured by RealSense device. <br>Equivalent to its\n     * lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_COLOR: RS2.RS2_STREAM_COLOR,\n    /**\n     * Native stream of infrared data captured by RealSense device. <br>Equivalent to its\n     * lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_INFRARED: RS2.RS2_STREAM_INFRARED,\n    /**\n     * Native stream of fish-eye (wide) data captured from the dedicate motion camera.\n     * <br>Equivalent to its lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_FISHEYE: RS2.RS2_STREAM_FISHEYE,\n    /**\n     * Native stream of gyroscope motion data produced by RealSense device. <br>Equivalent to\n     * its lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_GYRO: RS2.RS2_STREAM_GYRO,\n    /**\n     * Native stream of accelerometer motion data produced by RealSense device. <br>Equivalent to\n     * its lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_ACCEL: RS2.RS2_STREAM_ACCEL,\n    /**\n     * Signals from external device connected through GPIO. <br>Equivalent to its\n     * lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_GPIO: RS2.RS2_STREAM_GPIO,\n    /**\n     * 6 Degrees of Freedom pose data, calculated by RealSense device. <br>Equivalent to its\n     * lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_POSE: RS2.RS2_STREAM_POSE,\n    /**\n     * Confidence stream. <br>Equivalent to its lowercase counterpart.\n     * @type {Integer}\n     */\n    STREAM_CONFIDENCE: RS2.RS2_STREAM_CONFIDENCE,\n    /**\n     * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n     * @type {Integer}\n    */\n    STREAM_COUNT: RS2.RS2_STREAM_COUNT,\n\n    /**\n     * Get the string representation out of the integer stream type\n     * @param {Integer} stream the stream type\n     * @return {String}\n     */\n    streamToString: function(stream) {\n      const funcName = 'stream.streamToString()';\n      checkArgumentLength(1, 1, arguments.length, funcName);\n      const i = checkArgumentType(arguments, constants.stream, 0, funcName);\n      switch (i) {\n        case this.STREAM_ANY:\n          return this.stream_any;\n        case this.STREAM_DEPTH:\n          return this.stream_depth;\n        case this.STREAM_COLOR:\n          return this.stream_color;\n        case this.STREAM_INFRARED:\n          return this.stream_infrared;\n        case this.STREAM_FISHEYE:\n          return this.stream_fisheye;\n        case this.STREAM_GYRO:\n          return this.stream_gyro;\n        case this.STREAM_ACCEL:\n          return this.stream_accel;\n        case this.STREAM_GPIO:\n          return this.stream_gpio;\n        case this.STREAM_POSE:\n          return this.stream_pose;\n        case this.STREAM_CONFIDENCE:\n          return this.stream_confidence;\n      }\n    },\n};\n\n/**\n * Enum for recording options\n * @readonly\n * @enum {String}\n * @see See [RecordingContext.constructor()]{@link RecordingContext} for usage\n */\nconst recording_mode = {\n  /**\n   * String literal of <code>'blank-frames'</code>. <br>Frame metadata will be recorded,\n   * but pixel data will be replaced with zeros to save space. <br>Equivalent to its uppercase\n   * counterpart.\n   */\n  recording_mode_blank_frames: 'blank-frames',\n  /**\n   * String literal of <code>'compressed'</code>. <br>Frames will be encoded using a proprietary\n   * lossy encoding, aiming at x5 compression at some CPU expense. <br>Equivalent to its uppercase\n   * counterpart.\n   */\n  recording_mode_compressed: 'compressed',\n  /**\n   * String literal of <code>'best-quality'</code>. <br>Frames will not be compressed,\n   * but rather stored as-is. This gives best quality and low CPU overhead, but you might run out\n   * of memory. <br>Equivalent to its uppercase counterpart.\n   */\n  recording_mode_best_quality: 'best-quality',\n\n  /**\n   * Frame metadata will be recorded, but pixel data will be replaced with zeros to save space.\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  RECORDING_MODE_BLANK_FRAMES: RS2.RS2_RECORDING_MODE_BLANK_FRAMES,\n  /**\n   * Frames will be encoded using a proprietary lossy encoding, aiming at x5 compression at some\n   * CPU expense.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  RECORDING_MODE_COMPRESSED: RS2.RS2_RECORDING_MODE_COMPRESSED,\n  /**\n   * Frames will not be compressed, but rather stored as-is. This gives best quality and low CPU\n   * overhead, but you might run out of memory.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  RECORDING_MODE_BEST_QUALITY: RS2.RS2_RECORDING_MODE_BEST_QUALITY,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n  */\n  RECORDING_MODE_COUNT: RS2.RS2_RECORDING_MODE_COUNT,\n};\n\n/**\n * Enum for option values.\n * @readonly\n * @enum {String}\n * @see [Sensor.isOptionReadOnly()]{@link Sensor#isOptionReadOnly}\n * @see [Sensor.getOption()]{@link Sensor#getOption}\n * @see [Sensor.getOptionRange()]{@link Sensor#getOptionRange}\n * @see [Sensor.setOption()]{@link Sensor#setOption}\n * @see [Sensor.supportsOption()]{@link Sensor#supportsOption}\n * @see [Sensor.getOptionDescription()]{@link Sensor#getOptionDescription}\n * @see [Sensor.getOptionValueDescription()]{@link Sensor#getOptionValueDescription}\n */\n\nconst option = {\n  /**\n   * String literal of <code>'backlight-compensation'</code>. <br>Enable / disable color\n   * backlight compensation. <br>Equivalent to its uppercase counterpart.\n   */\n  option_backlight_compensation: 'backlight-compensation',\n  /**\n   * String literal of <code>'brightness'</code>. <br>Color image brightness. <br>Equivalent\n   * to its uppercase counterpart.\n   */\n  option_brightness: 'brightness',\n  /**\n   * String literal of <code>'contrast'</code>. <br>Color image contrast. <br>Equivalent\n   * to its uppercase counterpart.\n   */\n  option_contrast: 'contrast',\n  /**\n   * String literal of <code>'exposure'</code>. <br>Controls exposure time of color camera\n   *. Setting any value will disable auto exposure. <br>Equivalent to its uppercase counterpart.\n   */\n  option_exposure: 'exposure',\n  /**\n   * String literal of <code>'gain'</code>. <br>Color image gain. <br>Equivalent to its\n   * uppercase counterpart.\n   */\n  option_gain: 'gain',\n  /**\n   * String literal of <code>'gamma'</code>. <br>Color image gamma setting. <br>Equivalent\n   * to its uppercase counterpart.\n   */\n  option_gamma: 'gamma',\n  /**\n   * String literal of <code>'hue'</code>. <br>Color image hue. <br>Equivalent to its\n   * uppercase counterpart.\n   */\n  option_hue: 'hue',\n  /**\n   * String literal of <code>'saturation'</code>. <br>Color image saturation setting.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_saturation: 'saturation',\n  /**\n   * String literal of <code>'sharpness'</code>. <br>Color image sharpness setting.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_sharpness: 'sharpness',\n  /**\n   * String literal of <code>'white-balance'</code>. <br>Controls white balance of color\n   * image. Setting any value will disable auto white balance. <br>Equivalent to its uppercase\n   * counterpart.\n   */\n  option_white_balance: 'white-balance',\n  /**\n   * String literal of <code>'enable-auto-exposure'</code>. <br>Enable / disable color\n   * image auto-exposure. <br>Equivalent to its uppercase counterpart.\n   */\n  option_enable_auto_exposure: 'enable-auto-exposure',\n  /**\n   * String literal of <code>'enable-auto-white-balance'</code>. <br>Enable / disable\n   * color image auto-white-balance. <br>Equivalent to its uppercase counterpart.\n   */\n  option_enable_auto_white_balance: 'enable-auto-white-balance',\n  /**\n   * String literal of <code>'visual-preset'</code>. <br>Provide access to several recommend\n   * sets of option presets for the depth camera . <br>Equivalent to its uppercase counterpart.\n   */\n  option_visual_preset: 'visual-preset',\n  /**\n   * String literal of <code>'laser-power'</code>. <br>Power of the F200 / SR300 projector\n   *, with 0 meaning projector off. <br>Equivalent to its uppercase counterpart.\n   */\n  option_laser_power: 'laser-power',\n  /**\n   * String literal of <code>'accuracy'</code>. <br>Set the number of patterns projected\n   * per frame. The higher the accuracy value the more patterns projected. Increasing the number\n   * of patterns help to achieve better accuracy. Note that this control is affecting the Depth FPS.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_accuracy: 'accuracy',\n  /**\n   * String literal of <code>'motion-range'</code>. <br>Motion vs. Range trade-off, with\n   * lower values allowing for better motion sensitivity and higher values allowing for better\n   * depth range. <br>Equivalent to its uppercase counterpart.\n   */\n  option_motion_range: 'motion-range',\n  /**\n   * String literal of <code>'filter-option'</code>. <br>Set the filter to apply to each\n   * depth frame. Each one of the filter is optimized per the application requirements.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_filter_option: 'filter-option',\n  /**\n   * String literal of <code>'confidence-threshold'</code>. <br>The confidence level threshold\n   * used by the Depth algorithm pipe to set whether a pixel will get a valid range or will \n   * be marked with invalid range. <br>Equivalent to its uppercase counterpart.\n   */\n  option_confidence_threshold: 'confidence-threshold',\n  /**\n   * String literal of <code>'emitter-enabled'</code>. <br>Laser Emitter enabled .\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_emitter_enabled: 'emitter-enabled',\n  /**\n   * String literal of <code>'frames-queue-size'</code>. <br>Number of frames the user\n   * is allowed to keep per stream. Trying to hold-on to more frames will cause frame-drops.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_frames_queue_size: 'frames-queue-size',\n  /**\n   * String literal of <code>'total-frame-drops'</code>. <br>Total number of detected\n   * frame drops from all streams . <br>Equivalent to its uppercase counterpart.\n   */\n  option_total_frame_drops: 'total-frame-drops',\n  /**\n   * String literal of <code>'auto-exposure-mode'</code>. <br>Auto-Exposure modes: Static\n   *, Anti-Flicker and Hybrid . <br>Equivalent to its uppercase counterpart.\n   */\n  option_auto_exposure_mode: 'auto-exposure-mode',\n  /**\n   * String literal of <code>'power-line-frequency'</code>. <br>Power Line Frequency control\n   * for anti-flickering, Off/50Hz/60Hz/Auto. <br>Equivalent to its uppercase counterpart.\n   */\n  option_power_line_frequency: 'power-line-frequency',\n  /**\n   * String literal of <code>'asic-temperature'</code>. <br>Current Asic Temperature .\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_asic_temperature: 'asic-temperature',\n  /**\n   * String literal of <code>'error-polling-enabled'</code>. <br>disable error handling\n   * . <br>Equivalent to its uppercase counterpart.\n   */\n  option_error_polling_enabled: 'error-polling-enabled',\n  /**\n   * String literal of <code>'projector-temperature'</code>. <br>Current Projector Temperature\n   * . <br>Equivalent to its uppercase counterpart.\n   */\n  option_projector_temperature: 'projector-temperature',\n  /**\n   * String literal of <code>'output-trigger-enabled'</code>. <br>Enable / disable trigger\n   * to be outputed from the camera to any external device on every depth frame.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_output_trigger_enabled: 'output-trigger-enabled',\n  /**\n   * String literal of <code>'motion-module-temperature'</code>. <br>Current Motion-Module\n   * Temperature . <br>Equivalent to its uppercase counterpart.\n   */\n  option_motion_module_temperature: 'motion-module-temperature',\n  /**\n   * String literal of <code>'depth-units'</code>. <br>Number of meters represented by\n   * a single depth unit . <br>Equivalent to its uppercase counterpart.\n   */\n  option_depth_units: 'depth-units',\n  /**\n   * String literal of <code>'enable-motion-correction'</code>. <br>Enable/Disable automatic\n   * correction of the motion data . <br>Equivalent to its uppercase counterpart.\n   */\n  option_enable_motion_correction: 'enable-motion-correction',\n  /**\n   * String literal of <code>'auto-exposure-priority'</code>.\n   * <br>Allows sensor to dynamically ajust the frame rate\n   * depending on lighting conditions <br>Equivalent to its uppercase counterpart\n   */\n  option_auto_exposure_priority: 'auto-exposure-priority',\n\n  /**\n   * String literal of <code>''color-scheme'</code>. <br>Color scheme for data visualization\n   * <br>Equivalent to its uppercase counterpart\n   */\n  option_color_scheme: 'color-scheme',\n\n  /**\n   * String literal of <code>''histogram-equalization-enabled'</code>. <br>Perform histogram\n   * equalization post-processing on the depth data <br>Equivalent to its uppercase counterpart\n   */\n  option_histogram_equalization_enabled: 'histogram-equalization-enabled',\n\n  /**\n   * String literal of <code>''min-distance'</code>. <br>Minimal distance to the target\n   * <br>Equivalent to its uppercase counterpart\n   */\n  option_min_distance: 'min-distance',\n\n  /**\n   * String literal of <code>''max-distance'</code>. <br>Maximum distance to the target\n   * <br>Equivalent to its uppercase counterpart\n   */\n  option_max_distance: 'max-distance',\n  /**\n   * String literal of <code>'texture-source'</code>. <br>Texture mapping stream unique ID\n   * <br> Equivalent to its uppercase counterpart.\n   */\n  option_texture_source: 'texture-source',\n  /**\n   * String literal of <code>'filter-magnitude'</code>. <br>The 2D-filter effect. The specific\n   * interpretation is given within the context of the filter\n   * <br> Equivalent to its uppercase counterpart.\n   */\n  option_filter_magnitude: 'filter-magnitude',\n  /**\n   * String literal of <code>'filter-smooth-alpha'</code>. <br>2D-filter parameter controls\n   * the weight/radius for smoothing.\n   * <br> Equivalent to its uppercase counterpart.\n   */\n  option_filter_smooth_alpha: 'filter-smooth-alpha',\n  /**\n   * String literal of <code>'filter-smooth-delta'</code>. <br>2D-filter range/validity threshold\n   * <br> Equivalent to its uppercase counterpart.\n   */\n  option_filter_smooth_delta: 'filter-smooth-delta',\n  /**\n   * String literal of <code>'holes-fill'</code>. <br>Enhance depth data post-processing\n   * with holes filling where appropriate\n   * <br> Equivalent to its uppercase counterpart.\n   */\n  option_holes_fill: 'holes-fill',\n  /**\n   * String literal of <code>'stereo-baseline'</code>. <br>The distance in mm between the first\n   * and the second imagers in stereo-based depth cameras\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_stereo_baseline: 'stereo-baseline',\n  /**\n   * String literal of <code>'auto-exposure-converage-step'</code>. <br>Allows dynamically ajust\n   * the converge step value of the target exposure in Auto-Exposure algorithm\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_auto_exposure_converge_step: 'auto-exposure-converge-step',\n  /**\n   * String literal of <code>'inter-cam-sync-mode'. <br>Impose Inter-camera HW synchronization mode.\n   * Applicable for D400/Rolling Shutter SKUs\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  option_inter_cam_sync_mode: 'inter-cam-sync-mode',\n  /**\n   * Enable / disable color backlight compensatio.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_BACKLIGHT_COMPENSATION: RS2.RS2_OPTION_BACKLIGHT_COMPENSATION,\n  /**\n   * Color image brightnes.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_BRIGHTNESS: RS2.RS2_OPTION_BRIGHTNESS,\n  /**\n   * Color image contras.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_CONTRAST: RS2.RS2_OPTION_CONTRAST,\n  /**\n   * Controls exposure time of color camera. Setting any value will disable auto exposur.\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_EXPOSURE: RS2.RS2_OPTION_EXPOSURE,\n  /**\n   * Color image gai.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_GAIN: RS2.RS2_OPTION_GAIN,\n  /**\n   * Color image gamma settin.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_GAMMA: RS2.RS2_OPTION_GAMMA,\n  /**\n   * Color image hu.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_HUE: RS2.RS2_OPTION_HUE,\n  /**\n   * Color image saturation settin.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_SATURATION: RS2.RS2_OPTION_SATURATION,\n  /**\n   * Color image sharpness settin.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_SHARPNESS: RS2.RS2_OPTION_SHARPNESS,\n  /**\n   * Controls white balance of color image. Setting any value will disable auto white balanc.\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_WHITE_BALANCE: RS2.RS2_OPTION_WHITE_BALANCE,\n  /**\n   * Enable / disable color image auto-exposur.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_ENABLE_AUTO_EXPOSURE: RS2.RS2_OPTION_ENABLE_AUTO_EXPOSURE,\n  /**\n   * Enable / disable color image auto-white-balanc.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_ENABLE_AUTO_WHITE_BALANCE: RS2.RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE,\n  /**\n   * Provide access to several recommend sets of option presets for the depth camera.\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_VISUAL_PRESET: RS2.RS2_OPTION_VISUAL_PRESET,\n  /**\n   * Power of the F200 / SR300 projector, with 0 meaning projector of.\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_LASER_POWER: RS2.RS2_OPTION_LASER_POWER,\n  /**\n   * Set the number of patterns projected per frame. The higher the accuracy value the more\n   * patterns projected. Increasing the number of patterns help to achieve better accuracy. Note\n   * that this control is affecting the Depth FPS.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_ACCURACY: RS2.RS2_OPTION_ACCURACY,\n  /**\n   * Motion vs. Range trade-off, with lower values allowing for better motion sensitivity and\n   * higher values allowing for better depth rang.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_MOTION_RANGE: RS2.RS2_OPTION_MOTION_RANGE,\n  /**\n   * Set the filter to apply to each depth frame. Each one of the filter is optimized per the\n   * application requirement.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_FILTER_OPTION: RS2.RS2_OPTION_FILTER_OPTION,\n  /**\n   * The confidence level threshold used by the Depth algorithm pipe to set whether a pixel will\n   * get a valid range or will be marked with invalid rang.<br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  OPTION_CONFIDENCE_THRESHOLD: RS2.RS2_OPTION_CONFIDENCE_THRESHOLD,\n  /**\n   * Laser Emitter enabled.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_EMITTER_ENABLED: RS2.RS2_OPTION_EMITTER_ENABLED,\n  /**\n   * Number of frames the user is allowed to keep per stream. Trying to hold-on to more frames will\n   * cause frame-drops.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_FRAMES_QUEUE_SIZE: RS2.RS2_OPTION_FRAMES_QUEUE_SIZE,\n  /**\n   * Total number of detected frame drops from all streams.<br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  OPTION_TOTAL_FRAME_DROPS: RS2.RS2_OPTION_TOTAL_FRAME_DROPS,\n  /**\n   * Auto-Exposure modes: Static, Anti-Flicker and Hybrid.<br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  OPTION_AUTO_EXPOSURE_MODE: RS2.RS2_OPTION_AUTO_EXPOSURE_MODE,\n  /**\n   * Power Line Frequency control for anti-flickering, Off/50Hz/60Hz/Auto.<br>Equivalent to its\n   * lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_POWER_LINE_FREQUENCY: RS2.RS2_OPTION_POWER_LINE_FREQUENCY,\n  /**\n   * Current Asic Temperature.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_ASIC_TEMPERATURE: RS2.RS2_OPTION_ASIC_TEMPERATURE,\n  /**\n   * disable error handling.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_ERROR_POLLING_ENABLED: RS2.RS2_OPTION_ERROR_POLLING_ENABLED,\n  /**\n   * Current Projector Temperature.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_PROJECTOR_TEMPERATURE: RS2.RS2_OPTION_PROJECTOR_TEMPERATURE,\n  /**\n   * Enable / disable trigger to be outputed from the camera to any external device on every depth\n   * frame.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_OUTPUT_TRIGGER_ENABLED: RS2.RS2_OPTION_OUTPUT_TRIGGER_ENABLED,\n  /**\n   * Current Motion-Module Temperature.<br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_MOTION_MODULE_TEMPERATURE: RS2.RS2_OPTION_MOTION_MODULE_TEMPERATURE,\n  /**\n   * Number of meters represented by a single depth unit.<br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  OPTION_DEPTH_UNITS: RS2.RS2_OPTION_DEPTH_UNITS,\n  /**\n   * Enable/Disable automatic correction of the motion data.<br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  OPTION_ENABLE_MOTION_CORRECTION: RS2.RS2_OPTION_ENABLE_MOTION_CORRECTION,\n  /**\n   * Allows sensor to dynamically ajust the frame rate depending on lighting conditions.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_AUTO_EXPOSURE_PRIORITY: RS2.RS2_OPTION_AUTO_EXPOSURE_PRIORITY,\n\n  /**\n   * Color scheme for data visualization <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_COLOR_SCHEME: RS2.RS2_OPTION_COLOR_SCHEME,\n\n  /**\n   * Perform histogram equalization post-processing on the depth data.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_HISTOGRAM_EQUALIZATION_ENABLED: RS2.RS2_OPTION_HISTOGRAM_EQUALIZATION_ENABLED,\n\n  /**\n   * Minimal distance to the target <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_MIN_DISTANCE: RS2.RS2_OPTION_MIN_DISTANCE,\n\n  /**\n   * Maximum distance to the target <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_MAX_DISTANCE: RS2.RS2_OPTION_MAX_DISTANCE,\n  /**\n   * Texture mapping stream unique ID <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_TEXTURE_SOURCE: RS2.RS2_OPTION_TEXTURE_SOURCE,\n  /**\n   * The 2D-filter effect. The specific interpretation is given within the context of the filter\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_FILTER_MAGNITUDE: RS2.RS2_OPTION_FILTER_MAGNITUDE,\n  /**\n   * 2D-filter parameter controls the weight/radius for smoothing.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_FILTER_SMOOTH_ALPHA: RS2.RS2_OPTION_FILTER_SMOOTH_ALPHA,\n  /**\n   * 2D-filter range/validity threshold<br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_FILTER_SMOOTH_DELTA: RS2.RS2_OPTION_FILTER_SMOOTH_DELTA,\n  /**\n   * Enhance depth data post-processing with holes filling where appropriate\n   * <br> Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  OPTION_HOLES_FILL: RS2.RS2_OPTION_HOLES_FILL,\n  /**\n   * The distance in mm between the first and the second imagers in stereo-based depth cameras\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_STEREO_BASELINE: RS2.RS2_OPTION_STEREO_BASELINE,\n  /**\n   * Allows dynamically ajust the converge step value of the target exposure in Auto-Exposure\n   * algorithm\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_AUTO_EXPOSURE_CONVERGE_STEP: RS2.RS2_OPTION_AUTO_EXPOSURE_CONVERGE_STEP,\n  /**\n   * Impose Inter-camera HW synchronization mode.\n   * Applicable for D400/Rolling Shutter SKUs\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  OPTION_INTER_CAM_SYNC_MODE: RS2.RS2_OPTION_INTER_CAM_SYNC_MODE,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  OPTION_COUNT: RS2.RS2_OPTION_COUNT,\n\n  /**\n   * Get the string representation out of the integer option type\n   * @param {Integer} option the option type\n   * @return {String}\n   */\n  optionToString: function(option) {\n    const funcName = 'option.optionToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.option, 0, funcName);\n    switch (i) {\n      case this.OPTION_BACKLIGHT_COMPENSATION:\n        return this.option_backlight_compensation;\n      case this.OPTION_BRIGHTNESS:\n        return this.option_brightness;\n      case this.OPTION_CONTRAST:\n        return this.option_contrast;\n      case this.OPTION_EXPOSURE:\n        return this.option_exposure;\n      case this.OPTION_GAIN:\n        return this.option_gain;\n      case this.OPTION_GAMMA:\n        return this.option_gamma;\n      case this.OPTION_HUE:\n        return this.option_hue;\n      case this.OPTION_SATURATION:\n        return this.option_saturation;\n      case this.OPTION_SHARPNESS:\n        return this.option_sharpness;\n      case this.OPTION_WHITE_BALANCE:\n        return this.option_white_balance;\n      case this.OPTION_ENABLE_AUTO_EXPOSURE:\n        return this.option_enable_auto_exposure;\n      case this.OPTION_ENABLE_AUTO_WHITE_BALANCE:\n        return this.option_enable_auto_white_balance;\n      case this.OPTION_VISUAL_PRESET:\n        return this.option_visual_preset;\n      case this.OPTION_LASER_POWER:\n        return this.option_laser_power;\n      case this.OPTION_ACCURACY:\n        return this.option_accuracy;\n      case this.OPTION_MOTION_RANGE:\n        return this.option_motion_range;\n      case this.OPTION_FILTER_OPTION:\n        return this.option_filter_option;\n      case this.OPTION_CONFIDENCE_THRESHOLD:\n        return this.option_confidence_threshold;\n      case this.OPTION_EMITTER_ENABLED:\n        return this.option_emitter_enabled;\n      case this.OPTION_FRAMES_QUEUE_SIZE:\n        return this.option_frames_queue_size;\n      case this.OPTION_TOTAL_FRAME_DROPS:\n        return this.option_total_frame_drops;\n      case this.OPTION_AUTO_EXPOSURE_MODE:\n        return this.option_auto_exposure_mode;\n      case this.OPTION_POWER_LINE_FREQUENCY:\n        return this.option_power_line_frequency;\n      case this.OPTION_ASIC_TEMPERATURE:\n        return this.option_asic_temperature;\n      case this.OPTION_ERROR_POLLING_ENABLED:\n        return this.option_error_polling_enabled;\n      case this.OPTION_PROJECTOR_TEMPERATURE:\n        return this.option_projector_temperature;\n      case this.OPTION_OUTPUT_TRIGGER_ENABLED:\n        return this.option_output_trigger_enabled;\n      case this.OPTION_MOTION_MODULE_TEMPERATURE:\n        return this.option_motion_module_temperature;\n      case this.OPTION_DEPTH_UNITS:\n        return this.option_depth_units;\n      case this.OPTION_ENABLE_MOTION_CORRECTION:\n        return this.option_enable_motion_correction;\n      case this.OPTION_AUTO_EXPOSURE_PRIORITY:\n        return this.option_auto_exposure_priority;\n      case this.OPTION_COLOR_SCHEME:\n        return this.option_color_scheme;\n      case this.OPTION_HISTOGRAM_EQUALIZATION_ENABLED:\n        return this.option_histogram_equalization_enabled;\n      case this.OPTION_MIN_DISTANCE:\n        return this.option_min_distance;\n      case this.OPTION_MAX_DISTANCE:\n        return this.option_max_distance;\n      case this.OPTION_TEXTURE_SOURCE:\n        return this.option_texture_source;\n      case this.OPTION_FILTER_MAGNITUDE:\n        return this.option_filter_magnitude;\n      case this.OPTION_FILTER_SMOOTH_ALPHA:\n        return this.option_filter_smooth_alpha;\n      case this.OPTION_FILTER_SMOOTH_DELTA:\n        return this.option_filter_smooth_delta;\n      case this.OPTION_HOLES_FILL:\n        return this.option_holes_fill;\n      case this.OPTION_STEREO_BASELINE:\n        return this.option_stereo_baseline;\n      case this.OPTION_AUTO_EXPOSURE_CONVERGE_STEP:\n        return this.option_auto_exposure_converge_step;\n      case this.OPTION_INTER_CAM_SYNC_MODE:\n        return this.option_inter_cam_sync_mode;\n      default:\n        throw new TypeError(\n            'option.optionToString(option) expects a valid value as the 1st argument');\n    }\n  },\n};\n\n/**\n * Enum for camera info types\n * @readonly\n * @enum {String}\n * @see [Device.supportsCameraInfo()]{@link Device#supportsCameraInfo}\n */\nconst camera_info = {\n  /**\n   * String literal of <code>'name'</code>. <br>Device friendly name. <br>Equivalent to its\n   * uppercase counterpart.\n   *\n   */\n  camera_info_name: 'name',\n  /**\n   * String literal of <code>'serial-number'</code>. <br>Serial number. <br>Equivalent to its\n   * uppercase counterpart.\n   *\n   */\n  camera_info_serial_number: 'serial-number',\n  /**\n   * String literal of <code>'firmware-version'</code>. <br>Primary firmware version.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  camera_info_firmware_version: 'firmware-version',\n  /**\n   * String literal of <code>'recommended-firmware-version'</code>. <br>Latest firmware version\n   * available. <br>Equivalent to its uppercase counterpart.\n   */\n  camera_info_recommended_firmware_version: 'recommended-firmware-version',\n  /**\n   * String literal of <code>'port'</code>. <br>Unique identifier of the port the device is\n   * connected to (platform specific). <br>Equivalent to its uppercase counterpart.\n   *\n   */\n  camera_info_physical_port: 'physical-port',\n  /**\n   * String literal of <code>'debug-op-code'</code>. <br>If device supports firmware logging,\n   * this is the command to send to get logs from firmware. <br>Equivalent to its uppercase\n   * counterpart.\n   */\n  camera_info_debug_op_code: 'debug-op-code',\n  /**\n   * String literal of <code>'advanced-mode'</code>. <br>True iff the device is in advanced\n   * mode. <br>Equivalent to its uppercase counterpart.\n   *\n   */\n  camera_info_advanced_mode: 'advanced-mode',\n  /**\n   * String literal of <code>'product-id'</code>. <br>Product ID as reported in the USB\n   * descriptor. <br>Equivalent to its uppercase counterpart.\n   *\n   */\n  camera_info_product_id: 'product-id',\n  /**\n   * String literal of <code>'camera-locked'</code>. <br>True if EEPROM is locked.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  camera_info_camera_locked: 'camera-locked',\n  /**\n   * String literal of <code>'usb-type-descriptor'</code>. <br>Designated USB specification:\n   * USB2/USB3. <br>Equivalent to its uppercase counterpart.\n   */\n  camera_info_usb_type_descriptor: 'usb-type-descriptor',\n  /**\n   * Device friendly name. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_NAME: RS2.RS2_CAMERA_INFO_NAME,\n  /**\n   * Device serial number. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_SERIAL_NUMBER: RS2.RS2_CAMERA_INFO_SERIAL_NUMBER,\n  /**\n   * Primary firmware version. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_FIRMWARE_VERSION: RS2.RS2_CAMERA_INFO_FIRMWARE_VERSION,\n  /**\n   * Latest firmware version available. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION: RS2.RS2_CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION,\n  /**\n   * Unique identifier of the port the device is connected to (platform specific). <br>Equivalent to\n   * its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_PHYSICAL_PORT: RS2.RS2_CAMERA_INFO_PHYSICAL_PORT,\n  /**\n   * If device supports firmware logging, this is the command to send to get logs from firmware.\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_DEBUG_OP_CODE: RS2.RS2_CAMERA_INFO_DEBUG_OP_CODE,\n  /**\n   * True iff the device is in advanced mode. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_ADVANCED_MODE: RS2.RS2_CAMERA_INFO_ADVANCED_MODE,\n  /**\n   * Product ID as reported in the USB descriptor. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_PRODUCT_ID: RS2.RS2_CAMERA_INFO_PRODUCT_ID,\n  /**\n   * True if EEPROM is locked. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_CAMERA_LOCKED: RS2.RS2_CAMERA_INFO_CAMERA_LOCKED,\n  /**\n   * Designated USB specification: USB2/USB3. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  CAMERA_INFO_USB_TYPE_DESCRIPTOR: RS2.RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  CAMERA_INFO_COUNT: RS2.RS2_CAMERA_INFO_COUNT,\n\n  /**\n   * Get the string representation out of the integer camera_info type\n   * @param {Integer} info the camera_info type\n   * @return {String}\n   */\n  cameraInfoToString: function(info) {\n    const funcName = 'camera_info.cameraInfoToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.camera_info, 0, funcName);\n    switch (i) {\n      case this.CAMERA_INFO_NAME:\n        return this.camera_info_name;\n      case this.CAMERA_INFO_SERIAL_NUMBER:\n        return this.camera_info_serial_number;\n      case this.CAMERA_INFO_FIRMWARE_VERSION:\n        return this.camera_info_firmware_version;\n      case this.CAMERA_INFO_PHYSICAL_PORT:\n        return this.camera_info_physical_port;\n      case this.CAMERA_INFO_DEBUG_OP_CODE:\n        return this.camera_info_debug_op_code;\n      case this.CAMERA_INFO_ADVANCED_MODE:\n        return this.camera_info_advanced_mode;\n      case this.CAMERA_INFO_PRODUCT_ID:\n        return this.camera_info_product_id;\n      case this.CAMERA_INFO_CAMERA_LOCKED:\n        return this.camera_info_camera_locked;\n      case this.CAMERA_INFO_USB_TYPE_DESCRIPTOR:\n        return this.camera_info_usb_type_descriptor;\n      case this.CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION:\n        return this.camera_info_recommended_firmware_version;\n    }\n  },\n};\n\n/**\n * Enum for frame metadata types\n * @readonly\n * @enum {String}\n * @see [Frame.supportsFrameMetadata()]{@link Frame#supportsFrameMetadata}\n */\nconst frame_metadata = {\n  /**\n   * String literal of <code>'frame-counter'</code>. <br>A sequential index managed\n   * per-stream. Integer value <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_frame_counter: 'frame-counter',\n  /**\n   * String literal of <code>'frame-timestamp'</code>. <br>Timestamp set by device\n   * clock when data readout and transmit commence. usec <br>Equivalent to its uppercase\n   * counterpart\n   */\n  frame_metadata_frame_timestamp: 'frame-timestamp',\n  /**\n   * String literal of <code>'sensor-timestamp'</code>. <br>Timestamp of the middle\n   * of sensor's exposure calculated by device. usec <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_sensor_timestamp: 'sensor-timestamp',\n  /**\n   * String literal of <code>'actual-exposure'</code>. <br>Sensor's exposure width.\n   * When Auto Exposure (AE) is on the value is controlled by firmware. usec <br>Equivalent to\n   * its uppercase counterpart\n   */\n  frame_metadata_actual_exposure: 'actual-exposure',\n  /**\n   * String literal of <code>'gain-level'</code>. <br>A relative value increasing\n   * which will increase the Sensor's gain factor. When AE is set On, the value is controlled by\n   * firmware. Integer value <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_gain_level: 'gain-level',\n  /**\n   * String literal of <code>'auto-exposure'</code>. <br>Auto Exposure Mode\n   * indicator. Zero corresponds to AE switched off.  <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_auto_exposure: 'auto-exposure',\n  /**\n   * String literal of <code>'white-balance'</code>. <br>White Balance setting as a\n   * color temperature. Kelvin degrees <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_white_balance: 'white-balance',\n  /**\n   * String literal of <code>'time-of-arrival'</code>. <br>Time of arrival in\n   * system clock  <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_time_of_arrival: 'time-of-arrival',\n  /**\n   * Temperature of the device, measured at the time of the frame capture. Celsius degrees\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_temperature: 'temperature',\n  /**\n   * Timestamp get from uvc driver. usec\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_backend_timestamp: 'backend-timestamp',\n  /**\n   * Actual fps\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_actual_fps: 'actual-fps',\n  /**\n   * Laser power value 0-360.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_frame_laser_power: 'frame-laser-power',\n  /**\n   * Laser power mode. Zero corresponds to Laser power switched off and one for switched on.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_frame_laser_power_mode: 'frame-laser-power-mode',\n  /**\n   * Exposure priority.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_exposure_priority: 'exposure-priority',\n  /**\n   * Left region of interest for the auto exposure Algorithm.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_exposure_roi_left: 'exposure-roi-left',\n  /**\n   * Right region of interest for the auto exposure Algorithm.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_exposure_roi_right: 'exposure-roi-right',\n  /**\n   * Top region of interest for the auto exposure Algorithm.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_exposure_roi_top: 'exposure-roi-top',\n  /**\n   * Bottom region of interest for the auto exposure Algorithm.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_exposure_roi_bottom: 'exposure-roi-bottom',\n  /**\n   * Color image brightness.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_brightness: 'brightness',\n  /**\n   * Color image contrast.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_contrast: 'contrast',\n  /**\n   * Color image saturation.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_saturation: 'saturation',\n  /**\n   * Color image sharpness.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_sharpness: 'sharpness',\n  /**\n   * Auto white balance temperature Mode indicator. Zero corresponds to automatic mode switched off.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_auto_white_balance_temperature: 'auto-white-balance-temperature',\n  /**\n   * Color backlight compensation. Zero corresponds to switched off.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_backlight_compensation: 'backlight-compensation',\n  /**\n   * Color image hue.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_hue: 'hue',\n  /**\n   * Color image gamma.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_gamma: 'gamma',\n  /**\n   * Color image white balance.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_manual_white_balance: 'manual-white-balance',\n  /**\n   * Power Line Frequency for anti-flickering Off/50Hz/60Hz/Auto.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_power_line_frequency: 'power-line-frequency',\n  /**\n   * Color lowlight compensation. Zero corresponds to switched off.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  frame_metadata_low_light_compensation: 'low-light-compensation',\n  /**\n   * A sequential index managed per-stream. Integer value <br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  FRAME_METADATA_FRAME_COUNTER: RS2.RS2_FRAME_METADATA_FRAME_COUNTER,\n  /**\n   * Timestamp set by device clock when data readout and transmit commence. usec <br>Equivalent\n   * to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FRAME_METADATA_FRAME_TIMESTAMP: RS2.RS2_FRAME_METADATA_FRAME_TIMESTAMP,\n  /**\n   * Timestamp of the middle of sensor's exposure calculated by device. usec <br>Equivalent to\n   * its lowercase counterpart.\n   * @type {Integer}\n   */\n  FRAME_METADATA_SENSOR_TIMESTAMP: RS2.RS2_FRAME_METADATA_SENSOR_TIMESTAMP,\n  /**\n   * Sensor's exposure width. When Auto Exposure (AE) is on the value is controlled by\n   * firmware. usec <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FRAME_METADATA_ACTUAL_EXPOSURE: RS2.RS2_FRAME_METADATA_ACTUAL_EXPOSURE,\n  /**\n   * A relative value increasing which will increase the Sensor's gain factor. When AE is set\n   * On, the value is controlled by firmware. Integer value <br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  FRAME_METADATA_GAIN_LEVEL: RS2.RS2_FRAME_METADATA_GAIN_LEVEL,\n  /**\n   * Auto Exposure Mode indicator. Zero corresponds to AE switched off.  <br>Equivalent to its\n   * lowercase counterpart.\n   * @type {Integer}\n   */\n  FRAME_METADATA_AUTO_EXPOSURE: RS2.RS2_FRAME_METADATA_AUTO_EXPOSURE,\n  /**\n   * White Balance setting as a color temperature. Kelvin degrees <br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  FRAME_METADATA_WHITE_BALANCE: RS2.RS2_FRAME_METADATA_WHITE_BALANCE,\n  /**\n   * Time of arrival in system clock  <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  FRAME_METADATA_TIME_OF_ARRIVAL: RS2.RS2_FRAME_METADATA_TIME_OF_ARRIVAL,\n  /**\n   * Temperature of the device, measured at the time of the frame capture. Celsius degrees\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_TEMPERATURE: RS2.RS2_FRAME_METADATA_TEMPERATURE,\n  /**\n  * Timestamp get from uvc driver. usec\n  * <br>Equivalent to its lowercase counterpart\n  * @type {Integer}\n  */\n  FRAME_METADATA_BACKEND_TIMESTAMP: RS2.RS2_FRAME_METADATA_BACKEND_TIMESTAMP,\n  /**\n  * Actual fps\n  * <br>Equivalent to its lowercase counterpart\n  * @type {Integer}\n  */\n  FRAME_METADATA_ACTUAL_FPS: RS2.RS2_FRAME_METADATA_ACTUAL_FPS,\n  /**\n   * Laser power value 0-360.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_FRAME_LASER_POWER: RS2.RS2_FRAME_METADATA_FRAME_LASER_POWER,\n  /**\n   * Laser power mode. Zero corresponds to Laser power switched off and one for switched on.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_FRAME_LASER_POWER_MODE: RS2.RS2_FRAME_METADATA_FRAME_LASER_POWER_MODE,\n  /**\n   * Exposure priority.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_EXPOSURE_PRIORITY: RS2.RS2_FRAME_METADATA_EXPOSURE_PRIORITY,\n  /**\n   * Left region of interest for the auto exposure Algorithm.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_EXPOSURE_ROI_LEFT: RS2.RS2_FRAME_METADATA_EXPOSURE_ROI_LEFT,\n  /**\n   * Right region of interest for the auto exposure Algorithm.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_EXPOSURE_ROI_RIGHT: RS2.RS2_FRAME_METADATA_EXPOSURE_ROI_RIGHT,\n  /**\n   * Top region of interest for the auto exposure Algorithm.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_EXPOSURE_ROI_TOP: RS2.RS2_FRAME_METADATA_EXPOSURE_ROI_TOP,\n  /**\n   * Bottom region of interest for the auto exposure Algorithm.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_EXPOSURE_ROI_BOTTOM: RS2.RS2_FRAME_METADATA_EXPOSURE_ROI_BOTTOM,\n  /**\n   * Color image brightness.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_BRIGHTNESS: RS2.RS2_FRAME_METADATA_BRIGHTNESS,\n  /**\n   * Color image contrast.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_CONTRAST: RS2.RS2_FRAME_METADATA_CONTRAST,\n  /**\n   * Color image saturation.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_SATURATION: RS2.RS2_FRAME_METADATA_SATURATION,\n  /**\n   * Color image sharpness.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_SHARPNESS: RS2.RS2_FRAME_METADATA_SHARPNESS,\n  /**\n   * Auto white balance temperature Mode indicator. Zero corresponds to automatic mode switched off.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_AUTO_WHITE_BALANCE_TEMPERATURE:\n      RS2.RS2_FRAME_METADATA_AUTO_WHITE_BALANCE_TEMPERATURE,\n  /**\n   * Color backlight compensation. Zero corresponds to switched off.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_BACKLIGHT_COMPENSATION: RS2.RS2_FRAME_METADATA_BACKLIGHT_COMPENSATION,\n  /**\n   * Color image hue.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_HUE: RS2.RS2_FRAME_METADATA_HUE,\n  /**\n   * Color image gamma.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_GAMMA: RS2.RS2_FRAME_METADATA_GAMMA,\n  /**\n   * Color image white balance.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_MANUAL_WHITE_BALANCE: RS2.RS2_FRAME_METADATA_MANUAL_WHITE_BALANCE,\n  /**\n   * Power Line Frequency for anti-flickering Off/50Hz/60Hz/Auto.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_POWER_LINE_FREQUENCY: RS2.RS2_FRAME_METADATA_POWER_LINE_FREQUENCY,\n  /**\n   * Color lowlight compensation. Zero corresponds to switched off.\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  FRAME_METADATA_LOW_LIGHT_COMPENSATION: RS2.RS2_FRAME_METADATA_LOW_LIGHT_COMPENSATION,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  FRAME_METADATA_COUNT: RS2.RS2_FRAME_METADATA_COUNT,\n\n  /**\n   * Get the string representation out of the integer frame metadata type\n   * @param {Integer} metadata the frame metadata type\n   * @return {String}\n   */\n  frameMetadataToString: function(metadata) {\n    const funcName = 'frame_metadata.frameMetadataToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.frame_metadata, 0, funcName);\n    switch (i) {\n      case this.FRAME_METADATA_FRAME_COUNTER:\n        return this.frame_metadata_frame_counter;\n      case this.FRAME_METADATA_FRAME_TIMESTAMP:\n        return this.frame_metadata_frame_timestamp;\n      case this.FRAME_METADATA_SENSOR_TIMESTAMP:\n        return this.frame_metadata_sensor_timestamp;\n      case this.FRAME_METADATA_ACTUAL_EXPOSURE:\n        return this.frame_metadata_actual_exposure;\n      case this.FRAME_METADATA_GAIN_LEVEL:\n        return this.frame_metadata_gain_level;\n      case this.FRAME_METADATA_AUTO_EXPOSURE:\n        return this.frame_metadata_auto_exposure;\n      case this.FRAME_METADATA_WHITE_BALANCE:\n        return this.frame_metadata_white_balance;\n      case this.FRAME_METADATA_TIME_OF_ARRIVAL:\n        return this.frame_metadata_time_of_arrival;\n      case this.FRAME_METADATA_TEMPERATURE:\n        return this.frame_metadata_temperature;\n      case this.FRAME_METADATA_BACKEND_TIMESTAMP:\n        return this.frame_metadata_backend_timestamp;\n      case this.FRAME_METADATA_ACTUAL_FPS:\n        return this.frame_metadata_actual_fps;\n      case this.FRAME_METADATA_FRAME_LASER_POWER:\n        return this.frame_metadata_frame_laser_power;\n      case this.FRAME_METADATA_FRAME_LASER_POWER_MODE:\n        return this.frame_metadata_frame_laser_power_mode;\n      case this.FRAME_METADATA_EXPOSURE_PRIORITY:\n        return this.frame_metadata_exposure_priority;\n      case this.FRAME_METADATA_EXPOSURE_ROI_LEFT:\n        return this.frame_metadata_exposure_roi_left;\n      case this.FRAME_METADATA_EXPOSURE_ROI_RIGHT:\n        return this.frame_metadata_exposure_roi_right;\n      case this.FRAME_METADATA_EXPOSURE_ROI_TOP:\n        return this.frame_metadata_exposure_roi_top;\n      case this.FRAME_METADATA_EXPOSURE_ROI_BOTTOM:\n        return this.frame_metadata_exposure_roi_bottom;\n      case this.FRAME_METADATA_BRIGHTNESS:\n        return this.frame_metadata_brightness;\n      case this.FRAME_METADATA_CONTRAST:\n        return this.frame_metadata_contrast;\n      case this.FRAME_METADATA_SATURATION:\n        return this.frame_metadata_saturation;\n      case this.FRAME_METADATA_SHARPNESS:\n        return this.frame_metadata_sharpness;\n      case this.FRAME_METADATA_AUTO_WHITE_BALANCE_TEMPERATURE:\n        return this.frame_metadata_auto_white_balance_temperature;\n      case this.FRAME_METADATA_BACKLIGHT_COMPENSATION:\n        return this.frame_metadata_backlight_compensation;\n      case this.FRAME_METADATA_HUE:\n        return this.frame_metadata_hue;\n      case this.FRAME_METADATA_GAMMA:\n        return this.frame_metadata_gamma;\n      case this.FRAME_METADATA_MANUAL_WHITE_BALANCE:\n        return this.frame_metadata_manual_white_balance;\n      case this.FRAME_METADATA_POWER_LINE_FREQUENCY:\n        return this.frame_metadata_power_line_frequency;\n      case this.FRAME_METADATA_LOW_LIGHT_COMPENSATION:\n        return this.frame_metadata_low_light_compensation;\n    }\n  },\n};\n\n/**\n * Enum for distortion types\n * @readonly\n * @enum {String}\n */\nconst distortion = {\n  /**\n   * String literal of <code>'none'</code>. <br>Rectilinear images. No distortion compensation\n   * required. <br> Equivalent to its uppercase counterpart.\n   */\n  distortion_none: 'none',\n  /**\n   * String literal of <code>'modified-brown-conrady'</code>. <br>Equivalent to Brown-Conrady\n   * distortion, except that tangential distortion is applied to radially distorted points\n   * <br> Equivalent to its uppercase counterpart.\n   */\n  distortion_modified_brown_conrady: 'modified-brown-conrady',\n  /**\n   * String literal of <code>'inverse-brown-conrady'</code>. <br>Equivalent to Brown-Conrady\n   * distortion, except undistorts image instead of distorting it\n   * <br> Equivalent to its uppercase counterpart.\n   */\n  distortion_inverse_brown_conrady: 'inverse-brown-conrady',\n  /**\n   * String literal of <code>'ftheta'</code>. <br>F-Theta fish-eye distortion model\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  distortion_ftheta: 'ftheta',\n  /**\n   * String literal of <code>'brown-conrady'</code>. <br>Unmodified Brown-Conrady distortion\n   * model <br> Equivalent to its uppercase counterpart.\n   */\n  distortion_brown_conrady: 'brown-conrady',\n\n  /** Rectilinear images. No distortion compensation required. <br>Equivalent to its lowercase\n   * counterpart\n   * @type {Integer}\n   */\n  DISTORTION_NONE: RS2.RS2_DISTORTION_NONE,\n  /** Equivalent to Brown-Conrady distortion, except that tangential distortion is applied to\n   * radially distorted points <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  DISTORTION_MODIFIED_BROWN_CONRADY: RS2.RS2_DISTORTION_MODIFIED_BROWN_CONRADY,\n  /** Equivalent to Brown-Conrady distortion, except undistorts image instead of distorting it\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  DISTORTION_INVERSE_BROWN_CONRADY: RS2.RS2_DISTORTION_INVERSE_BROWN_CONRADY,\n  /** F-Theta fish-eye distortion model <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  DISTORTION_FTHETA: RS2.RS2_DISTORTION_FTHETA,\n  /** Unmodified Brown-Conrady distortion model <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  DISTORTION_BROWN_CONRADY: RS2.RS2_DISTORTION_BROWN_CONRADY,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  DISTORTION_COUNT: RS2.RS2_DISTORTION_COUNT,\n\n  /**\n   * Get the string representation out of the integer distortion type\n   * @param {Integer} distortionVal the distortion type\n   * @return {String}\n   */\n  distortionToString: function(distortionVal) {\n    const funcName = 'distortion.distortionToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.distortion, 0, funcName);\n    switch (i) {\n      case this.DISTORTION_NONE:\n        return this.distortion_none;\n      case this.DISTORTION_MODIFIED_BROWN_CONRADY:\n        return this.distortion_modified_brown_conrady;\n      case this.DISTORTION_INVERSE_BROWN_CONRADY:\n        return this.distortion_inverse_brown_conrady;\n      case this.DISTORTION_FTHETA:\n        return this.distortion_ftheta;\n      case this.DISTORTION_BROWN_CONRADY:\n        return this.distortion_brown_conrady;\n    }\n  },\n};\n\n/**\n * Enum for notification severity\n * @readonly\n * @enum {String}\n */\nconst log_severity = {\n  /**\n   * String literal of <code>'debug'</code>. <br>Detailed information about ordinary operations.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  log_severity_debug: 'debug',\n  /**\n   * String literal of <code>'info'</code>. <br>Terse information about ordinary operations.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  log_severity_info: 'info',\n  /**\n   * String literal of <code>'warn'</code>. <br>Indication of possible failure.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  log_severity_warn: 'warn',\n  /**\n   * String literal of <code>'error'</code>. <br>Indication of definite failure.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  log_severity_error: 'error',\n  /**\n   * String literal of <code>'fatal'</code>. <br>Indication of unrecoverable failure.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  log_severity_fatal: 'fatal',\n  /**\n   * String literal of <code>'none'</code>. <br>No logging will occur.\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  log_severity_none: 'none',\n\n  /**\n   * Detailed information about ordinary operations. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  LOG_SEVERITY_DEBUG: RS2.RS2_LOG_SEVERITY_DEBUG,\n  /**\n   * Terse information about ordinary operations. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  LOG_SEVERITY_INFO: RS2.RS2_LOG_SEVERITY_INFO,\n  /**\n   * Indication of possible failure. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  LOG_SEVERITY_WARN: RS2.RS2_LOG_SEVERITY_WARN,\n  /**\n   * Indication of definite failure. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  LOG_SEVERITY_ERROR: RS2.RS2_LOG_SEVERITY_ERROR,\n  /**\n   * Indication of unrecoverable failure. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  LOG_SEVERITY_FATAL: RS2.RS2_LOG_SEVERITY_FATAL,\n  /**\n   * No logging will occur. <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  LOG_SEVERITY_NONE: RS2.RS2_LOG_SEVERITY_NONE,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  LOG_SEVERITY_COUNT: RS2.RS2_LOG_SEVERITY_COUNT,\n  /**\n   * Get the string representation out of the integer log_severity type\n   * @param {Integer} severity the log_severity value\n   * @return {String}\n   */\n  logSeverityToString: function(severity) {\n    const funcName = 'log_severity.logSeverityToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.log_severity, 0, funcName);\n    switch (i) {\n      case this.LOG_SEVERITY_DEBUG:\n        return this.log_severity_debug;\n      case this.LOG_SEVERITY_INFO:\n        return this.log_severity_info;\n      case this.LOG_SEVERITY_WARN:\n        return this.log_severity_warn;\n      case this.LOG_SEVERITY_ERROR:\n        return this.log_severity_error;\n      case this.LOG_SEVERITY_FATAL:\n        return this.log_severity_fatal;\n      case this.LOG_SEVERITY_NONE:\n        return this.log_severity_none;\n    }\n  },\n};\n\n/**\n * Enum for notification category\n * @readonly\n * @enum {String}\n */\nconst notification_category = {\n  /**\n   * String literal of <code>'frames-timeout'</code>. <br>Frames didn't arrived within 5 seconds\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  notification_category_frames_timeout: 'frames-timeout',\n  /**\n   * String literal of <code>'frame-corrupted'</code>. <br>Received partial/incomplete frame\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  notification_category_frame_corrupted: 'frame-corrupted',\n  /**\n   * String literal of <code>'hardware-error'</code>. <br>Error reported from the device\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  notification_category_hardware_error: 'hardware-error',\n  /**\n   * String literal of <code>'hardware-event'</code>. <br>General hardware notification reported\n   * from the sensor <br>Equivalent to its uppercase counterpart.\n   */\n  notification_category_hardware_event: 'hardware-event',\n  /**\n   * String literal of <code>'unknown-error'</code>. <br>Received unknown error from the device\n   * <br>Equivalent to its uppercase counterpart.\n   */\n  notification_category_unknown_error: 'unknown-error',\n  /**\n   * String literal of <code>'firmware-update-recommended'</code>. <br>Current firmware version\n   * installed is not the latest available. <br>Equivalent to its uppercase counterpart.\n   */\n  notification_category_firmware_update_recommended: 'firmware-update-recommended',\n  /**\n   * Frames didn't arrived within 5 seconds <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  NOTIFICATION_CATEGORY_FRAMES_TIMEOUT: RS2.RS2_NOTIFICATION_CATEGORY_FRAMES_TIMEOUT,\n  /**\n   * Received partial/incomplete frame <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  NOTIFICATION_CATEGORY_FRAME_CORRUPTED: RS2.RS2_NOTIFICATION_CATEGORY_FRAME_CORRUPTED,\n  /**\n   * Error reported from the device <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  NOTIFICATION_CATEGORY_HARDWARE_ERROR: RS2.RS2_NOTIFICATION_CATEGORY_HARDWARE_ERROR,\n  /**\n   * General hardware notification reported from the sensor <br>Equivalent to its lowercase\n   * counterpart\n   * @type {Integer}\n   */\n  NOTIFICATION_CATEGORY_HARDWARE_EVENT: RS2.RS2_NOTIFICATION_CATEGORY_HARDWARE_EVENT,\n  /**\n   * Received unknown error from the device <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  NOTIFICATION_CATEGORY_UNKNOWN_ERROR: RS2.RS2_NOTIFICATION_CATEGORY_UNKNOWN_ERROR,\n  /**\n   * Current firmware version installed is not the latest available <br>Equivalent to its lowercase\n   * counterpart\n   * @type {Integer}\n   */\n  NOTIFICATION_CATEGORY_FIRMWARE_UPDATE_RECOMMENDED:\n      RS2.RS2_NOTIFICATION_CATEGORY_FIRMWARE_UPDATE_RECOMMENDED,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  NOTIFICATION_CATEGORY_COUNT: RS2.RS2_NOTIFICATION_CATEGORY_COUNT,\n  /**\n   * Get the string representation out of the integer notification_category type\n   * @param {Integer} notification the notification_category type\n   * @return {String}\n   */\n  notificationCategoryToString: function(notification) {\n    const funcName = 'notification_category.notificationCategoryToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.notification_category, 0, funcName);\n    switch (i) {\n      case this.NOTIFICATION_CATEGORY_FRAMES_TIMEOUT:\n        return this.notification_category_frames_timeout;\n      case this.NOTIFICATION_CATEGORY_FRAME_CORRUPTED:\n        return this.notification_category_frame_corrupted;\n      case this.NOTIFICATION_CATEGORY_HARDWARE_ERROR:\n        return this.notification_category_hardware_error;\n      case this.NOTIFICATION_CATEGORY_HARDWARE_EVENT:\n        return this.notification_category_hardware_event;\n      case this.NOTIFICATION_CATEGORY_UNKNOWN_ERROR:\n        return this.notification_category_unknown_error;\n      case this.NOTIFICATION_CATEGORY_FIRMWARE_UPDATE_RECOMMENDED:\n        return this.notification_category_firmware_update_recommended;\n    }\n  },\n};\n\n/**\n * Enum for timestamp domain.\n * @readonly\n * @enum {String}\n */\nconst timestamp_domain = {\n  /**\n   * String literal of <code>'hardware-clock'</code>. <br>Frame timestamp was measured in\n   * relation to the camera clock <br>Equivalent to its uppercase counterpart.\n   */\n  timestamp_domain_hardware_clock: 'hardware-clock',\n  /**\n   * String literal of <code>'system-time'</code>. <br>Frame timestamp was measured in relation\n   * to the OS system clock <br>Equivalent to its uppercase counterpart.\n   */\n  timestamp_domain_system_time: 'system-time',\n\n  /**\n   * Frame timestamp was measured in relation to the camera clock <br>Equivalent to its lowercase\n   * counterpart.\n   * @type {Integer}\n   */\n  TIMESTAMP_DOMAIN_HARDWARE_CLOCK: RS2.RS2_TIMESTAMP_DOMAIN_HARDWARE_CLOCK,\n  /**\n   * Frame timestamp was measured in relation to the OS system clock <br>Equivalent to its\n   * lowercase counterpart.\n   * @type {Integer}\n   */\n  TIMESTAMP_DOMAIN_SYSTEM_TIME: RS2.RS2_TIMESTAMP_DOMAIN_SYSTEM_TIME,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  TIMESTAMP_DOMAIN_COUNT: RS2.RS2_TIMESTAMP_DOMAIN_COUNT,\n  /**\n   * Get the string representation out of the integer timestamp_domain type\n   * @param {Integer} domainVal the timestamp_domain type\n   * @return {String}\n   */\n  timestampDomainToString: function(domainVal) {\n    const funcName = 'timestamp_domain.timestampDomainToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.timestamp_domain, 0, funcName);\n    switch (i) {\n      case this.TIMESTAMP_DOMAIN_HARDWARE_CLOCK:\n        return this.timestamp_domain_hardware_clock;\n      case this.TIMESTAMP_DOMAIN_SYSTEM_TIME:\n        return this.timestamp_domain_system_time;\n      default:\n        throw new TypeError('timestamp_domain.timestampDomainToString() expects a valid value as the 1st argument'); // eslint-disable-line\n    }\n  },\n};\n\n/**\n * Enum for visual preset of SR300 devices: provides optimized settings (presets) for specific\n * types of usage.\n * @readonly\n * @enum {String}\n */\nconst sr300_visual_preset = {\n  /**\n   * String literal of <code>'short-range'</code>. <br>Preset for short range.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_short_range: 'short-range',\n  /**\n   * String literal of <code>'long-range'</code>. <br>Preset for long range.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_long_range: 'long-range',\n  /**\n   * String literal of <code>'background-segmentation'</code>. <br>Preset for background\n   * segmentation.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_background_segmentation: 'background-segmentation',\n  /**\n   * String literal of <code>'gesture-recognition'</code>. <br>Preset for gesture recognition.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_gesture_recognition: 'gesture-recognition',\n  /**\n   * String literal of <code>'object-scanning'</code>. <br>Preset for object scanning.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_object_scanning: 'object-scanning',\n  /**\n   * String literal of <code>'face-analytics'</code>. <br>Preset for face analytics.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_face_analytics: 'face-analytics',\n  /**\n   * String literal of <code>'face-login'</code>. <br>Preset for face login.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_face_login: 'face-login',\n  /**\n   * String literal of <code>'gr-cursor'</code>. <br>Preset for GR cursor.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_gr_cursor: 'gr-cursor',\n  /**\n   * String literal of <code>'default'</code>. <br>Preset for default.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_default: 'default',\n  /**\n   * String literal of <code>'mid-range'</code>. <br>Preset for mid-range.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_mid_range: 'mid-range',\n  /**\n   * String literal of <code>'ir-only'</code>. <br>Preset for IR only.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  sr300_visual_preset_ir_only: 'ir-only',\n\n  /**\n   * Preset for short range\n   * <br> Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_SHORT_RANGE: RS2.RS2_SR300_VISUAL_PRESET_SHORT_RANGE,\n  /**\n   * Preset for long range\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_LONG_RANGE: RS2.RS2_SR300_VISUAL_PRESET_LONG_RANGE,\n  /**\n   * Preset for background segmentation\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_BACKGROUND_SEGMENTATION: RS2.RS2_SR300_VISUAL_PRESET_BACKGROUND_SEGMENTATION,\n  /**\n   * Preset for gesture recognition\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_GESTURE_RECOGNITION: RS2.RS2_SR300_VISUAL_PRESET_GESTURE_RECOGNITION,\n  /**\n   * Preset for object scanning\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_OBJECT_SCANNING: RS2.RS2_SR300_VISUAL_PRESET_OBJECT_SCANNING,\n  /**\n   * Preset for face analytics\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_FACE_ANALYTICS: RS2.RS2_SR300_VISUAL_PRESET_FACE_ANALYTICS,\n  /**\n   * Preset for face login\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_FACE_LOGIN: RS2.RS2_SR300_VISUAL_PRESET_FACE_LOGIN,\n  /**\n   * Preset for GR cursor\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_GR_CURSOR: RS2.RS2_SR300_VISUAL_PRESET_GR_CURSOR,\n  /**\n   * Preset for default\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_DEFAULT: RS2.RS2_SR300_VISUAL_PRESET_DEFAULT,\n  /**\n   * Preset for mid-range\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_MID_RANGE: RS2.RS2_SR300_VISUAL_PRESET_MID_RANGE,\n  /**\n   * Preset for IR only\n   * <br>Equivalent to its lowercase counterpart.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_IR_ONLY: RS2.RS2_SR300_VISUAL_PRESET_IR_ONLY,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  SR300_VISUAL_PRESET_COUNT: RS2.RS2_SR300_VISUAL_PRESET_COUNT,\n  /**\n   * Get the string representation out of the integer sr300_visual_preset type\n   * @param {Integer} preset the sr300_visual_preset type\n   * @return {String}\n   */\n  sr300VisualPresetToString: function(preset) {\n    const funcName = 'sr300_visual_preset.sr300VisualPresetToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.sr300_visual_preset, 0, funcName);\n    switch (i) {\n      case this.SR300_VISUAL_PRESET_SHORT_RANGE:\n        return this.sr300_visual_preset_short_range;\n      case this.SR300_VISUAL_PRESET_LONG_RANGE:\n        return this.sr300_visual_preset_long_range;\n      case this.SR300_VISUAL_PRESET_BACKGROUND_SEGMENTATION:\n        return this.sr300_visual_preset_background_segmentation;\n      case this.SR300_VISUAL_PRESET_GESTURE_RECOGNITION:\n        return this.sr300_visual_preset_gesture_recognition;\n      case this.SR300_VISUAL_PRESET_OBJECT_SCANNING:\n        return this.sr300_visual_preset_object_scanning;\n      case this.SR300_VISUAL_PRESET_FACE_ANALYTICS:\n        return this.sr300_visual_preset_face_analytics;\n      case this.SR300_VISUAL_PRESET_FACE_LOGIN:\n        return this.sr300_visual_preset_face_login;\n      case this.SR300_VISUAL_PRESET_GR_CURSOR:\n        return this.sr300_visual_preset_gr_cursor;\n      case this.SR300_VISUAL_PRESET_DEFAULT:\n        return this.sr300_visual_preset_default;\n      case this.SR300_VISUAL_PRESET_MID_RANGE:\n        return this.sr300_visual_preset_mid_range;\n      case this.SR300_VISUAL_PRESET_IR_ONLY:\n        return this.sr300_visual_preset_ir_only;\n    }\n  },\n};\n\n/**\n * Enum for visual preset of RS400 devices: provides optimized settings (presets) for specific\n * types of usage.\n * @readonly\n * @enum {String}\n */\nconst rs400_visual_preset = {\n  /**\n   * String literal of <code>'custom'</code>. <br>Preset for custom.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  rs400_visual_preset_custom: 'custom',\n  /**\n   * String literal of <code>'default'</code>. <br>Preset for default.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  rs400_visual_preset_default: 'default',\n  /**\n   * String literal of <code>'hand'</code>. <br>Preset for hand.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  rs400_visual_preset_hand: 'hand',\n  /**\n   * String literal of <code>'high-accuracy'</code>. <br>Preset for high-accuracy.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  rs400_visual_preset_high_accuracy: 'high-accuracy',\n  /**\n   * String literal of <code>'high-density'</code>. <br>Preset for high-density.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  rs400_visual_preset_high_density: 'high-density',\n  /**\n   * String literal of <code>'medium-density'</code>. <br>Preset for medium-density.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  rs400_visual_preset_medium_density: 'medium-density',\n  /**\n   * String literal of <code>'remove-ir-pattern'</code>. <br>Preset for remove-ir-pattern.\n   * <br>Equivalent to its uppercase counterpart\n   */\n  rs400_visual_preset_remove_ir_pattern: 'remove-ir-pattern',\n  /**\n   * Preset for custom\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  RS400_VISUAL_PRESET_CUSTOM: RS2.RS2_RS400_VISUAL_PRESET_CUSTOM,\n  /**\n   * Preset for default\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  RS400_VISUAL_PRESET_DEFAULT: RS2.RS2_RS400_VISUAL_PRESET_DEFAULT,\n  /**\n   * Preset for hand\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  RS400_VISUAL_PRESET_HAND: RS2.RS2_RS400_VISUAL_PRESET_HAND,\n  /**\n   * Preset for high_accuracy\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  RS400_VISUAL_PRESET_HIGH_ACCURACY: RS2.RS2_RS400_VISUAL_PRESET_HIGH_ACCURACY,\n  /**\n   * Preset for high-density\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  RS400_VISUAL_PRESET_HIGH_DENSITY: RS2.RS2_RS400_VISUAL_PRESET_HIGH_DENSITY,\n  /**\n   * Preset for medium-density\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  RS400_VISUAL_PRESET_MEDIUM_DENSITY: RS2.RS2_RS400_VISUAL_PRESET_MEDIUM_DENSITY,\n  /**\n   * Preset for remove-ir-pattern\n   * <br>Equivalent to its lowercase counterpart\n   * @type {Integer}\n   */\n  RS400_VISUAL_PRESET_REMOVE_IR_PATTERN: RS2.RS2_RS400_VISUAL_PRESET_REMOVE_IR_PATTERN,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  RS400_VISUAL_PRESET_COUNT: RS2.RS2_RS400_VISUAL_PRESET_COUNT,\n  /**\n   * Get the string representation out of the integer rs400_visual_preset type\n   * @param {Integer} preset the rs400_visual_preset type\n   * @return {String}\n   */\n  rs400VisualPresetToString: function(preset) {\n    const funcName = 'rs400_visual_preset.rs400VisualPresetToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.rs400_visual_preset, 0, funcName);\n    switch (i) {\n      case this.RS400_VISUAL_PRESET_CUSTOM:\n        return this.rs400_visual_preset_custom;\n      case this.RS400_VISUAL_PRESET_DEFAULT:\n        return this.rs400_visual_preset_default;\n      case this.RS400_VISUAL_PRESET_HAND:\n        return this.rs400_visual_preset_hand;\n      case this.RS400_VISUAL_PRESET_HIGH_ACCURACY:\n        return this.rs400_visual_preset_high_accuracy;\n      case this.RS400_VISUAL_PRESET_HIGH_DENSITY:\n        return this.rs400_visual_preset_high_density;\n      case this.RS400_VISUAL_PRESET_MEDIUM_DENSITY:\n        return this.rs400_visual_preset_medium_density;\n      case this.RS400_VISUAL_PRESET_REMOVE_IR_PATTERN:\n        return this.rs400_visual_preset_remove_ir_pattern;\n    }\n  },\n};\n\nconst playback_status = {\n  /**\n   * String literal of <code>'unknown'</code>. <br>Unknown state\n   * <br>Equivalent to its uppercase counterpart\n   */\n  playback_status_unknown: 'unknown',\n  /**\n   * String literal of <code>'playing'</code>. <br>One or more sensors were\n   * started, playback is reading and raising data\n   * <br>Equivalent to its uppercase counterpart\n   */\n  playback_status_playing: 'playing',\n  /**\n   * String literal of <code>'paused'</code>. <br>One or more sensors were\n   * started, but playback paused reading and paused raising data\n   * <br>Equivalent to its uppercase counterpart\n   */\n  playback_status_paused: 'paused',\n  /**\n   * String literal of <code>'stopped'</code>. <br>All sensors were stopped, or playback has\n   * ended (all data was read). This is the initial playback status\n   * <br>Equivalent to its uppercase counterpart\n   */\n  playback_status_stopped: 'stopped',\n  /**\n   * Unknown state\n   */\n  PLAYBACK_STATUS_UNKNOWN: RS2.RS2_PLAYBACK_STATUS_UNKNOWN,\n  /**\n   * One or more sensors were started, playback is reading and raising data\n   */\n  PLAYBACK_STATUS_PLAYING: RS2.RS2_PLAYBACK_STATUS_PLAYING,\n  /**\n   * One or more sensors were started, but playback paused reading and paused raising dat\n   */\n  PLAYBACK_STATUS_PAUSED: RS2.RS2_PLAYBACK_STATUS_PAUSED,\n  /**\n   * All sensors were stopped, or playback has ended (all data was read). This is the initial\n   * playback statu\n   */\n  PLAYBACK_STATUS_STOPPED: RS2.RS2_PLAYBACK_STATUS_STOPPED,\n  /**\n   * Number of enumeration values. Not a valid input: intended to be used in for-loops.\n   * @type {Integer}\n   */\n  PLAYBACK_STATUS_COUNT: RS2.RS2_PLAYBACK_STATUS_COUNT,\n  /**\n   * Get the string representation out of the integer playback_status type\n   * @param {Integer} status the playback_status type\n   * @return {String}\n   */\n  playbackStatusToString: function(status) {\n    const funcName = 'playback_status.playbackStatusToString()';\n    checkArgumentLength(1, 1, arguments.length, funcName);\n    const i = checkArgumentType(arguments, constants.playback_status, 0, funcName);\n    switch (i) {\n      case this.PLAYBACK_STATUS_UNKNOWN:\n        return this.playback_status_unknown;\n      case this.PLAYBACK_STATUS_PLAYING:\n        return this.playback_status_playing;\n      case this.PLAYBACK_STATUS_PAUSED:\n        return this.playback_status_paused;\n      case this.PLAYBACK_STATUS_STOPPED:\n        return this.playback_status_stopped;\n      default:\n        throw new TypeError('playback_status.playbackStatusToString() expects a valid value as the 1st argument'); // eslint-disable-line\n    }\n  },\n};\n\n// e.g. str2Int('enable_motion_correction', 'option')\nfunction str2Int(str, category) {\n  const name = 'RS2_' + category.toUpperCase() + '_' + str.toUpperCase().replace(/-/g, '_');\n  return RS2[name];\n}\n\nfunction stream2Int(str) {\n  return str2Int(str, 'stream');\n}\nfunction format2Int(str) {\n  return str2Int(str, 'format');\n}\nfunction option2Int(str) {\n  return str2Int(str, 'option');\n}\nfunction cameraInfo2Int(str) {\n  return str2Int(str, 'camera_info');\n}\nfunction recordingMode2Int(str) {\n  return str2Int(str, 'recording_mode');\n}\nfunction timestampDomain2Int(str) {\n  return str2Int(str, 'timestamp_domain');\n}\nfunction notificationCategory2Int(str) {\n  return str2Int(str, 'notification_category');\n}\nfunction logSeverity2Int(str) {\n  return str2Int(str, 'log_severity');\n}\nfunction distortion2Int(str) {\n  return str2Int(str, 'distortion');\n}\nfunction frameMetadata2Int(str) {\n  return str2Int(str, 'frame_metadata');\n}\nfunction sr300VisualPreset2Int(str) {\n  return str2Int(str, 'sr300_visual_preset');\n}\nfunction rs400VisualPreset2Int(str) {\n  return str2Int(str, 'rs400_visual_preset');\n}\nfunction playbackStatus2Int(str) {\n  return str2Int(str, 'playback_status');\n}\nfunction isArrayBuffer(value) {\n  return value && (value instanceof ArrayBuffer) && (value.byteLength !== undefined);\n}\n\nconst constants = {\n  stream: stream,\n  format: format,\n  option: option,\n  camera_info: camera_info,\n  recording_mode: recording_mode,\n  timestamp_domain: timestamp_domain,\n  notification_category: notification_category,\n  log_severity: log_severity,\n  distortion: distortion,\n  frame_metadata: frame_metadata,\n  sr300_visual_preset: sr300_visual_preset,\n  rs400_visual_preset: rs400_visual_preset,\n  playback_status: playback_status,\n};\n\n/**\n * Cleanup resources\n */\nfunction cleanup() {\n  internal.cleanup();\n  RS2.globalCleanup();\n}\n\n/**\n * Error Information returned from native SDK\n * @typedef {Object} ErrorInfoObject\n * @property {Boolean} recoverable - True if the error is a recoverable error\n * @property {String} description - Detailed description of the error\n * @property {String} nativeFunction - Native function that triggered the error\n * @see [getError()]{@link getError}\n */\n\n/**\n * Get the error info\n * User could call this method to get the detailed error info if the previous\n * API failed.\n * @return {ErrorInfoObject|undefined} If there is no error, undefined is returned\n */\nfunction getError() {\n  return RS2.getError();\n}\n\nmodule.exports = {\n  cleanup: cleanup,\n  getError: getError,\n  UnrecoverableError: UnrecoverableError,\n\n  Context: Context,\n  Pipeline: Pipeline,\n  PipelineProfile: PipelineProfile,\n  Config: Config,\n  Colorizer: Colorizer,\n  Device: Device,\n  Tm2: Tm2,\n  DeviceList: DeviceList,\n  DeviceHub: DeviceHub,\n  Sensor: Sensor,\n  DepthSensor: DepthSensor,\n  ROISensor: ROISensor,\n  StreamProfile: StreamProfile,\n  VideoStreamProfile: VideoStreamProfile,\n  MotionStreamProfile: MotionStreamProfile,\n  Frame: Frame,\n  FrameSet: FrameSet,\n  VideoFrame: VideoFrame,\n  DepthFrame: DepthFrame,\n  DisparityFrame: DisparityFrame,\n  MotionFrame: MotionFrame,\n  PoseFrame: PoseFrame,\n  Align: Align,\n  PointCloud: PointCloud,\n  Points: Points,\n  Syncer: Syncer,\n  RecorderDevice: RecorderDevice,\n  PlaybackDevice: PlaybackDevice,\n  DecimationFilter: DecimationFilter,\n  TemporalFilter: TemporalFilter,\n  SpatialFilter: SpatialFilter,\n  HoleFillingFilter: HoleFillingFilter,\n  DisparityToDepthTransform: DisparityToDepthTransform,\n  DepthToDisparityTransform: DepthToDisparityTransform,\n\n\n  stream: stream,\n  format: format,\n  option: option,\n  camera_info: camera_info,\n  recording_mode: recording_mode,\n  timestamp_domain: timestamp_domain,\n  notification_category: notification_category,\n  log_severity: log_severity,\n  distortion: distortion,\n  frame_metadata: frame_metadata,\n  sr300_visual_preset: sr300_visual_preset,\n  rs400_visual_preset: rs400_visual_preset,\n  playback_status: playback_status,\n\n  util: util,\n  internal: internal,\n\n  stringConstantToIntegerValue: str2Int,\n};\n\ninternal.registerErrorCallback();\n"]}