Skip to main content
Version: 12 Dec 2024

PixelSensor

NameSpace: PixelSensors

Public Fields

Status


public PixelSensorStatus Status { get; set; }

TypeDescription
PixelSensorStatusThe status of a sensor

StreamCount


public uint StreamCount { get; set; }


Public Methods

void ApplySensorConfig

public void ApplySensorConfig(
PixelSensorConfigData configData
)

Parameters

TypeNameDescription
PixelSensorConfigDataconfigDataRepresents a configuration to be applied for a sensor

void ClearAllAppliedConfigs

public void ClearAllAppliedConfigs()

void ClearAppliedConfig

public void ClearAppliedConfig(
PixelSensorCapabilityType capabilityType,
uint streamIndex
)

Parameters

TypeNameDescription
PixelSensorCapabilityTypecapabilityTypeThe configurable capability types of a pixel sensor
uintstreamIndex

PixelSensorAsyncOperationResult ConfigureSensor

public PixelSensorAsyncOperationResult ConfigureSensor(
IEnumerable< uint > streams
)

Parameters

TypeNameDescription
IEnumerable< uint >streams

bool CreatePixelSensor

public bool CreatePixelSensor()

bool DestroyPixelSensor

public bool DestroyPixelSensor()

bool EnumeratePixelSensorMetadata

public bool EnumeratePixelSensorMetadata(
uint streamIndex,
out PixelSensorMetaDataType [] metaDataTypes
)

Parameters

TypeNameDescription
uintstreamIndex
out PixelSensorMetaDataType []metaDataTypesThe metadata types that can be supported by a sensor

void EnumerateSensorCapabilities

public void EnumerateSensorCapabilities(
uint streamIndex,
out PixelSensorCapability [] capabilities
)

Parameters

TypeNameDescription
uintstreamIndex
out PixelSensorCapability []capabilitiesRepresents the capability data's type

bool GetAppliedConfigForCapability

public bool GetAppliedConfigForCapability(
uint streamIndex,
PixelSensorCapabilityType capabilityType,
out PixelSensorConfigData configData
)

Parameters

TypeNameDescription
uintstreamIndex
PixelSensorCapabilityTypecapabilityTypeThe configurable capability types of a pixel sensor
out PixelSensorConfigDataconfigDataRepresents a configuration to be applied for a sensor

unsafe bool GetSensorData

public unsafe bool GetSensorData(
uint streamIndex,
out XrPixelSensorFrame * sensorFrame,
out PixelSensorMetaData [] metaData,
Allocator allocator,
long timeout,
bool shouldFlipTexture
)

Parameters

TypeNameDescription
uintstreamIndex
out XrPixelSensorFrame *sensorFrame
out PixelSensorMetaData []metaDataThe base class for all metadata types. PixelSensors.MagicLeapPixelSensorFeature.GetSensorData will return an array of instances of the base class type Use the MetadataType to determine and cast to the corresponding metadata needed
Allocatorallocator
longtimeout
boolshouldFlipTexture

Pose GetSensorPose

public Pose GetSensorPose(
Pose offset
)

Parameters

TypeNameDescription
Poseoffset

uint GetStreamCount

public uint GetStreamCount()

bool IsMetaDataTypeSupported

public bool IsMetaDataTypeSupported(
PixelSensorMetaDataType metaDataType,
uint streamIndex
)

Parameters

TypeNameDescription
PixelSensorMetaDataTypemetaDataTypeThe metadata types that can be supported by a sensor
uintstreamIndex

PixelSensor

public PixelSensor(
ulong path,
PixelSensorId sensorType,
PixelSensorNativeFunctions nativeFunctions,
MagicLeapPixelSensorFeature pixelSensorFeature
)

Parameters

TypeNameDescription
ulongpath
PixelSensorIdsensorTypeA Pixel Sensor Identifier
PixelSensorNativeFunctionsnativeFunctions
MagicLeapPixelSensorFeaturepixelSensorFeatureEnables the Magic Leap OpenXR Loader for Android, and modifies the AndroidManifest to be compatible with ML2.

void PollSensorStatus

public void PollSensorStatus()

bool QuerySensorCapability

public bool QuerySensorCapability(
PixelSensorCapabilityType capabilityType,
uint streamIndex,
out PixelSensorCapabilityRange capabilityRange
)

Parameters

TypeNameDescription
PixelSensorCapabilityTypecapabilityTypeThe configurable capability types of a pixel sensor
uintstreamIndex
out PixelSensorCapabilityRangecapabilityRangeThe capability range for a sensor capability

PixelSensorAsyncOperationResult StartSensor

public PixelSensorAsyncOperationResult StartSensor(
IEnumerable< uint > streams,
Dictionary< uint, PixelSensorMetaDataType[]> metaDataTypes
)

Parameters

TypeNameDescription
IEnumerable< uint >streams
Dictionary< uint, PixelSensorMetaDataType[]>metaDataTypesThe metadata types that can be supported by a sensor

PixelSensorAsyncOperationResult StopSensor

public PixelSensorAsyncOperationResult StopSensor(
IEnumerable< uint > streams
)

Parameters

TypeNameDescription
IEnumerable< uint >streams

Public Attributes

PixelSensorCapabilityRangeType


public PixelSensorCapabilityRangeType;


ShouldPoll


public bool ShouldPoll => activeOperations.Count > 0 || queuedOperations.Count > 0;