Ejemplo n.º 1
0
 public static void CaptureFrame(Texture2D frame)
 {
     // Check
     if (!IsPlaying)
     {
         Debug.LogError("NatCam Error: Cannot capture frame when preview is not running");
         return;
     }
     if (!frame)
     {
         Debug.LogError("NatCam Error: Cannot capture frame to null texture");
         return;
     }
     if (frame.width != Preview.width || frame.height != Preview.height)
     {
         Debug.LogError("NatCam Error: Texture size must match that of NatCam.Preview");
         return;
     }
     if (frame.format != TextureFormat.RGBA32)
     {
         Debug.LogWarning("NatCam: Frame texture format should be RGBA32");
     }
     // Pass to implementation
     Implementation.CaptureFrame(frame);
 }
Ejemplo n.º 2
0
 public static void CaptureFrame(byte[] pixels)
 {
     // Check
     if (!IsRunning)
     {
         Debug.LogError("NatCam Error: Cannot capture frame when preview is not running");
         return;
     }
     if (pixels == null)
     {
         Debug.LogError("NatCam Error: Cannot capture frame to null pixel buffer");
         return;
     }
     // Pass to implementation
     Implementation.CaptureFrame(pixels);
 }