PerceptionColorFrameSource PerceptionColorFrameSource PerceptionColorFrameSource PerceptionColorFrameSource Class

Definition

A frame source that provides color frames.

public : sealed class PerceptionColorFrameSource : IPerceptionColorFrameSource, IPerceptionColorFrameSource2
public sealed class PerceptionColorFrameSource : IPerceptionColorFrameSource, IPerceptionColorFrameSource2
Public NotInheritable Class PerceptionColorFrameSource Implements IPerceptionColorFrameSource, IPerceptionColorFrameSource2
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

Active Active Active Active

Gets a boolean value indicating whether or not the source is active.

public : Platform::Boolean Active { get; }
public bool Active { get; }
Public ReadOnly Property Active As bool
var bool = perceptionColorFrameSource.active;
Value
Platform::Boolean bool bool bool

A boolean value indicating whether or not the source is active.

Available Available Available Available

Gets a boolean value indicating whether or not the source is available.

public : Platform::Boolean Available { get; }
public bool Available { get; }
Public ReadOnly Property Available As bool
var bool = perceptionColorFrameSource.available;
Value
Platform::Boolean bool bool bool

A boolean value indicating whether or not the source is available.

AvailableVideoProfiles AvailableVideoProfiles AvailableVideoProfiles AvailableVideoProfiles

Gets a read-only collection of video profiles that are currently available from the color frame source.

public : IVectorView<PerceptionVideoProfile> AvailableVideoProfiles { get; }
public IReadOnlyList<PerceptionVideoProfile> AvailableVideoProfiles { get; }
Public ReadOnly Property AvailableVideoProfiles As IReadOnlyList<PerceptionVideoProfile>
var iReadOnlyList = perceptionColorFrameSource.availableVideoProfiles;
Value
IVectorView<PerceptionVideoProfile> IReadOnlyList<PerceptionVideoProfile> IReadOnlyList<PerceptionVideoProfile> IReadOnlyList<PerceptionVideoProfile>

A read-only collection of video profiles that are currently available from the color frame source.

CameraIntrinsics CameraIntrinsics CameraIntrinsics CameraIntrinsics

Gets a CameraIntrinsics value specifying the intrinsic properties of the color frame source camera device.

public : CameraIntrinsics CameraIntrinsics { get; }
public CameraIntrinsics CameraIntrinsics { get; }
Public ReadOnly Property CameraIntrinsics As CameraIntrinsics
var cameraIntrinsics = perceptionColorFrameSource.cameraIntrinsics;
Value
CameraIntrinsics CameraIntrinsics CameraIntrinsics CameraIntrinsics

A CameraIntrinsics value specifying the intrinsic properties of the color frame source camera device.

DeviceId DeviceId DeviceId DeviceId

Gets a string value that identifies the device on the system.

public : Platform::String DeviceId { get; }
public string DeviceId { get; }
Public ReadOnly Property DeviceId As string
var string = perceptionColorFrameSource.deviceId;
Value
Platform::String string string string

The identifier.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

DeviceKind DeviceKind DeviceKind DeviceKind

Gets a string value indicating the kind of physical device that generates the color frames for this source.

public : Platform::String DeviceKind { get; }
public string DeviceKind { get; }
Public ReadOnly Property DeviceKind As string
var string = perceptionColorFrameSource.deviceKind;
Value
Platform::String string string string

A string value indicating the kind of physical device that generates the color frames for this source.

DisplayName DisplayName DisplayName DisplayName

Gets a string value indicating the display name of the color frame source.

public : Platform::String DisplayName { get; }
public string DisplayName { get; }
Public ReadOnly Property DisplayName As string
var string = perceptionColorFrameSource.displayName;
Value
Platform::String string string string

A string value indicating the display name of the color frame source.

Id Id Id Id

Gets a string value indicating the unique ID of the color frame source.

public : Platform::String Id { get; }
public string Id { get; }
Public ReadOnly Property Id As string
var string = perceptionColorFrameSource.id;
Value
Platform::String string string string

A string value indicating the unique ID of the color frame source.

IsControlled IsControlled IsControlled IsControlled

Gets a boolean value indicating whether or not the source is the subject of controller mode.

public : Platform::Boolean IsControlled { get; }
public bool IsControlled { get; }
Public ReadOnly Property IsControlled As bool
var bool = perceptionColorFrameSource.isControlled;
Value
Platform::Boolean bool bool bool

