Beispiel #1
0
    public void _createImageProcessor()
    {
        var t = _getTargetImageProcessorType();

        if (_imageProcessor != null && t == _currImageProcessorType)
        {
            _imageProcessor.Invalidate();
            return;
        }
        _currImageProcessorType = t;
        if (_imageProcessor != null)
        {
            _imageProcessor.Destroy();
        }
        _imageProcessor = null;
        if (_currImageProcessorType == typeof(TxOVRVisionImageProcessor))
        {
            var proc = new TxOVRVisionImageProcessor(this);
            _imageProcessor    = proc;
            proc._optimizedOVR = Configuration.CamSettings.OptimizeOVRVision;
            Output._eyesCoords = new Rect[1] {
                new Rect(0, 0, 1, 1)
            };
            Output._scalingFactor = new Vector2[1] {
                new Vector2(1, 1)
            };
        }
        else if (_currImageProcessorType == typeof(TxFoveatedRenderingImageProcessor))
        {
            _imageProcessor = new TxFoveatedRenderingImageProcessor(this);
        }
        else if (_currImageProcessorType == typeof(TxOVRFoveatedRenderingImageProcessor))
        {
            _imageProcessor    = new TxOVRFoveatedRenderingImageProcessor(this);
            Output._eyesCoords = new Rect[1] {
                new Rect(0, 0, 1, 1)
            };
            Output._scalingFactor = new Vector2[1] {
                new Vector2(1, 1)
            };
        }
        else if (_currImageProcessorType == typeof(TxGeneralImageProcessor))
        {
            _imageProcessor = new TxGeneralImageProcessor(this);
        }
    }
Beispiel #2
0
    void OnRobotDisconnected()
    {
        if (_cameraSource != null)
        {
            _cameraSource.Close();
            _cameraSource = null;
        }

        if (_imageProcessor != null)
        {
            _imageProcessor.Destroy();
            _imageProcessor = null;
        }

        for (int i = 0; i < Output.TexturesCount; ++i)
        {
            Output.SetTexture(TxEyesOutput.NullTexture, i);
        }

        _cameraProfile = "";
        _camsInited    = false;
    }