Class MSFTSceneMarker
This extension enables the application to observe the tracked markers, such as the QR Code markers in ISO/IEC 18004:2015. This extension also enables future extensions to easily add new types of marker tracking.
The application must enable both XR_MSFT_scene_marker and XR_MSFT_scene_understanding in order to use this extension.
Note
A typical use of this extension is:
- Verify if marker detection is supported by calling
EnumerateSceneComputeFeaturesMSFTand validate that the returned supported features includeSCENE_COMPUTE_FEATURE_MARKER_MSFT. - If supported, create an
XrSceneObserverMSFThandle. - Pass in
SCENE_COMPUTE_FEATURE_MARKER_MSFTas requested feature when starting the scene compute by callingComputeNewSceneMSFTfunction. - Inspect the completion of computation by polling
GetSceneComputeStateMSFT. - Once compute is successfully completed, create an
XrSceneMSFThandle to the result by callingCreateSceneMSFT. - Get the list of detected markers using
GetSceneComponentsMSFT:- optionally filter the type of the returned markers using
XrSceneMarkerTypeFilterMSFT. - optionally retrieve additional marker properties by chaining
XrSceneMarkersMSFTand/orXrSceneMarkerQRCodesMSFTto the next pointer ofXrSceneComponentsMSFT.
- optionally filter the type of the returned markers using
- Get the data encoded in a marker using
GetSceneMarkerDecodedStringMSFTorGetSceneMarkerRawDataMSFT. - Locate markers using
LocateSceneComponentsMSFT.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intExtendsXrSceneComponentTypeMSFT.static final intExtendsXrSceneComputeFeatureMSFT.static final intExtendsXrResult.static final intXrSceneMarkerQRCodeSymbolTypeMSFT - QR Code Symbol typestatic final intXrSceneMarkerQRCodeSymbolTypeMSFT - QR Code Symbol typestatic final intXrSceneMarkerTypeMSFT - Marker typestatic final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrGetSceneMarkerDecodedStringMSFT(XrSceneMSFT scene, long markerId, int bufferCapacityInput, long bufferCountOutput, long buffer) Unsafe version of:GetSceneMarkerDecodedStringMSFTstatic intnxrGetSceneMarkerRawDataMSFT(XrSceneMSFT scene, long markerId, int bufferCapacityInput, long bufferCountOutput, long buffer) Unsafe version of:GetSceneMarkerRawDataMSFTstatic intxrGetSceneMarkerDecodedStringMSFT(XrSceneMSFT scene, XrUuidMSFT markerId, IntBuffer bufferCountOutput, @Nullable ByteBuffer buffer) Get the string encoded in the scene marker.static intxrGetSceneMarkerRawDataMSFT(XrSceneMSFT scene, XrUuidMSFT markerId, IntBuffer bufferCountOutput, @Nullable ByteBuffer buffer) Get the data stored in the scene marker.
-
Field Details
-
XR_MSFT_scene_marker_SPEC_VERSION
public static final int XR_MSFT_scene_marker_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_MSFT_SCENE_MARKER_EXTENSION_NAME
The extension name.- See Also:
-
XR_SCENE_COMPUTE_FEATURE_MARKER_MSFT
public static final int XR_SCENE_COMPUTE_FEATURE_MARKER_MSFTExtendsXrSceneComputeFeatureMSFT.- See Also:
-
XR_SCENE_COMPONENT_TYPE_MARKER_MSFT
public static final int XR_SCENE_COMPONENT_TYPE_MARKER_MSFTExtendsXrSceneComponentTypeMSFT.- See Also:
-
XR_TYPE_SCENE_MARKERS_MSFT
public static final int XR_TYPE_SCENE_MARKERS_MSFTExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_SCENE_MARKER_TYPE_FILTER_MSFT
public static final int XR_TYPE_SCENE_MARKER_TYPE_FILTER_MSFTExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_SCENE_MARKER_QR_CODES_MSFT
public static final int XR_TYPE_SCENE_MARKER_QR_CODES_MSFTExtendsXrStructureType.Enum values:
- See Also:
-
XR_SCENE_MARKER_DATA_NOT_STRING_MSFT
public static final int XR_SCENE_MARKER_DATA_NOT_STRING_MSFTExtendsXrResult.- See Also:
-
XR_SCENE_MARKER_TYPE_QR_CODE_MSFT
public static final int XR_SCENE_MARKER_TYPE_QR_CODE_MSFTXrSceneMarkerTypeMSFT - Marker typeEnumerant Descriptions
SCENE_MARKER_TYPE_QR_CODE_MSFTrepresents a marker that follows the ISO standard for QR code in ISO/IEC 18004:2015.
See Also
- See Also:
-
XR_SCENE_MARKER_QR_CODE_SYMBOL_TYPE_QR_CODE_MSFT
public static final int XR_SCENE_MARKER_QR_CODE_SYMBOL_TYPE_QR_CODE_MSFTXrSceneMarkerQRCodeSymbolTypeMSFT - QR Code Symbol typeDescription
The
XrSceneMarkerQRCodeSymbolTypeMSFTidentifies the symbol type of the QR Code.Enumerant Descriptions
SCENE_MARKER_QR_CODE_SYMBOL_TYPE_QR_CODE_MSFTif the marker is a QR Code.SCENE_MARKER_QR_CODE_SYMBOL_TYPE_MICRO_QR_CODE_MSFTif the marker is a Micro QR Code.
See Also
- See Also:
-
XR_SCENE_MARKER_QR_CODE_SYMBOL_TYPE_MICRO_QR_CODE_MSFT
public static final int XR_SCENE_MARKER_QR_CODE_SYMBOL_TYPE_MICRO_QR_CODE_MSFTXrSceneMarkerQRCodeSymbolTypeMSFT - QR Code Symbol typeDescription
The
XrSceneMarkerQRCodeSymbolTypeMSFTidentifies the symbol type of the QR Code.Enumerant Descriptions
SCENE_MARKER_QR_CODE_SYMBOL_TYPE_QR_CODE_MSFTif the marker is a QR Code.SCENE_MARKER_QR_CODE_SYMBOL_TYPE_MICRO_QR_CODE_MSFTif the marker is a Micro QR Code.
See Also
- See Also:
-
-
Method Details
-
nxrGetSceneMarkerRawDataMSFT
public static int nxrGetSceneMarkerRawDataMSFT(XrSceneMSFT scene, long markerId, int bufferCapacityInput, long bufferCountOutput, long buffer) Unsafe version of:GetSceneMarkerRawDataMSFT- Parameters:
bufferCapacityInput- the capacity of the buffer, or 0 to indicate a request to retrieve the required capacity.
-
xrGetSceneMarkerRawDataMSFT
public static int xrGetSceneMarkerRawDataMSFT(XrSceneMSFT scene, XrUuidMSFT markerId, IntBuffer bufferCountOutput, @Nullable ByteBuffer buffer) Get the data stored in the scene marker.C Specification
The
GetSceneMarkerRawDataMSFTfunction is defined as:XrResult xrGetSceneMarkerRawDataMSFT( XrSceneMSFT scene, const XrUuidMSFT* markerId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, uint8_t* buffer);Description
The
GetSceneMarkerRawDataMSFTfunction retrieves the data stored in the scene marker.Valid Usage (Implicit)
- The
XR_MSFT_scene_markerextension must be enabled prior to callingGetSceneMarkerRawDataMSFT scenemust be a validXrSceneMSFThandlemarkerIdmust be a pointer to a validXrUuidMSFTstructurebufferCountOutputmust be a pointer to auint32_tvalue- If
bufferCapacityInputis not 0,buffermust be a pointer to an array ofbufferCapacityInputuint8_tvalues
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
scene- anXrSceneMSFTpreviously created byCreateSceneMSFT.markerId- anXrUuidMSFTidentifying the marker, and it is returned previous fromXrSceneComponentMSFTwhen callingGetSceneComponentsMSFT.bufferCountOutput- a pointer to the count of bytes written, or a pointer to the required capacity in the case that bufferCapacityInput is insufficient.buffer- a pointer to an application-allocated buffer that will be filled with the data stored in the QR Code. It can be NULL if bufferCapacityInput is 0.
- The
-
nxrGetSceneMarkerDecodedStringMSFT
public static int nxrGetSceneMarkerDecodedStringMSFT(XrSceneMSFT scene, long markerId, int bufferCapacityInput, long bufferCountOutput, long buffer) Unsafe version of:GetSceneMarkerDecodedStringMSFT- Parameters:
bufferCapacityInput- the capacity of the string buffer, or 0 to indicate a request to retrieve the required capacity.
-
xrGetSceneMarkerDecodedStringMSFT
public static int xrGetSceneMarkerDecodedStringMSFT(XrSceneMSFT scene, XrUuidMSFT markerId, IntBuffer bufferCountOutput, @Nullable ByteBuffer buffer) Get the string encoded in the scene marker.C Specification
The
GetSceneMarkerDecodedStringMSFTfunction is defined as:XrResult xrGetSceneMarkerDecodedStringMSFT( XrSceneMSFT scene, const XrUuidMSFT* markerId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer);Description
The
GetSceneMarkerDecodedStringMSFTfunction retrieves the string stored in the scene marker as an UTF-8 string, including the terminating '\0'. This function follows the two-call idiom for filling thebufferarray.If the stored data in the marker is not an encoded string, the runtime must return the success code
SCENE_MARKER_DATA_NOT_STRING_MSFT, setbufferCountOutputto 1, and makebufferan empty string.Valid Usage (Implicit)
- The
XR_MSFT_scene_markerextension must be enabled prior to callingGetSceneMarkerDecodedStringMSFT scenemust be a validXrSceneMSFThandlemarkerIdmust be a pointer to a validXrUuidMSFTstructurebufferCountOutputmust be a pointer to auint32_tvalue- If
bufferCapacityInputis not 0,buffermust be a pointer to an array ofbufferCapacityInputchar values
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
scene- anXrSceneMSFTpreviously created byCreateSceneMSFT.markerId- anXrUuidMSFTidentifying the marker, returned previously fromXrSceneComponentMSFT::idwhen callingGetSceneComponentsMSFT.bufferCountOutput- a pointer to the count of characters written (including the terminating '\0'), or a pointer to the required capacity in the case that bufferCapacityInput is insufficient.buffer- a pointer to an application-allocated buffer that will be filled with the string stored in the QR Code. It can be NULL if bufferCapacityInput is 0.
- The
-