Beispiel #1
0
        protected override void DoProcessing(FilterProcessingContext inputFrames, Frame outputFrame)
        {
            Console.WriteLine("decoding tga frame");

            using (var stream = this.OpenStreamForFrame(0))
            {
                using (var decoder = new TGADecoder(stream))
                {
                    decoder.Initialize();
                    decoder.Decode(outputFrame);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets the <see cref="Frame"/> from this filter with the specified index.
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public Frame GetFrame(long index)
        {
            Contract.Ensures(Contract.Result <Frame>() != null);

            var context = new FilterProcessingContext(this, index);

            foreach (var slot in this.inputs.Where(i => i.Filter != null))
            {
                foreach (var offset in this.GetInputFramesRequired(slot, index))
                {
                    context.SetFrame(slot.Name, offset, slot.Filter.GetFrame(index + offset));
                }
            }

            var outputFrame = this.Clip.IssueFrame();

            this.DoProcessing(context, outputFrame);

            return(outputFrame);
        }
Beispiel #3
0
 public FilterProcessAsyncResult(long index, FilterProcessingContext inputs, AsyncCallback callback, object state, object owner, string operationId)
     : base(callback, state, owner, operationId)
 {
     this.Index   = index;
     this.Context = inputs;
 }
Beispiel #4
0
 /// <summary>
 /// When overridden in a derived class, performs the appropriate processing work and writes the results to
 /// the <paramref name="outputFrame"/>.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="outputFrame"></param>
 protected virtual void DoProcessing(FilterProcessingContext context, Frame outputFrame)
 {
     // Do nothing.
 }
Beispiel #5
0
 protected override void DoProcessing(NSynth.FilterProcessingContext inputFrames, NSynth.Frame outputFrame)
 {
     base.DoProcessing(inputFrames, outputFrame);
 }