Example #1
0
 void Init()
 {
     _videoValues         = new NetValueObject();
     Output               = new TxEyesOutput();
     Output.Configuration = new CameraConfigurations();
     //	if (ParameterController != null)
     //		ParameterController.TargetValueObject = _videoValues;
 }
Example #2
0
 public void UpdateValuesObject(NetValueObject obj)
 {
     SetValue(obj, "Camera.Gain", GainValue);
     SetValue(obj, "Camera.Brightness", BrightnessValue);
     SetValue(obj, "Camera.Gamma", GammaValue);
     SetValue(obj, "Camera.Exposure", ExposureValue);
     SetValue(obj, "Camera.Contrast", ContrastValue);
     SetValue(obj, "Camera.Saturation", SaturationValue);
     SetValue(obj, "Camera.WhiteBalance", WhiteBalanceValue);
 }
Example #3
0
    void SetValue(NetValueObject obj, string name, float val)
    {
        NetValueObject.ValueControllerCtl c = obj.GetValue(name);
        string value = val.ToString();

        if (val < 0)
        {
            value = "auto";
        }
        if (c != null)
        {
            c.value = value;
        }
    }
Example #4
0
 void Init()
 {
     _videoValues = new NetValueObject();
     //	if (ParameterController != null)
     //		ParameterController.TargetValueObject = _videoValues;
 }
 public ReceiveThread(NetValueObject o)
 {
     _owner=o;
 }
Example #6
0
    public void UpdateValuesObject(NetValueObject obj)
    {
        if (_gainValue == null)
        {
            _gainValue = obj.GetValue("Camera.Gain");
        }
        else
        {
            SetValue(_gainValue, GainValue);
        }

        if (_brightnessValue == null)
        {
            _brightnessValue = obj.GetValue("Camera.Brightness");
        }
        else
        {
            SetValue(_brightnessValue, BrightnessValue);
        }

        if (_contrastValue == null)
        {
            _contrastValue = obj.GetValue("Camera.Contrast");
        }
        else
        {
            SetValue(_contrastValue, ContrastValue);
        }

        if (_saturationValue == null)
        {
            _saturationValue = obj.GetValue("Camera.Saturation");
        }
        else
        {
            SetValue(_saturationValue, SaturationValue);
        }

        if (_wbValue == null)
        {
            _wbValue = obj.GetValue("Camera.WhiteBalance");
        }
        else
        {
            SetValue(_wbValue, WhiteBalanceValue);
        }

        if (_gammaValue == null)
        {
            _gammaValue = obj.GetValue("Camera.Gamma");
        }
        else
        {
            SetValue(_gammaValue, GammaValue);
        }

        if (_expValue == null)
        {
            _expValue = obj.GetValue("Camera.Exposure");
        }
        else
        {
            SetValue(_expValue, ExposureValue);
        }
    }
 public ReceiveThread(NetValueObject o)
 {
     _owner = o;
 }
    void Init()
    {
        CameraType = Settings.Instance.RobotSettings.ReadValue ("Camera", "Source", CameraType.ToString ())=="Local"?CameraSourceType.Local:CameraSourceType.Remote;
        if(CameraType==CameraSourceType.Local)
        {
            LocalWebcameraSource c;
            _cameraSource = (c=new LocalWebcameraSource());
            c.LeftInputCamera = Settings.Instance.RobotSettings.ReadValue ("Camera", "Left", 0);
            c.RightInputCamera = Settings.Instance.RobotSettings.ReadValue ("Camera", "Right", 1);
            c.Init();
        }else
        {
            MultipleNetworkCameraSource c;
            _cameraSource = (c=new MultipleNetworkCameraSource());
            c.StreamsCount=2;
            c.TargetNode=gameObject;
            c.Init();
        }

        if (AudioSupport) {
            _audioPlayer = new GstMultipleNetworkAudioPlayer ();
            _audioStreamer = gameObject.AddComponent<GstNetworkAudioStreamer> ();
            _audioStreamer.SetChannels(1);
            _audioStreamer.CreateStream();
        }

        EyeName[] eyes = new EyeName[]{EyeName.RightEye,EyeName.LeftEye};
        TelubeeCameraRenderer[] Targets = new TelubeeCameraRenderer[]{TargetEyeRight,TargetEyeLeft};
        if (OculusCamera != null)
        {
            Camera[] cams = new Camera[] { OculusCamera.rightEyeCamera, OculusCamera.leftEyeCamera };
        //	Vector2[] pixelShift = new Vector2[] { Configuration.CamSettings.PixelShiftRight,Configuration.CamSettings.PixelShiftLeft};
            for (int c = 0; c < cams.Length; ++c)
            {
                int i = (int)eyes[c];
                cams[i].backgroundColor=Color.black;

            //	CreateMesh ((EyeName)i);
                TelubeeCameraRenderer r = Targets[i];
                if(r==null)
                    r=cams[i].gameObject.AddComponent<TelubeeCameraRenderer>();
                r.Mat = Object.Instantiate(TargetMaterial);
                r.DisplayCamera=cams[i];
                r.Src = this;
                r.CamSource = _cameraSource;

                r.CreateMesh(eyes[c]);

                _camRenderer[i]=r;

                if (i == 0)
                {
                    r._RenderPlane.layer=LayerMask.NameToLayer("RightEye");
                }
                else
                {
                    r._RenderPlane.layer=LayerMask.NameToLayer("LeftEye");
                }
                if(Targets[i]==null)
                {
                    r._RenderPlane.transform.parent = cams[i].transform;
                    r._RenderPlane.transform.localRotation=Quaternion.identity;
                    r._RenderPlane.transform.localPosition=new Vector3(0,0,1);
                }
            }
        }

        _videoValues=new NetValueObject();
        if (ParameterController != null)
            ParameterController.TargetValueObject = _videoValues;
    }