A boolean value indicating whether or not the source is the subject of controller mode.

Properties Properties Properties Properties

Gets a read-only collection of frame source properties.

public : IMapView<Platform::String, Platform::Object> Properties { get; }
public IReadOnlyDictionary<string, object> Properties { get; }
Public ReadOnly Property Properties As IReadOnlyDictionary<string, object>
var iReadOnlyDictionary = perceptionColorFrameSource.properties;
Value
IMapView<Platform::String, Platform::Object> IReadOnlyDictionary<string, object> IReadOnlyDictionary<string, object> IReadOnlyDictionary<string, object>

A read-only collection of frame source properties.

SupportedVideoProfiles SupportedVideoProfiles SupportedVideoProfiles SupportedVideoProfiles

Gets a read-only collection of video profiles that are supported by the color frame source.

public : IVectorView<PerceptionVideoProfile> SupportedVideoProfiles { get; }
public IReadOnlyList<PerceptionVideoProfile> SupportedVideoProfiles { get; }
Public ReadOnly Property SupportedVideoProfiles As IReadOnlyList<PerceptionVideoProfile>
var iReadOnlyList = perceptionColorFrameSource.supportedVideoProfiles;
Value
IVectorView<PerceptionVideoProfile> IReadOnlyList<PerceptionVideoProfile> IReadOnlyList<PerceptionVideoProfile> IReadOnlyList<PerceptionVideoProfile>

A read-only collection of video profiles that are supported by the color frame source.

VideoProfile VideoProfile VideoProfile VideoProfile

Gets a PerceptionVideoProfile object indicating the current video profile.

public : PerceptionVideoProfile VideoProfile { get; }
public PerceptionVideoProfile VideoProfile { get; }
Public ReadOnly Property VideoProfile As PerceptionVideoProfile
var perceptionVideoProfile = perceptionColorFrameSource.videoProfile;
Value
PerceptionVideoProfile PerceptionVideoProfile PerceptionVideoProfile PerceptionVideoProfile

A PerceptionVideoProfile object indicating the current video profile.

Methods

AcquireControlSession() AcquireControlSession() AcquireControlSession() AcquireControlSession()

Attempts to acquire Controller Mode on the color frame source.

public : PerceptionControlSession AcquireControlSession()
public PerceptionControlSession AcquireControlSession()
Public Function AcquireControlSession() As PerceptionControlSession
var perceptionControlSession = perceptionColorFrameSource.acquireControlSession();
Returns

If the attempt is successful, this returns a PerceptionControlSession object that can be used to control properties of the color frame source. Otherwise, this returns null.

CanControlIndependentlyFrom(String) CanControlIndependentlyFrom(String) CanControlIndependentlyFrom(String) CanControlIndependentlyFrom(String)

This method returns a boolean value indicating whether or not the color frame source can be controlled separately from another frame source.

public : Platform::Boolean CanControlIndependentlyFrom(Platform::String targetId)
public bool CanControlIndependentlyFrom(String targetId)
Public Function CanControlIndependentlyFrom(targetId As String) As bool
var bool = perceptionColorFrameSource.canControlIndependentlyFrom(targetId);
Parameters
targetId
Platform::String String String String

A string representing the unique ID of the other frame source.

Returns
Platform::Boolean bool bool bool

Returns true if the two sources can be controlled independently of one another, otherwise returns false.

CreateWatcher() CreateWatcher() CreateWatcher() CreateWatcher()

Creates a new color frame source watcher.

public : static PerceptionColorFrameSourceWatcher CreateWatcher()
public static PerceptionColorFrameSourceWatcher CreateWatcher()
Public Static Function CreateWatcher() As PerceptionColorFrameSourceWatcher
var perceptionColorFrameSourceWatcher = Windows.Devices.Perception.PerceptionColorFrameSource.createWatcher();
Returns

FindAllAsync() FindAllAsync() FindAllAsync() FindAllAsync()

Finds all color frame sources.

