コード例 #1
0
        //Todo

        /*
         #region Callback
         * private static void DistortedDataCallback(int key)
         * {
         *  for (int i = 0; i < DataInfoDistorted.Length; i++) ViveSR_Framework.GetPointer(key, i, ref DataInfoDistorted[i].ptr);
         *  ParseDistortedPtrData();
         * }
         * private static void UndistortedDataCallback(int key)
         * {
         *  for (int i = 0; i < DataInfoUndistorted.Length; i++) ViveSR_Framework.GetPointer(key, i, ref DataInfoUndistorted[i].ptr);
         *  ParseUndistortedPtrData();
         * }
         * private static void DepthDataCallback(int key)
         * {
         *  for (int i = 0; i < DataInfoDepth.Length; i++) ViveSR_Framework.GetPointer(key, i, ref DataInfoDepth[i].ptr);
         *  ParseDepthPtrData();
         * }
         #endregion
         */

        #region Parse the pointer
        private static void ParseDistortedPtrData()
        {
            if (SeeThrough.SRWork_SeeThrough.b4KImageReady)
            {
                RawDistortedFrameIndex[0] = SeeThrough.SRWork_SeeThrough.see_through_4k_data_.output4k_frameSeq;
                RawDistortedTimeIndex[0]  = SeeThrough.SRWork_SeeThrough.see_through_4k_data_.output4k_timeStp;
                Marshal.Copy(SeeThrough.SRWork_SeeThrough.see_through_4k_data_.output4k_pose_left, RawDistortedPoseLeft, 0, RawDistortedPoseLeft.Length);
                Marshal.Copy(SeeThrough.SRWork_SeeThrough.see_through_4k_data_.output4k_pose_right, RawDistortedPoseRight, 0, RawDistortedPoseRight.Length);
            }
            else
            {
                RawDistortedFrameIndex[0] = SeeThrough.SRWork_SeeThrough.see_through_data_.frame_Seq;
                RawDistortedTimeIndex[0]  = SeeThrough.SRWork_SeeThrough.see_through_data_.time_Stp;
                Marshal.Copy(SeeThrough.SRWork_SeeThrough.see_through_data_.pose_left, RawDistortedPoseLeft, 0, RawDistortedPoseLeft.Length);
                Marshal.Copy(SeeThrough.SRWork_SeeThrough.see_through_data_.pose_right, RawDistortedPoseRight, 0, RawDistortedPoseRight.Length);
            }

            for (int i = 0; i < 4; i++)
            {
                DistortedPoseLeft.SetColumn(i, new Vector4(RawDistortedPoseLeft[i * 4 + 0], RawDistortedPoseLeft[i * 4 + 1],
                                                           RawDistortedPoseLeft[i * 4 + 2], RawDistortedPoseLeft[i * 4 + 3]));
                DistortedPoseRight.SetColumn(i, new Vector4(RawDistortedPoseRight[i * 4 + 0], RawDistortedPoseRight[i * 4 + 1],
                                                            RawDistortedPoseRight[i * 4 + 2], RawDistortedPoseRight[i * 4 + 3]));
            }
        }
コード例 #2
0
        private static void ParseDistortedPtrData()
        {
            Marshal.Copy(DataInfoDistorted[(int)SeeThroughDataMask.FRAME_SEQ].ptr, RawDistortedFrameIndex, 0, RawDistortedFrameIndex.Length);
            Marshal.Copy(DataInfoDistorted[(int)SeeThroughDataMask.TIME_STP].ptr, RawDistortedTimeIndex, 0, RawDistortedTimeIndex.Length);
            Marshal.Copy(DataInfoDistorted[(int)SeeThroughDataMask.POSE_LEFT].ptr, RawDistortedPoseLeft, 0, RawDistortedPoseLeft.Length);
            Marshal.Copy(DataInfoDistorted[(int)SeeThroughDataMask.POSE_RIGHT].ptr, RawDistortedPoseRight, 0, RawDistortedPoseRight.Length);

            for (int i = 0; i < 4; i++)
            {
                DistortedPoseLeft.SetColumn(i, new Vector4(RawDistortedPoseLeft[i * 4 + 0], RawDistortedPoseLeft[i * 4 + 1],
                                                           RawDistortedPoseLeft[i * 4 + 2], RawDistortedPoseLeft[i * 4 + 3]));
                DistortedPoseRight.SetColumn(i, new Vector4(RawDistortedPoseRight[i * 4 + 0], RawDistortedPoseRight[i * 4 + 1],
                                                            RawDistortedPoseRight[i * 4 + 2], RawDistortedPoseRight[i * 4 + 3]));
            }
        }