Example #1
0
        public virtual void Render(ITextureCache cache)
        {
            if (Updated)
            {
                return;
            }

            Updated = true;

            foreach (var filter in InputFilters)
            {
                filter.Render(cache);
            }

            var inputTextures = InputFilters.Select(f => f.OutputTexture);

            OutputTexture = cache.GetTexture(OutputSize);

            Render(inputTextures);

            foreach (var filter in InputFilters)
            {
                if (filter.LastDependentIndex <= FilterIndex)
                {
                    filter.Reset(cache);
                }
            }
        }
Example #2
0
        public void Render()
        {
            if (Updated)
            {
                return;
            }

            Updated = true;

            foreach (var filter in InputFilters)
            {
                filter.Render();
            }

            var inputTextures =
                InputFilters
                .Select(f => f.OutputTexture)
                .ToList();

            OutputTarget = TexturePool.GetTexture(OutputSize, OutputFormat);

            Render(inputTextures);

            foreach (var filter in InputFilters)
            {
                if (filter.LastDependentIndex <= FilterIndex)
                {
                    filter.Reset();
                }
            }
        }
Example #3
0
        public void Render()
        {
            if (m_Updated)
            {
                return;
            }

            m_Updated = true;
            m_Output  = Output;

            foreach (var filter in InputFilters)
            {
                filter.Render();
            }

            var inputs =
                InputFilters
                .Select(f => f.Output)
                .ToList();

            Output.Allocate();

            Render(inputs);

            foreach (var filter in InputFilters.Where(filter => filter.LastDependentIndex <= m_FilterIndex))
            {
                filter.Reset();
            }
        }
Example #4
0
        public IFilter <TOutput> Compile()
        {
            if (m_CompilationResult != null)
            {
                return(m_CompilationResult);
            }

            m_OriginalInputFilters = InputFilters;
            InputFilters           = InputFilters
                                     .Select(x => x.Compile())
                                     .ToArray();

            m_CompilationResult = Optimize();
            return(m_CompilationResult);
        }
Example #5
0
        protected Filter(TOutput output, params IFilter <TInput>[] inputFilters)
        {
            if (inputFilters == null || inputFilters.Any(f => f == null))
            {
                throw new ArgumentNullException("inputFilters");
            }

            m_Initialized       = false;
            m_CompilationResult = null;
            m_InputFilters      = inputFilters;

            m_Output = output;

            m_ProcessData = new ProcessData();
            ProcessData.AddInputs(InputFilters.Select(f => f.ProcessData));
        }