public : static IAsyncOperation<IVectorView<PerceptionColorFrameSource>> FindAllAsync()
public static IAsyncOperation<IReadOnlyList<PerceptionColorFrameSource>> FindAllAsync()
Public Static Function FindAllAsync() As IAsyncOperation<IReadOnlyList<PerceptionColorFrameSource>>( Of IVectorView )
var iAsyncOperation = Windows.Devices.Perception.PerceptionColorFrameSource.findAllAsync();
Returns
IAsyncOperation<IVectorView<PerceptionColorFrameSource>> IAsyncOperation<IReadOnlyList<PerceptionColorFrameSource>> IAsyncOperation<IReadOnlyList<PerceptionColorFrameSource>> IAsyncOperation<IReadOnlyList<PerceptionColorFrameSource>>

When the method completes, it asynchronously returns a list of color frame sources.

FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String)

Finds an color frame source by looking up its unique ID.

public : static IAsyncOperation<PerceptionColorFrameSource> FromIdAsync(Platform::String id)
public static IAsyncOperation<PerceptionColorFrameSource> FromIdAsync(String id)
Public Static Function FromIdAsync(id As String) As IAsyncOperation( Of PerceptionColorFrameSource )
var iAsyncOperation = Windows.Devices.Perception.PerceptionColorFrameSource.fromIdAsync(id);
Parameters
id
Platform::String String String String

The unique ID of the color frame source.

Returns

When this method completes, it asynchronously returns a color frame source if one exists with the specified ID. Otherwise, this method asynchronously returns null.

IsCorrelatedWith(String) IsCorrelatedWith(String) IsCorrelatedWith(String) IsCorrelatedWith(String)

Checks whether or not the color frame source is correlated with the target entity. If the result is true, a transform matrix can be retrieved to change coordinate basis from this color frame source to the entity, or vice versa.

public : Platform::Boolean IsCorrelatedWith(Platform::String targetId)
public bool IsCorrelatedWith(String targetId)
Public Function IsCorrelatedWith(targetId As String) As bool
var bool = perceptionColorFrameSource.isCorrelatedWith(targetId);
Parameters
targetId
Platform::String String String String

The unique ID of the target entity.

Returns
Platform::Boolean bool bool bool

Returns true if a correlation exists, otherwise returns false.

OpenReader() OpenReader() OpenReader() OpenReader()

Gets a frame reader that reads frames from this color frame source.

public : PerceptionColorFrameReader OpenReader()
public PerceptionColorFrameReader OpenReader()
Public Function OpenReader() As PerceptionColorFrameReader
var perceptionColorFrameReader = perceptionColorFrameSource.openReader();
Returns

Returns a frame reader that reads frames from this color frame source.

RequestAccessAsync() RequestAccessAsync() RequestAccessAsync() RequestAccessAsync()

Requests access to use color frame sources.

public : static IAsyncOperation<PerceptionFrameSourceAccessStatus> RequestAccessAsync()
public static IAsyncOperation<PerceptionFrameSourceAccessStatus> RequestAccessAsync()
Public Static Function RequestAccessAsync() As IAsyncOperation( Of PerceptionFrameSourceAccessStatus )
var iAsyncOperation = Windows.Devices.Perception.PerceptionColorFrameSource.requestAccessAsync();
Returns

TryGetDepthCorrelatedCameraIntrinsicsAsync(PerceptionDepthFrameSource) TryGetDepthCorrelatedCameraIntrinsicsAsync(PerceptionDepthFrameSource) TryGetDepthCorrelatedCameraIntrinsicsAsync(PerceptionDepthFrameSource) TryGetDepthCorrelatedCameraIntrinsicsAsync(PerceptionDepthFrameSource)

Attempts to get the intrinsic properties of the depth camera that is correlated with this color source.

public : IAsyncOperation<PerceptionDepthCorrelatedCameraIntrinsics> TryGetDepthCorrelatedCameraIntrinsicsAsync(PerceptionDepthFrameSource correlatedDepthFrameSource)
public IAsyncOperation<PerceptionDepthCorrelatedCameraIntrinsics> TryGetDepthCorrelatedCameraIntrinsicsAsync(PerceptionDepthFrameSource correlatedDepthFrameSource)
Public Function TryGetDepthCorrelatedCameraIntrinsicsAsync(correlatedDepthFrameSource As PerceptionDepthFrameSource) As IAsyncOperation( Of PerceptionDepthCorrelatedCameraIntrinsics )
var iAsyncOperation = perceptionColorFrameSource.tryGetDepthCorrelatedCameraIntrinsicsAsync(correlatedDepthFrameSource);
Parameters
correlatedDepthFrameSource
PerceptionDepthFrameSource PerceptionDepthFrameSource PerceptionDepthFrameSource PerceptionDepthFrameSource

