예제 #1
0
        protected override void OnClipInitializing(FilterInitializationEventArgs e)
        {
            base.OnClipInitializing(e);

            if (this.Source.Filter != null)
                this.Clip = this.Source.Filter.Clip;
            else
                this.Clip = new Clip();
        }
예제 #2
0
        protected override void OnClipInitializing(FilterInitializationEventArgs e)
        {
            base.OnClipInitializing(e);

            if (this.Source.Filter != null)
            {
                this.Clip = this.Source.Filter.Clip;
            }
            else
            {
                this.Clip = new Clip();
            }
        }
예제 #3
0
        /// <summary>
        /// Raises the <see cref="Filter.Initializing"/> event.
        /// </summary>
        /// <param name="e">Event data associated with the event.</param>
        protected virtual void OnClipInitializing(FilterInitializationEventArgs e)
        {
            if (this.Initializing != null)
            {
                this.Initializing(this, e);
            }

            if (this.inputs.Default != null && this.inputs.Default.Filter != null)
            {
                this.Clip = this.inputs.Default.Filter.Clip;
            }
            else
            {
                this.Clip = new Clip();
            }
        }
예제 #4
0
        /// <summary>
        /// Readies the filter for use.
        /// </summary>
        /// <returns>true if everything went okay; otherwise false.</returns>
        public bool InitializeClip()
        {
            Contract.Ensures(this.IsClipInitialized == true);

            var e = new FilterInitializationEventArgs();

            this.OnClipInitializing(e);

            if (e.Succeeded)
            {
                this.isClipInitialized = true;
            }
            else
            {
                throw new NotImplementedException();
            }

            return(this.IsClipInitialized);
        }
예제 #5
0
        protected override void OnClipInitializing(FilterInitializationEventArgs e)
        {
            base.OnClipInitializing(e);

            using (var stream = this.OpenStreamForFrame(0))
            {
                using (var decoder = new TGADecoder(stream))
                {
                    decoder.Initialize();
                    var context = decoder.DecodeHeader();
                    var header = context.Header;
                    var track = new VideoTrack()
                    {
                        SampleCount = 1,
                        SamplesPerFrame = 1,
                        Width = header.Width,
                        Height = header.Height,
                    };

                    //track.Format =
                    if (header.BitsPerPixel == 24)
                        track.Format = ColorFormat.RGB24;
                    else
                        track.Format = ColorFormat.RGB32;

                    track.SamplesPerFrame = 1;
                    track.SampleCount = 1;

                    /*
                    var track = new VideoTrack();
                    track.SampleCount = 1;
                    track.Width = bitmap.Width;
                    track.Height = bitmap.Height;
                    track.Format = bitmap.Format;
                    track.SamplesPerFrame = 1;
                    track.Options = TrackOptions.Infinite;
                    */

                    this.Clip = new Clip(track);
                }
            }
        }
예제 #6
0
 protected override void OnClipInitializing(FilterInitializationEventArgs e)
 {
     base.OnClipInitializing(e);
 }