| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 | 
							- using System.Collections.Generic;
 
- using UnityEngine;
 
- using ZIM.Unity;
 
- using o0InfraredLocate.ZIM;
 
- /// <summary>
 
- /// JC-补充接口
 
- /// </summary>
 
- public partial class ScreenLocate
 
- {
 
-     public bool IsScreenLoateOK()
 
-     {
 
-         return screenIdentification != null &&
 
-             screenIdentification.Screen != null &&
 
-             screenIdentification.Screen.Active;
 
-     }
 
-     public bool IsScreenLocateManualDoing()
 
-     {
 
-         return mode == Mode.ScreenLocateManual;
 
-     }
 
-     public Texture2D EnterScreenLocateManual()
 
-     {
 
-         CreateUVCTexture2DIfNeeded();
 
-         Texture2D texture = mUVCTexture2D.zimAutoLight(0);
 
-         mode = Mode.ScreenLocateManual;
 
-         return texture;
 
-     }
 
-     /// <summary>
 
-     /// 屏幕定位时候的实际点转换成算法里面的点
 
-     /// 左下、右下、右上、左上 => 左下,右下,左上,右上 (算法)
 
-     /// </summary>
 
-     /// <param name="points"></param>
 
-     public void QuitScreenLocateManual(List<Vector2> points)
 
-     {
 
-         if (points != null && points.Count == 4)
 
-         {
 
-             var size = getUVCCameraInfoSize;
 
-             Debug.Log("QuitScreenLocateManual Size:" + size);
 
-             var quad = new QuadrilateralInCamera(
 
-               new o0.Geometry2D.Float.Vector(points[0].x * size.x, points[0].y * size.y),
 
-               new o0.Geometry2D.Float.Vector(points[1].x * size.x, points[1].y * size.y),
 
-               new o0.Geometry2D.Float.Vector(points[3].x * size.x, points[3].y * size.y),
 
-               new o0.Geometry2D.Float.Vector(points[2].x * size.x, points[2].y * size.y),
 
-               size.o0Vector());
 
-             //screenIdentification?.SetScreenQuad(quad);
 
-             screenIdentification.QuadManual = quad;
 
-             Debug.Log($"[ScreenLocate] 记录手动数据: {quad}");
 
-         }
 
-         ToMode(Mode.InfraredLocate);
 
-     }
 
-     /// <summary>
 
-     /// 传入算法对应的点来设置算法屏幕四边形
 
-     /// </summary>
 
-     /// <param name="points"></param>
 
-     public void QuadUnityVectorListToScreenQuad(List<Vector2> points)
 
-     {
 
-         if (points != null && points.Count == 4)
 
-         {
 
-             var size = getUVCCameraInfoSize;
 
-             screenIdentification?.SetScreenQuad(
 
-                 new QuadrilateralInCamera(
 
-                     new o0.Geometry2D.Float.Vector(points[0].x * size.x, points[0].y * size.y),
 
-                     new o0.Geometry2D.Float.Vector(points[1].x * size.x, points[1].y * size.y),
 
-                     new o0.Geometry2D.Float.Vector(points[2].x * size.x, points[2].y * size.y),
 
-                     new o0.Geometry2D.Float.Vector(points[3].x * size.x, points[3].y * size.y),
 
-                     size.o0Vector()
 
-                 )
 
-             );
 
-         }
 
-         ToMode(Mode.InfraredLocate);
 
-     }
 
-     /// <summary>
 
-     /// 自动校准
 
-     /// </summary>
 
-     public void EnterScreenLocateManualAuto()
 
-     {
 
-         //自动定位时候,清除一下记录的点
 
-         //quadUnityVectorList.Clear();
 
-         //InfraredCameraHelper?.InvokeOnUVCPosUpdate(quadUnityVectorList);
 
-         BtnScreenLocate();
 
-     }
 
-     /// <summary>
 
-     /// 设置Capture值,测试用
 
-     /// </summary>
 
-     /// <param name="value"></param>
 
-     public void SetCapture(int value)
 
-     {
 
-         Capture = value;
 
-     }
 
-     /// <summary>
 
-     /// 设置Delay值,测试用
 
-     /// </summary>
 
-     /// <param name="value"></param>
 
-     public void SetDelay(int value)
 
-     {
 
-         Delay = value;
 
-     }
 
-     /// <summary>
 
-     /// 校准点位置同步到[调试面板]
 
-     /// </summary>
 
-     public void SyncInfraredDemo()
 
-     {
 
-         if (quadUnityVectorList.Count == 0) return;
 
-         // Vector2 texSize = getUVCCameraInfoSize;
 
-         Debug.Log("[ScreenLocate] SyncInfraredDemo : " + PrintVector2List(quadUnityVectorList));
 
-         //同步到infaredDemo
 
-         FindObjectOfType<InfraredDemo>()?.SetLocatePointsToCameraRender(
 
-             quadUnityVectorList,
 
-             1,
 
-             1);
 
-     }
 
-     /// <summary>
 
-     /// 校准点位置同步到[手动校准页面]
 
-     /// </summary>
 
-     public void SyncInfraredScreenPositioningView()
 
-     {
 
-         if (quadUnityVectorList.Count == 0) return;
 
-         //同步位置
 
-         FindObjectOfType<InfraredScreenPositioningView>()?.SyncScreenPosition();
 
-     }
 
- }
 
 
  |