The depth frame source to try to get intrinsic properties of.

Returns

If the attempt is successful, this will return a read-only collection of PerceptionDepthCorrelatedCameraIntrinsics objects specifying the intrinsic properties of the camera used by the correlated depth frame source. Otherwise, this returns null.

TryGetDepthCorrelatedCoordinateMapperAsync(String, PerceptionDepthFrameSource) TryGetDepthCorrelatedCoordinateMapperAsync(String, PerceptionDepthFrameSource) TryGetDepthCorrelatedCoordinateMapperAsync(String, PerceptionDepthFrameSource) TryGetDepthCorrelatedCoordinateMapperAsync(String, PerceptionDepthFrameSource)

Attempts to get a coordinate mapper that maps from color frame image space to depth frame space.

public : IAsyncOperation<PerceptionDepthCorrelatedCoordinateMapper> TryGetDepthCorrelatedCoordinateMapperAsync(Platform::String targetSourceId, PerceptionDepthFrameSource correlatedDepthFrameSource)
public IAsyncOperation<PerceptionDepthCorrelatedCoordinateMapper> TryGetDepthCorrelatedCoordinateMapperAsync(String targetSourceId, PerceptionDepthFrameSource correlatedDepthFrameSource)
Public Function TryGetDepthCorrelatedCoordinateMapperAsync(targetSourceId As String, correlatedDepthFrameSource As PerceptionDepthFrameSource) As IAsyncOperation( Of PerceptionDepthCorrelatedCoordinateMapper )
var iAsyncOperation = perceptionColorFrameSource.tryGetDepthCorrelatedCoordinateMapperAsync(targetSourceId, correlatedDepthFrameSource);
Parameters
targetSourceId
Platform::String String String String

The unique ID of the depth frame source to try to map to.

correlatedDepthFrameSource
PerceptionDepthFrameSource PerceptionDepthFrameSource PerceptionDepthFrameSource PerceptionDepthFrameSource

The depth frame source to try to map to. This should be in a correlation group with the color frame source.

Returns

If the two sources are correlated, this method returns a PerceptionDepthCorrelatedCoordinateMapper. Otherwise, it returns null. This method returns asynchronously.

TryGetTransformTo(String, Matrix4x4) TryGetTransformTo(String, Matrix4x4) TryGetTransformTo(String, Matrix4x4) TryGetTransformTo(String, Matrix4x4)

This method returns the transform from the color frame source to the target entity and sets hasResult to true, if a correlation exists. If a correlation does not exist, hasResult is set to false and result is not modified.

public : Platform::Boolean TryGetTransformTo(Platform::String targetId, Matrix4x4 result)
public bool TryGetTransformTo(String targetId, Matrix4x4 result)
Public Function TryGetTransformTo(targetId As String, result As Matrix4x4) As bool
var bool = perceptionColorFrameSource.tryGetTransformTo(targetId, result);
Parameters
targetId
Platform::String String String String

The unique ID of the target entity.

result
Matrix4x4 Matrix4x4 Matrix4x4 Matrix4x4

If a correlation exists, this will be set to a 4x4 transform matrix that changes basis from the color frame source coordinate system to the target entity coordinate system.

Returns
Platform::Boolean bool bool bool

Returns true if a correlation exists, otherwise false.

TrySetVideoProfileAsync(PerceptionControlSession, PerceptionVideoProfile) TrySetVideoProfileAsync(PerceptionControlSession, PerceptionVideoProfile) TrySetVideoProfileAsync(PerceptionControlSession, PerceptionVideoProfile) TrySetVideoProfileAsync(PerceptionControlSession, PerceptionVideoProfile)

Attempts to set a video profile on this color frame source. Requires an active Controller Mode control session on this frame source.

public : IAsyncOperation<PerceptionFrameSourcePropertyChangeResult> TrySetVideoProfileAsync(PerceptionControlSession controlSession, PerceptionVideoProfile profile)
public IAsyncOperation<PerceptionFrameSourcePropertyChangeResult> TrySetVideoProfileAsync(PerceptionControlSession controlSession, PerceptionVideoProfile profile)
Public Function TrySetVideoProfileAsync(controlSession As PerceptionControlSession, profile As PerceptionVideoProfile) As IAsyncOperation( Of PerceptionFrameSourcePropertyChangeResult )
var iAsyncOperation = perceptionColorFrameSource.trySetVideoProfileAsync(controlSession, profile);
Parameters
controlSession
PerceptionControlSession PerceptionControlSession PerceptionControlSession PerceptionControlSession

