コード例 #1
0
    void _processNewFrame()
    {
        _newFrame = false;
        if (m_Texture.PlayerTexture().Length == 0)
        {
            return;
        }

        SourceTexture = m_Texture.PlayerTexture() [0];

        if (ConvertToRGB)
        {
            if (m_Texture.PlayerTexture() [0].format == TextureFormat.Alpha8)
            {
                VideoTexture = _Processor.ProcessTexture(SourceTexture);
            }
            else
            {
                VideoTexture = SourceTexture;
            }
        }
        else
        {
            VideoTexture = SourceTexture;
        }
        //material.mainTexture = VideoTexture;

        if (OnFrameAvailable != null)
        {
            OnFrameAvailable(this, VideoTexture);
        }
    }
コード例 #2
0
    void _processNewFrame()
    {
        _newFrame = false;
        if (m_Texture.PlayerTexture().Length == 0)
        {
            return;
        }

        Texture tex = m_Texture.PlayerTexture() [0];

        if (ConvertToRGB)
        {
            if (m_Texture.PlayerTexture() [0].format == TextureFormat.Alpha8)
            {
                frame = _Processor.ProcessTexture(tex);
            }
            else
            {
                frame = tex;
            }
        }
        else
        {
            frame = tex;
        }

        if (_postProcessors != null)
        {
            foreach (var p in _postProcessors)
            {
                frame = p.ProcessTexture(VideoTexture);
            }
        }
        //List<CustomRenderTextureUpdateZone> zones = new List<CustomRenderTextureUpdateZone>();
        //VideoTexture.GetUpdateZones(zones);
        //Graphics.Blit(frame, (RenderTexture)zones[0]);
        //Graphics.Blit(frame, VideoTexture);
        int srcX      = 0;
        int srcY      = 0;
        int srcWidth  = frameWidth;
        int srcHeight = 1440;
        int dstX      = 0;
        int dstY      = 0;
        int offset    = 2880 / 4; //actual frame is half total width, centered

        Graphics.CopyTexture(frame, 0, 0, srcX + offset, srcY, srcWidth, srcHeight, VideoTexture,
                             0, 0, dstX, dstY);

        if (OnFrameAvailable != null)
        {
            OnFrameAvailable(this, VideoTexture);
        }
    }
コード例 #3
0
ファイル: FileAVProvider.cs プロジェクト: red-pencil/ISWC18
    public override Texture GetTexture(int stream)
    {
        if (_texture.PlayerTexture() == null || _texture.PlayerTexture().Length == 0)
        {
            return(null);
        }

        if (_needProcessing)
        {
            _Processor.ProcessTexture(_texture.PlayerTexture() [0]);
            _needProcessing = false;
        }
        //return m_Texture.PlayerTexture [(int)e];
        return(_Processor.ResultTexture);
    }
コード例 #4
0
    void _processNewFrame()
    {
        _newFrame = false;
        if (m_Texture.PlayerTexture().Length == 0)
        {
            return;
        }

        Texture tex = m_Texture.PlayerTexture() [0];

        if (ConvertToRGB)
        {
            if (m_Texture.PlayerTexture() [0].format == TextureFormat.Alpha8)
            {
                VideoTexture = _Processor.ProcessTexture(tex);
            }
            else
            {
                VideoTexture = tex;
            }
        }
        else
        {
            VideoTexture = tex;
        }

        if (_postProcessors != null)
        {
            foreach (var p in _postProcessors)
            {
                VideoTexture = p.ProcessTexture(VideoTexture);
            }
        }
        material.mainTexture = VideoTexture;

        if (OnFrameAvailable != null)
        {
            OnFrameAvailable(this, VideoTexture);
        }
    }
コード例 #5
0
 public Texture GetRawEyeTexture(int e)
 {
     if (m_Texture == null || m_Texture.PlayerTexture() == null || m_Texture.PlayerTexture().Length == 0)
     {
         return(null);
     }
     return(m_Texture.PlayerTexture() [0]);
 }