Varjo Native SDK
Varjo_types_datastream.h
Go to the documentation of this file.
1 // Copyright 2019-2022 Varjo Technologies Oy. All rights reserved.
2 
3 #ifndef VARJO_TYPES_DATASTREAM_H
4 #define VARJO_TYPES_DATASTREAM_H
5 
6 #include "Varjo_types.h"
7 #include "Varjo_types_mr.h"
8 
9 #if defined __cplusplus
10 extern "C" {
11 #endif
12 
16 typedef uint64_t varjo_ChannelFlag;
20 
27 
31 typedef int64_t varjo_ChannelIndex;
34 
40 
44 typedef int64_t varjo_IntrinsicsModel;
46 
50 typedef int64_t varjo_BufferType;
53 
57 typedef uint64_t varjo_DataFlag;
58 static const varjo_DataFlag varjo_DataFlag_Buffer = 1 << 0;
61 
65 typedef int64_t varjo_StreamType;
66 
76 
102 
110 
114 typedef int64_t varjo_StreamId;
115 
119 typedef int64_t varjo_BufferId;
120 
124 static const int64_t varjo_InvalidId = -1;
125 
136  int32_t frameRate;
137  int32_t width;
138  int32_t height;
139  int32_t rowStride;
140 };
141 
149  double focalLengthX;
150  double focalLengthY;
152 };
153 
160  int32_t byteSize;
161  int32_t rowStride;
162  int32_t width;
163  int32_t height;
164 };
165 
179  struct varjo_Matrix3x3 invCCM;
180  struct varjo_Matrix3x3 ccm;
181 };
182 
191  double ev;
192  double exposureTime;
196 };
197 
210 };
211 
224  uint32_t glintMaskLeft;
225  uint32_t glintMaskRight;
226 };
227 
235  int64_t reserved[64];
236 };
237 
244  int64_t frameNumber;
247  struct varjo_Matrix hmdPose;
249 };
250 
258 typedef void(varjo_FrameListener)(const struct varjo_StreamFrame* frame, struct varjo_Session* session, void* userData);
259 
260 #if defined __cplusplus
261 }
262 #endif
263 #endif // VARJO_TYPES_DATASTREAM_H
varjo_StreamConfig::bufferType
varjo_BufferType bufferType
Buffer type: CPU or GPU memory buffer.
Definition: Varjo_types_datastream.h:133
varjo_BufferId
int64_t varjo_BufferId
Buffer ID to lock and use a data stream buffer.
Definition: Varjo_types_datastream.h:119
varjo_Nanoseconds
int64_t varjo_Nanoseconds
Time in nanoseconds.
Definition: Varjo_types.h:147
varjo_StreamConfig::frameRate
int32_t frameRate
Frame rate in frames per second.
Definition: Varjo_types_datastream.h:136
varjo_ChannelIndex_Second
static const varjo_ChannelIndex varjo_ChannelIndex_Second
Second channel.
Definition: Varjo_types_datastream.h:33
varjo_StreamFrameMetadata
Wrapper union for different types of streams.
Definition: Varjo_types_datastream.h:231
varjo_ChannelFlag_All
static const varjo_ChannelFlag varjo_ChannelFlag_All
Aggregate of every available channel.
Definition: Varjo_types_datastream.h:26
varjo_EyeCameraFrameMetadata::glintMaskLeft
uint32_t glintMaskLeft
Bit mask of enabled glint LEDs of left chamber.
Definition: Varjo_types_datastream.h:224
varjo_CameraIntrinsics::principalPointX
double principalPointX
Camera principal point X.
Definition: Varjo_types_datastream.h:147
varjo_StreamFrame::frameNumber
int64_t frameNumber
Monotonically increasing frame number.
Definition: Varjo_types_datastream.h:244
varjo_DistortedColorFrameMetadata::wbNormalizationData
struct varjo_WBNormalizationData wbNormalizationData
White balance normalization data.
Definition: Varjo_types_datastream.h:194
varjo_StreamConfig::width
int32_t width
Texture width.
Definition: Varjo_types_datastream.h:137
varjo_BufferMetadata::width
int32_t width
Image width.
Definition: Varjo_types_datastream.h:162
varjo_StreamFrameMetadata::reserved
int64_t reserved[64]
Definition: Varjo_types_datastream.h:235
varjo_StreamConfig::height
int32_t height
Texture height;.
Definition: Varjo_types_datastream.h:138
varjo_DistortedColorFrameMetadata
Metadata for distorted color stream.
Definition: Varjo_types_datastream.h:189
varjo_BufferMetadata
Buffer for data streams.
Definition: Varjo_types_datastream.h:157
varjo_DistortedColorFrameMetadata::whiteBalanceTemperature
double whiteBalanceTemperature
Camera white balance color temperature in Kelvin degrees.
Definition: Varjo_types_datastream.h:193
varjo_EnvironmentCubemapFrameMetadata::whiteBalanceTemperature
double whiteBalanceTemperature
Cubemap white balance color temperature in Kelvin degrees.
Definition: Varjo_types_datastream.h:207
varjo_DataFlag_Extrinsics
static const varjo_DataFlag varjo_DataFlag_Extrinsics
Definition: Varjo_types_datastream.h:60
varjo_StreamFrame::channels
varjo_ChannelFlag channels
Channels that this frame contains.
Definition: Varjo_types_datastream.h:245
varjo_BufferType_CPU
static const varjo_BufferType varjo_BufferType_CPU
Data is available in a CPU memory buffer.
Definition: Varjo_types_datastream.h:51
varjo_StreamConfig::streamId
varjo_StreamId streamId
Id.
Definition: Varjo_types_datastream.h:130
varjo_EyeCameraFrameMetadata::timestamp
varjo_Nanoseconds timestamp
Timestamp when the frame was captured (start of frame).
Definition: Varjo_types_datastream.h:223
varjo_StreamConfig
Data stream configuration.
Definition: Varjo_types_datastream.h:129
varjo_BufferMetadata::height
int32_t height
Image height.
Definition: Varjo_types_datastream.h:163
varjo_StreamFrame::metadata
union varjo_StreamFrameMetadata metadata
Frame data. Use 'type' to determine which element to access.
Definition: Varjo_types_datastream.h:248
varjo_CameraIntrinsics::principalPointY
double principalPointY
Camera principal point Y.
Definition: Varjo_types_datastream.h:148
varjo_CameraIntrinsics::focalLengthY
double focalLengthY
Camera focal length Y.
Definition: Varjo_types_datastream.h:150
varjo_CameraIntrinsics::model
varjo_IntrinsicsModel model
Intrisics calibration model.
Definition: Varjo_types_datastream.h:146
varjo_EnvironmentCubemapFrameMetadata::brightnessNormalizationGain
double brightnessNormalizationGain
Gain to convert cubemap to VST image brightness.
Definition: Varjo_types_datastream.h:208
varjo_StreamConfig::streamType
varjo_StreamType streamType
Stream type.
Definition: Varjo_types_datastream.h:132
varjo_StreamType_EnvironmentCubemap
static const varjo_StreamType varjo_StreamType_EnvironmentCubemap
HDR lighting estimate stream as a cubemap.
Definition: Varjo_types_datastream.h:101
varjo_CameraIntrinsics::focalLengthX
double focalLengthX
Camera focal length X.
Definition: Varjo_types_datastream.h:149
varjo_StreamFrameMetadata::environmentCubemap
struct varjo_EnvironmentCubemapFrameMetadata environmentCubemap
Definition: Varjo_types_datastream.h:233
varjo_CameraIntrinsics
Camera intrinsics parameter for undistorting a distorted camera frame.
Definition: Varjo_types_datastream.h:145
varjo_EnvironmentCubemapFrameMetadata::timestamp
varjo_Nanoseconds timestamp
Timestamp when the cubemap was last updated.
Definition: Varjo_types_datastream.h:205
Varjo_types_mr.h
varjo_StreamFrame
A single frame that will arrive to FrameListener callback after the user has subscribed to a stream.
Definition: Varjo_types_datastream.h:241
varjo_CameraIntrinsics::distortionCoefficients
double distortionCoefficients[6]
Intrinsics model coefficients. For omnidir: 2 radial, skew, xi, 2 tangential.
Definition: Varjo_types_datastream.h:151
varjo_StreamType_EyeCamera
static const varjo_StreamType varjo_StreamType_EyeCamera
Distorted (i.e.
Definition: Varjo_types_datastream.h:109
varjo_ChannelFlag_None
static const varjo_ChannelFlag varjo_ChannelFlag_None
Disables data buffers and only provides metadata.
Definition: Varjo_types_datastream.h:17
varjo_TextureFormat
int64_t varjo_TextureFormat
Definition: Varjo_types.h:216
varjo_EyeCameraFrameMetadata
Metadata for eye camera stream.
Definition: Varjo_types_datastream.h:222
varjo_DistortedColorFrameMetadata::timestamp
varjo_Nanoseconds timestamp
Timestamp at the middle of frame exposure.
Definition: Varjo_types_datastream.h:190
varjo_StreamFrame::id
varjo_StreamId id
Id of the stream.
Definition: Varjo_types_datastream.h:243
varjo_ChannelFlag_Second
static const varjo_ChannelFlag varjo_ChannelFlag_Second
Second channel.
Definition: Varjo_types_datastream.h:19
varjo_BufferMetadata::format
varjo_TextureFormat format
Texture format.
Definition: Varjo_types_datastream.h:158
varjo_StreamConfig::format
varjo_TextureFormat format
Texture format.
Definition: Varjo_types_datastream.h:134
varjo_StreamConfig::rowStride
int32_t rowStride
Buffer row stride in bytes.
Definition: Varjo_types_datastream.h:139
Varjo_types.h
varjo_DistortedColorFrameMetadata::exposureTime
double exposureTime
Exposure time in seconds.
Definition: Varjo_types_datastream.h:192
varjo_BufferType
int64_t varjo_BufferType
Memory buffer type.
Definition: Varjo_types_datastream.h:50
varjo_Matrix
Double precision 4x4 matrix.
Definition: Varjo_types.h:330
varjo_WBNormalizationData::whiteBalanceColorGains
double whiteBalanceColorGains[3]
White balance RGB gains to convert from 6500K to VST color temperature.
Definition: Varjo_types_datastream.h:178
varjo_StreamConfig::streamTransform
struct varjo_Matrix streamTransform
Transform from HMD pose center to stream origin in view coordinates.
Definition: Varjo_types_datastream.h:135
varjo_DistortedColorFrameMetadata::cameraCalibrationConstant
double cameraCalibrationConstant
The luminance (in cd/m^2) which saturates a pixel is equal to 2^ev * cameraCalibrationConstant.
Definition: Varjo_types_datastream.h:195
varjo_ChannelFlag_First
static const varjo_ChannelFlag varjo_ChannelFlag_First
First channel.
Definition: Varjo_types_datastream.h:18
varjo_StreamFrame::type
varjo_StreamType type
Type of the stream.
Definition: Varjo_types_datastream.h:242
varjo_StreamId
int64_t varjo_StreamId
Stream ID to identify a data stream configuration.
Definition: Varjo_types_datastream.h:114
varjo_StreamType_DistortedColor
static const varjo_StreamType varjo_StreamType_DistortedColor
Distorted (i.e.
Definition: Varjo_types_datastream.h:75
varjo_BufferType_GPU
static const varjo_BufferType varjo_BufferType_GPU
Data is available in a GPU memory buffer.
Definition: Varjo_types_datastream.h:52
varjo_ChannelFlag_Left
static const varjo_ChannelFlag varjo_ChannelFlag_Left
Helper aliases and aggregates for varjo_ChannelFlag.
Definition: Varjo_types_datastream.h:24
varjo_StreamFrameMetadata::eyeCamera
struct varjo_EyeCameraFrameMetadata eyeCamera
Definition: Varjo_types_datastream.h:234
varjo_BufferMetadata::type
varjo_BufferType type
CPU or GPU.
Definition: Varjo_types_datastream.h:159
varjo_StreamFrame::hmdPose
struct varjo_Matrix hmdPose
HMD world pose. Invert the pose, if you need the HMD center view matrix.
Definition: Varjo_types_datastream.h:247
varjo_BufferMetadata::byteSize
int32_t byteSize
Buffer size in bytes.
Definition: Varjo_types_datastream.h:160
varjo_DataFlag
uint64_t varjo_DataFlag
Frame data flag buffer type.
Definition: Varjo_types_datastream.h:57
varjo_StreamFrame::dataFlags
varjo_DataFlag dataFlags
Data that this frame contains.
Definition: Varjo_types_datastream.h:246
varjo_WBNormalizationData::ccm
struct varjo_Matrix3x3 ccm
CCM for VST color temperature.
Definition: Varjo_types_datastream.h:180
varjo_EnvironmentCubemapFrameMetadata::mode
varjo_EnvironmentCubemapMode mode
Cubemap mode which defines the color and brightness of the cubemap data.
Definition: Varjo_types_datastream.h:206
varjo_WBNormalizationData::invCCM
struct varjo_Matrix3x3 invCCM
Inverse CCM for 6500K color temperature.
Definition: Varjo_types_datastream.h:179
varjo_EnvironmentCubemapFrameMetadata::wbNormalizationData
struct varjo_WBNormalizationData wbNormalizationData
White balance normalization data.
Definition: Varjo_types_datastream.h:209
varjo_ChannelIndex_Left
static const varjo_ChannelIndex varjo_ChannelIndex_Left
Helper aliases for varjo_ChannelIndex.
Definition: Varjo_types_datastream.h:38
varjo_InvalidId
static const int64_t varjo_InvalidId
Invalid id for any ID type (e.g.
Definition: Varjo_types_datastream.h:124
varjo_EnvironmentCubemapMode
int64_t varjo_EnvironmentCubemapMode
Definition: Varjo_types_mr.h:58
varjo_IntrinsicsModel_Omnidir
static const varjo_IntrinsicsModel varjo_IntrinsicsModel_Omnidir
OpenCV compatible Omnidir calibration model.
Definition: Varjo_types_datastream.h:45
varjo_ChannelIndex_First
static const varjo_ChannelIndex varjo_ChannelIndex_First
First channel.
Definition: Varjo_types_datastream.h:32
varjo_DistortedColorFrameMetadata::ev
double ev
EV (exposure value) at ISO100.
Definition: Varjo_types_datastream.h:191
varjo_ChannelFlag
uint64_t varjo_ChannelFlag
Bitfield for different data stream channels.
Definition: Varjo_types_datastream.h:16
varjo_WBNormalizationData
White balance normalization data for color matching VR content with camera image.
Definition: Varjo_types_datastream.h:177
varjo_DataFlag_Buffer
static const varjo_DataFlag varjo_DataFlag_Buffer
Definition: Varjo_types_datastream.h:58
varjo_StreamType
int64_t varjo_StreamType
Data stream types.
Definition: Varjo_types_datastream.h:65
varjo_FrameListener
void() varjo_FrameListener(const struct varjo_StreamFrame *frame, struct varjo_Session *session, void *userData)
Camera frame stream callback function.
Definition: Varjo_types_datastream.h:258
varjo_StreamConfig::channelFlags
varjo_ChannelFlag channelFlags
Bitfield of provided camera channels.
Definition: Varjo_types_datastream.h:131
varjo_EnvironmentCubemapFrameMetadata
Metadata for environment cubemap stream.
Definition: Varjo_types_datastream.h:204
varjo_EyeCameraFrameMetadata::glintMaskRight
uint32_t glintMaskRight
Bit mask of enabled glint LEDs of right chamber.
Definition: Varjo_types_datastream.h:225
varjo_ChannelIndex_Right
static const varjo_ChannelIndex varjo_ChannelIndex_Right
Right camera channel. Alias for varjo_ChannelIndex_Second.
Definition: Varjo_types_datastream.h:39
varjo_DataFlag_Intrinsics
static const varjo_DataFlag varjo_DataFlag_Intrinsics
Definition: Varjo_types_datastream.h:59
varjo_BufferMetadata::rowStride
int32_t rowStride
Buffer row stride in bytes.
Definition: Varjo_types_datastream.h:161
varjo_ChannelFlag_Right
static const varjo_ChannelFlag varjo_ChannelFlag_Right
Right camera channel. Alias for varjo_ChannelFlag_Second.
Definition: Varjo_types_datastream.h:25
varjo_IntrinsicsModel
int64_t varjo_IntrinsicsModel
Camera intrinsics model type.
Definition: Varjo_types_datastream.h:44
varjo_ChannelIndex
int64_t varjo_ChannelIndex
Values for indexing buffers and settings of data streams.
Definition: Varjo_types_datastream.h:31
varjo_StreamFrameMetadata::distortedColor
struct varjo_DistortedColorFrameMetadata distortedColor
Definition: Varjo_types_datastream.h:232
varjo_Matrix3x3
Double precision 3x3 matrix.
Definition: Varjo_types.h:338