A PerceptionControlSession representing active control of this frame source.

Returns

This method returns an PerceptionFrameSourcePropertyChangeResult object asynchonously. If the control session was still active when the video profile was set, and if the video profile is supported and can be activated, this will be a result that indicates success.

Events

ActiveChanged ActiveChanged ActiveChanged ActiveChanged

Subscribes to the ActiveChanged event.

public : event TypedEventHandler ActiveChanged<PerceptionColorFrameSource,  object>
public event TypedEventHandler ActiveChanged<PerceptionColorFrameSource,  object>
Public Event TypedEventHandler ActiveChanged( Of ( Of PerceptionColorFrameSource ), ( Of  object ))
function onActiveChanged(eventArgs){/* Your code */}


perceptionColorFrameSource.addEventListener("activeChanged", onActiveChanged);
perceptionColorFrameSource.removeEventListener("activeChanged", onActiveChanged);

AvailableChanged AvailableChanged AvailableChanged AvailableChanged

Subscribes to the AvailableChanged event.

public : event TypedEventHandler AvailableChanged<PerceptionColorFrameSource,  object>
public event TypedEventHandler AvailableChanged<PerceptionColorFrameSource,  object>
Public Event TypedEventHandler AvailableChanged( Of ( Of PerceptionColorFrameSource ), ( Of  object ))
function onAvailableChanged(eventArgs){/* Your code */}


perceptionColorFrameSource.addEventListener("availableChanged", onAvailableChanged);
perceptionColorFrameSource.removeEventListener("availableChanged", onAvailableChanged);

CameraIntrinsicsChanged CameraIntrinsicsChanged CameraIntrinsicsChanged CameraIntrinsicsChanged

Subscribes to the CameraIntrinsicsChanged event.

public : event TypedEventHandler CameraIntrinsicsChanged<PerceptionColorFrameSource,  object>
public event TypedEventHandler CameraIntrinsicsChanged<PerceptionColorFrameSource,  object>
Public Event TypedEventHandler CameraIntrinsicsChanged( Of ( Of PerceptionColorFrameSource ), ( Of  object ))
function onCameraIntrinsicsChanged(eventArgs){/* Your code */}


perceptionColorFrameSource.addEventListener("cameraIntrinsicsChanged", onCameraIntrinsicsChanged);
perceptionColorFrameSource.removeEventListener("cameraIntrinsicsChanged", onCameraIntrinsicsChanged);

PropertiesChanged PropertiesChanged PropertiesChanged PropertiesChanged

Subscribes to the PropertiesChanged event.

public : event TypedEventHandler PropertiesChanged<PerceptionColorFrameSource,  PerceptionFrameSourcePropertiesChangedEventArgs>
public event TypedEventHandler PropertiesChanged<PerceptionColorFrameSource,  PerceptionFrameSourcePropertiesChangedEventArgs>
Public Event TypedEventHandler PropertiesChanged( Of ( Of PerceptionColorFrameSource ), ( Of  PerceptionFrameSourcePropertiesChangedEventArgs ))
function onPropertiesChanged(eventArgs){/* Your code */}


perceptionColorFrameSource.addEventListener("propertiesChanged", onPropertiesChanged);
perceptionColorFrameSource.removeEventListener("propertiesChanged", onPropertiesChanged);

VideoProfileChanged VideoProfileChanged VideoProfileChanged VideoProfileChanged

Subscribes to the VideoProfileChanged event.

public : event TypedEventHandler VideoProfileChanged<PerceptionColorFrameSource,  object>
public event TypedEventHandler VideoProfileChanged<PerceptionColorFrameSource,  object>
Public Event TypedEventHandler VideoProfileChanged( Of ( Of PerceptionColorFrameSource ), ( Of  object ))
function onVideoProfileChanged(eventArgs){/* Your code */}


perceptionColorFrameSource.addEventListener("videoProfileChanged", onVideoProfileChanged);
perceptionColorFrameSource.removeEventListener("videoProfileChanged", onVideoProfileChanged);