Skip to content

Commit

Permalink
[Node.js] Add new option and update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tingshao committed Jul 3, 2018
1 parent 75b0fc0 commit eeff969
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
23 changes: 20 additions & 3 deletions wrappers/nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3814,8 +3814,9 @@ const format = {
*/
format_xyz32f: 'xyz32f',
/**
* String literal of <code>'yuyv'</code>. <br>Standard YUV pixel format as described in
* https://en.wikipedia.org/wiki/YUV. <br>Equivalent to its uppercase counterpart.
* String literal of <code>'yuyv'</code>. <br>32-bit y0, u, y1, v data for every two pixels.
* Similar to YUV422 but packed in a different order - https://en.wikipedia.org/wiki/YUV
* <br>Equivalent to its uppercase counterpart.
*/
format_yuyv: 'yuyv',
/**
Expand Down Expand Up @@ -3919,7 +3920,8 @@ const format = {
*/
FORMAT_XYZ32F: RS2.RS2_FORMAT_XYZ32F,
/**
* Standard YUV pixel format as described in https://en.wikipedia.org/wiki/YUV.
* 32-bit y0, u, y1, v data for every two pixels. Similar to YUV422 but packed in a different
* order - https://en.wikipedia.org/wiki/YUV.
* <br>Equivalent to its lowercase counterpart.
* @type {Integer}
*/
Expand Down Expand Up @@ -4519,6 +4521,12 @@ const option = {
* <br>Equivalent to its uppercase counterpart.
*/
option_auto_exposure_converge_step: 'auto-exposure-converge-step',
/**
* String literal of <code>'inter-cam-sync-mode'. <br>Impose Inter-camera HW synchronization mode.
* Applicable for D400/Rolling Shutter SKUs
* <br>Equivalent to its uppercase counterpart.
*/
option_inter_cam_sync_mode: 'inter-cam-sync-mode',
/**
* Enable / disable color backlight compensatio.<br>Equivalent to its lowercase counterpart.
* @type {Integer}
Expand Down Expand Up @@ -4758,6 +4766,13 @@ const option = {
* @type {Integer}
*/
OPTION_AUTO_EXPOSURE_CONVERGE_STEP: RS2.RS2_OPTION_AUTO_EXPOSURE_CONVERGE_STEP,
/**
* Impose Inter-camera HW synchronization mode.
* Applicable for D400/Rolling Shutter SKUs
* <br>Equivalent to its lowercase counterpart
* @type {Integer}
*/
OPTION_INTER_CAM_SYNC_MODE: RS2.RS2_OPTION_INTER_CAM_SYNC_MODE,
/**
* Number of enumeration values. Not a valid input: intended to be used in for-loops.
* @type {Integer}
Expand Down Expand Up @@ -4858,6 +4873,8 @@ const option = {
return this.option_stereo_baseline;
case this.OPTION_AUTO_EXPOSURE_CONVERGE_STEP:
return this.option_auto_exposure_converge_step;
case this.OPTION_INTER_CAM_SYNC_MODE:
return this.option_inter_cam_sync_mode;
default:
throw new TypeError(
'option.optionToString(option) expects a valid value as the 1st argument');
Expand Down
1 change: 1 addition & 0 deletions wrappers/nodejs/src/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4647,6 +4647,7 @@ void InitModule(v8::Local<v8::Object> exports) {
_FORCE_SET_ENUM(RS2_OPTION_HOLES_FILL);
_FORCE_SET_ENUM(RS2_OPTION_STEREO_BASELINE);
_FORCE_SET_ENUM(RS2_OPTION_AUTO_EXPOSURE_CONVERGE_STEP);
_FORCE_SET_ENUM(RS2_OPTION_INTER_CAM_SYNC_MODE);
_FORCE_SET_ENUM(RS2_OPTION_COUNT);

// rs2_camera_info
Expand Down
4 changes: 4 additions & 0 deletions wrappers/nodejs/test/test-functional-online.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ describe('enum value test', function() {
'OPTION_FILTER_SMOOTH_DELTA',
'OPTION_HOLES_FILL',
'OPTION_STEREO_BASELINE',
'OPTION_AUTO_EXPOSURE_CONVERGE_STEP',
'OPTION_INTER_CAM_SYNC_MODE',
];
const strAttrs = [
'option_backlight_compensation',
Expand Down Expand Up @@ -468,6 +470,8 @@ describe('enum value test', function() {
'option_filter_smooth_delta',
'option_holes_fill',
'option_stereo_baseline',
'option_auto_exposure_converge_step',
'option_inter_cam_sync_mode',
];
numberAttrs.forEach((attr) => {
assert.equal(typeof obj[attr], 'number');
Expand Down

0 comments on commit eeff969

Please sign in to comment.