This repository has been archived by the owner on Jun 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
realsense-camera.widl
101 lines (86 loc) · 2.97 KB
/
realsense-camera.widl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Copyright (c) 2016 Intel Corporation. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
enum PixelFormat {
"any",
"z16",
"disparity16", // 16 bit linear depth values. The depth is meters is equal to depth scale * pixel value
"xyz32f", // 32 bit floating point 3D coordinates.
"yuyv",
"rgb8",
"bgr8",
"rgba8",
"bgra8",
"y8",
"y16",
"raw8",
"raw10", // Four 10-bit luminance values encoded into a 5-byte macropixel
"raw16"
};
interface MotionDeviceIntrinsic {
// Array indices for attribute data
/* Scale X cross axis cross axis Bias X */
/* cross axis Scale Y cross axis Bias Y */
/* cross axis cross axis Scale Z Bias Z */
attribute Float32Array data; // length === 12
attribute Float32Array noiseVariances; // length === 3
attribute Float32Array biasVariances; // length === 3
};
// TODO: Find a better prefix name.
interface Intrinsics
{
attribute long width; // width of the image in pixels
attribute long height; // height of the image in pixels
attribute Point2D principalPoint; // coordinate of the principal point of the image, as a pixel offset from the top/left edge
attribute Point2D focalLength; // focal length of the image plane, as a multiple of pixel width
};
// TODO: add usage cases
interface Extrinsics {
attribute Float32Array rotation; // length === 3
attribute Float32Array translation; // length === 3
};
interface Image {
readonly attribute long width;
readonly attribute long height;
readonly attribute PixelFormat format;
readonly attribute double timeStamp;
// In realsense_sdk, the type of frame_number is uint64_t,
// but NAN doesn't support unsigned long long(uint64_t), so use uint32_t instread.
readonly attribute unsigned long frameNumber;
readonly attribute ArrayBuffer data;
};
interface MotionSample {
readonly attribute double timeStamp;
readonly attribute unsigned long frameNumber;
readonly attribute Float32Array data; // length === 3
};
interface FrameData {
readonly attribute Image? fisheye;
readonly attribute Image? color;
readonly attribute Image? depth;
readonly attribute MotionSample? gyro;
readonly attribute MotionSample? accel;
};
dictionary ImageStreamOptions {
long width;
long height;
float frameRate;
Intrinsics intrinsics;
Extrinsics extrinsics;
boolean isEnabled;
};
dictionary MotionSensorOptions {
float frameRate;
boolean isEnabled;
MotionDeviceIntrinsic intrinsics;
Extrinsics extrinsics;
};
dictionary CameraOptions {
ImageStreamOptions color;
ImageStreamOptions depth;
ImageStreamOptions fisheye;
MotionSensorOptions accel;
MotionSensorOptions gyro;
// Only for testing purpose
DOMString playbackPathForTesting;
};