Class HoloLensCamera
Exposes functionality for all of HoloLens's cameras.
Implements
Inherited Members
Namespace: Microsoft.MixedReality.PhotoCapture
Assembly: cs.temp.dll.dll
Syntax
public class HoloLensCamera : IDisposable
Constructors
HoloLensCamera(CaptureMode, PixelFormat)
Declaration
public HoloLensCamera(CaptureMode captureMode, PixelFormat pixelFormat = PixelFormat.BGRA8)
Parameters
Type | Name | Description |
---|---|---|
CaptureMode | captureMode | |
PixelFormat | pixelFormat |
Properties
AutoExposure
True if exposure is automatic, false if exposure is manually set through Exposure property.
Declaration
public bool AutoExposure { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
AutoGain
True if automatic gain adjustment, false if gain is manually set through Gain property. Note: Setting the value is a non-awaited asynchronous operation, so a get immediately after a set may not result in the same value.
Declaration
public bool AutoGain { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Brightness
Relative brightness value of the camera image. Range is 0 to 1.
Declaration
public double Brightness { get; set; }
Property Value
Type | Description |
---|---|
Double |
CaptureMode
The capture mode of this camera
Declaration
public CaptureMode CaptureMode { get; protected set; }
Property Value
Type | Description |
---|---|
CaptureMode |
Contrast
Relative contrast value of the camera image. Range is 0 to 1.
Declaration
public double Contrast { get; set; }
Property Value
Type | Description |
---|---|
Double |
Exposure
Current exposure duration in seconds.
Declaration
public double Exposure { get; set; }
Property Value
Type | Description |
---|---|
Double |
Gain
Current camera gain setting. This is a 0 to 1 value that linearly maps to ISO values usable by the device. Note: Setting the value is a non-awaited asynchronous operation, so a get immediately after a set may not result in the same value.
Declaration
public float Gain { get; set; }
Property Value
Type | Description |
---|---|
Single |
KeepSoftwareBitmap
Specifies whether to keep a reference to the camera frames SoftwareBitmap for future operations.
Declaration
public bool KeepSoftwareBitmap { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ManualExposureSupported
True if manual exposure is supported
Declaration
public bool ManualExposureSupported { get; }
Property Value
Type | Description |
---|---|
Boolean |
ManualGainSupported
Returns whether the camera gain can be set manually or not.
Declaration
public bool ManualGainSupported { get; }
Property Value
Type | Description |
---|---|
Boolean |
MaxExposure
Minimum Exposure value
Declaration
public double MaxExposure { get; }
Property Value
Type | Description |
---|---|
Double |
MinExposure
Maximum exposure value
Declaration
public double MinExposure { get; }
Property Value
Type | Description |
---|---|
Double |
Resolution
Declaration
public CameraResolution Resolution { get; }
Property Value
Type | Description |
---|---|
CameraResolution |
State
Current state of the camera
Declaration
public CameraState State { get; }
Property Value
Type | Description |
---|---|
CameraState |
StreamSelector
All native resolutions supported in the current camera mode
Declaration
public StreamSelector StreamSelector { get; }
Property Value
Type | Description |
---|---|
StreamSelector |
Methods
Dispose()
Disposes the camera
Declaration
public void Dispose()
Initialize()
Initializes the camera
Declaration
public Task Initialize()
Returns
Type | Description |
---|---|
Task |
Start(StreamDescription)
Start the video stream. This just prepares the stream for capture, and doesn't start collecting frames
Declaration
public void Start(StreamDescription streamDesc)
Parameters
Type | Name | Description |
---|---|---|
StreamDescription | streamDesc | The description of the stream to start. |
StartContinuousCapture()
Starts continuous capture
Declaration
public bool StartContinuousCapture()
Returns
Type | Description |
---|---|
Boolean | Returns true if starting continuous capture succeeded |
Stop()
Stop the camera. This will release resources and
Declaration
public void Stop()
StopContinuousCapture()
Stops continuous capture
Declaration
public void StopContinuousCapture()
TakeSingle()
Take a single exposure. The camera must be in the ready state for this call to work. All types of cameras can grab a single frame if not recording continuous
Declaration
public bool TakeSingle()
Returns
Type | Description |
---|---|
Boolean |
Events
OnCameraInitialized
Callback to register for camera initialized events
Declaration
public event OnCameraInitializedHandler OnCameraInitialized
Event Type
Type | Description |
---|---|
OnCameraInitializedHandler |
OnCameraStarted
Callback to register for camera started events
Declaration
public event OnCameraStartedHandler OnCameraStarted
Event Type
Type | Description |
---|---|
OnCameraStartedHandler |
OnFrameCaptured
Callback to register for frame captured events
Declaration
public event OnFrameCapturedHandler OnFrameCaptured
Event Type
Type | Description |
---|---|
OnFrameCapturedHandler |