GetPixels() public method

Get a block of pixel colors.

public GetPixels ( ) : UnityEngine.Color[]
return UnityEngine.Color[]
Example #1
0
 static public int GetPixels(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             UnityEngine.WebCamTexture self = (UnityEngine.WebCamTexture)checkSelf(l);
             var ret = self.GetPixels();
             pushValue(l, ret);
             return(1);
         }
         else if (argc == 5)
         {
             UnityEngine.WebCamTexture self = (UnityEngine.WebCamTexture)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             System.Int32 a3;
             checkType(l, 4, out a3);
             System.Int32 a4;
             checkType(l, 5, out a4);
             var ret = self.GetPixels(a1, a2, a3, a4);
             pushValue(l, ret);
             return(1);
         }
         LuaDLL.luaL_error(l, "No matched override function to call");
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #2
0
 static public int GetPixels(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             UnityEngine.WebCamTexture self = (UnityEngine.WebCamTexture)checkSelf(l);
             var ret = self.GetPixels();
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 5)
         {
             UnityEngine.WebCamTexture self = (UnityEngine.WebCamTexture)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             System.Int32 a3;
             checkType(l, 4, out a3);
             System.Int32 a4;
             checkType(l, 5, out a4);
             var ret = self.GetPixels(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function GetPixels to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Example #3
0
 static public int GetPixels(IntPtr l)
 {
     try {
         UnityEngine.WebCamTexture self = (UnityEngine.WebCamTexture)checkSelf(l);
         var ret = self.GetPixels();
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #4
0
 static public int GetPixels__Int32__Int32__Int32__Int32(IntPtr l)
 {
     try {
         UnityEngine.WebCamTexture self = (UnityEngine.WebCamTexture)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         System.Int32 a2;
         checkType(l, 3, out a2);
         System.Int32 a3;
         checkType(l, 4, out a3);
         System.Int32 a4;
         checkType(l, 5, out a4);
         var ret = self.GetPixels(a1, a2, a3, a4);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    // Use this for initialization
    void Start()
    {
        GameObject timestreamGo = GameObject.Find("TimeStream");
        tss = timestreamGo.GetComponent<TimeStreamScript>();

        counter = PlayerPrefs.GetInt("videoInterval");
        audioCounter = PlayerPrefs.GetInt("audioInterval");

        centerLabelStyle = new GUIStyle(skin.label);
        centerLabelStyle.alignment = TextAnchor.MiddleCenter;

        //		Debug.Log(PlayerPrefs.GetString("captureVideo"));
        if (IsTrue(PlayerPrefs.GetString("captureVideo"))) {
            Debug.Log("captureVideo on");
            webCamDevice = new WebCamDevice();

            webcamTexture = new WebCamTexture(webCamDevice.name,1024,768,1);
        //		renderer.material.mainTexture = webcamTexture;
            webcamTexture.Play();

            cubeTexture = new Texture2D(webcamTexture.width, webcamTexture.height, TextureFormat.RGB24, false);
            photoCube.renderer.material.mainTexture = cubeTexture;

            videoCube.renderer.material.mainTexture = webcamTexture;

            Color[] cols = webcamTexture.GetPixels();
            cubeTexture.SetPixels(cols);	//(Texture2D)Instantiate(webcamTexture);
            cubeTexture.Apply();
            StartCoroutine(DecrementCounter());
        }

        if (IsTrue(PlayerPrefs.GetString("captureAudio"))) {
            Debug.Log("captureAudio on");
            if (audioCounter > 0) {
                StartCoroutine(DecrementAudioCounter());
            } else {
                StartCoroutine(DecrementAudioCounter2());
            }
        }

        if (IsTrue(PlayerPrefs.GetString("captureAccel"))) {
            Debug.Log("captureAccel on");
            StartCoroutine(AccelSampleCounter());
            StartCoroutine(AccelStoreCounter());
        }

        DateTime dt = DateTime.Now;
        //		sessionInfo = SetupEventHandlerScript.session+"\n"+SetupEventHandlerScript.location+"\n"+dt.ToString(@"d/M/yyyy HH:mm");	//.ToString();
        sessionInfo = PlayerPrefs.GetString("session")+"\n"+PlayerPrefs.GetString("location")+"\n"+dt.ToString(@"d/M/yyyy HH:mm");	//.ToString();
    }