@@ -382,20 +382,20 @@ Pipeline& Pipeline::uv2Cam(const std::shared_ptr<PipelineTensor>& uv, const std:
382382 const std::shared_ptr<PipelineTensor>& rightImg,
383383 const std::shared_ptr<PipelineTensor>& result) {
384384 // Check for null pointers
385- CHECK_MSG (uv != nullptr , " uv2Cam uvPlaceholder1 is null" );
386- CHECK_MSG (timestamp != nullptr , " uv2Cam timestampPlaceholder1 is null" );
387- CHECK_MSG (cameraMatrix != nullptr , " uv2Cam cameraMatrixPlaceholder1 is null" );
388- CHECK_MSG (leftImg != nullptr , " uv2Cam leftImagePlaceholder is null" );
389- CHECK_MSG (rightImg != nullptr , " uv2Cam rightImagePlaceholder is null" );
390- CHECK_MSG (result != nullptr , " uv2Cam pointXYZ is null" );
385+ CHECK_MSG (uv != nullptr , " uv2Cam uvPlaceholder1 is null" )
386+ CHECK_MSG (timestamp != nullptr , " uv2Cam timestampPlaceholder1 is null" )
387+ CHECK_MSG (cameraMatrix != nullptr , " uv2Cam cameraMatrixPlaceholder1 is null" )
388+ CHECK_MSG (leftImg != nullptr , " uv2Cam leftImagePlaceholder is null" )
389+ CHECK_MSG (rightImg != nullptr , " uv2Cam rightImagePlaceholder is null" )
390+ CHECK_MSG (result != nullptr , " uv2Cam pointXYZ is null" )
391391
392392 XrSecureMrOperatorPICO opHandle = XR_NULL_HANDLE;
393393 XrSecureMrOperatorUVTo3DPICO uvTo3DOperatorPico{XR_TYPE_SECURE_MR_OPERATOR_UV_TO_3D_PICO, nullptr };
394394 XrSecureMrOperatorCreateInfoPICO uvTo3DCreateInfoPico{
395395 XR_TYPE_SECURE_MR_OPERATOR_CREATE_INFO_PICO, nullptr ,
396396 reinterpret_cast <XrSecureMrOperatorBaseHeaderPICO*>(&uvTo3DOperatorPico),
397397 XR_SECURE_MR_OPERATOR_TYPE_UV_TO_3D_IN_CAM_SPACE_PICO};
398- CHECK_XRCMD (xrCreateSecureMrOperatorPICO (m_handle, &uvTo3DCreateInfoPico, &opHandle));
398+ CHECK_XRCMD (xrCreateSecureMrOperatorPICO (m_handle, &uvTo3DCreateInfoPico, &opHandle))
399399
400400 CHECK_XRCMD (xrSetSecureMrOperatorOperandByNamePICO (m_handle, opHandle, (XrSecureMrPipelineTensorPICO)*uv, " uv" ))
401401 CHECK_XRCMD (
@@ -587,6 +587,62 @@ Pipeline& Pipeline::sortMatByColumn(const std::shared_ptr<PipelineTensor>& srcMa
587587 return *this ;
588588}
589589
590+ Pipeline& Pipeline::singularValueDecomposition (const std::shared_ptr<PipelineTensor>& src,
591+ const std::shared_ptr<PipelineTensor>& result_w,
592+ const std::shared_ptr<PipelineTensor>& result_u,
593+ const std::shared_ptr<PipelineTensor>& result_vt) {
594+ XrSecureMrOperatorPICO opHandle = XR_NULL_HANDLE;
595+ XrSecureMrOperatorCreateInfoPICO operatorCreateInfo{
596+ .type = XR_TYPE_SECURE_MR_OPERATOR_CREATE_INFO_PICO,
597+ .operatorType = XR_SECURE_MR_OPERATOR_TYPE_SVD_PICO,
598+ };
599+ CHECK_XRCMD (xrCreateSecureMrOperatorPICO (m_handle, &operatorCreateInfo, &opHandle))
600+ xrSetSecureMrOperatorOperandByNamePICO (m_handle, opHandle, static_cast <XrSecureMrPipelineTensorPICO>(*src), " src" );
601+ if (result_w != nullptr ) {
602+ xrSetSecureMrOperatorResultByNamePICO (m_handle, opHandle, static_cast <XrSecureMrPipelineTensorPICO>(*result_w),
603+ " w" );
604+ }
605+ if (result_u != nullptr ) {
606+ xrSetSecureMrOperatorResultByNamePICO (m_handle, opHandle, static_cast <XrSecureMrPipelineTensorPICO>(*result_u),
607+ " u" );
608+ }
609+ if (result_vt != nullptr ) {
610+ xrSetSecureMrOperatorResultByNamePICO (m_handle, opHandle, static_cast <XrSecureMrPipelineTensorPICO>(*result_vt),
611+ " vt" );
612+ }
613+ return *this ;
614+ }
615+
616+ Pipeline& Pipeline::norm (const std::shared_ptr<PipelineTensor>& src,
617+ const std::shared_ptr<PipelineTensor>& result_norm) {
618+ XrSecureMrOperatorPICO opHandle = XR_NULL_HANDLE;
619+ XrSecureMrOperatorCreateInfoPICO operatorCreateInfo{
620+ .type = XR_TYPE_SECURE_MR_OPERATOR_CREATE_INFO_PICO,
621+ .operatorType = XR_SECURE_MR_OPERATOR_TYPE_NORM_PICO,
622+ };
623+ CHECK_XRCMD (xrCreateSecureMrOperatorPICO (m_handle, &operatorCreateInfo, &opHandle))
624+ xrSetSecureMrOperatorOperandByNamePICO (m_handle, opHandle, static_cast <XrSecureMrPipelineTensorPICO>(*src),
625+ " operand0" );
626+ xrSetSecureMrOperatorResultByNamePICO (m_handle, opHandle, static_cast <XrSecureMrPipelineTensorPICO>(*result_norm),
627+ " result0" );
628+ return *this ;
629+ }
630+
631+ Pipeline& Pipeline::convertHWC_CHW (const std::shared_ptr<PipelineTensor>& src,
632+ const std::shared_ptr<PipelineTensor>& result) {
633+ XrSecureMrOperatorPICO opHandle = XR_NULL_HANDLE;
634+ XrSecureMrOperatorCreateInfoPICO operatorCreateInfo{
635+ .type = XR_TYPE_SECURE_MR_OPERATOR_CREATE_INFO_PICO,
636+ .operatorType = XR_SECURE_MR_OPERATOR_TYPE_SWAP_HWC_CHW_PICO,
637+ };
638+ CHECK_XRCMD (xrCreateSecureMrOperatorPICO (m_handle, &operatorCreateInfo, &opHandle))
639+ xrSetSecureMrOperatorOperandByNamePICO (m_handle, opHandle, static_cast <XrSecureMrPipelineTensorPICO>(*src),
640+ " operand0" );
641+ xrSetSecureMrOperatorResultByNamePICO (m_handle, opHandle, static_cast <XrSecureMrPipelineTensorPICO>(*result),
642+ " result0" );
643+ return *this ;
644+ }
645+
590646Pipeline& Pipeline::inversion (const std::shared_ptr<PipelineTensor>& srcMat,
591647 const std::shared_ptr<PipelineTensor>& result_inverted) {
592648 XrSecureMrOperatorPICO opHandle = XR_NULL_HANDLE;
0 commit comments