using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ZIM;

/// <summary>
/// JC-补充接口
/// </summary>
public partial class ScreenLocate : MonoBehaviour
{
    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;
    }
    public void QuitScreenLocateManual(List<Vector2> points)
    {
        if (points != null && points.Count == 4)
        {
            screenIdentification.LocateScreenManual(
                new OrdinalQuadrilateral(
                    points[0].o0Vector(),
                    points[1].o0Vector(),
                    points[3].o0Vector(),
                    points[2].o0Vector()
                )
            );
        }
        ToMode(Mode.InfraredLocate);
    }
}
