/// <summary>
        /// Copy the input image into the back buffer
        /// </summary>
        /// <param name="source">Input image</param>
        public void Send(CVImage source)
        {
            bool Reinitialise;

            lock (FBackLock)
                Reinitialise = FBackBuffer.SetImage(source);

            if (Reinitialise)
            {
                InitialiseFrontFromBack();
            }

            Swap();
        }
Example #2
0
        public override void Process()
        {
            if (FInput.Allocated)
            {
                if (FBuffer.Allocated)
                {
                    FOutput.Image.SetImage(FBuffer);
                    FOutput.Send();
                }

                FBuffer.SetImage(FInput.Image);
            }
        }
        void InitialiseFrontFromBack()
        {
            lock (FBackLock)
                lock (FAttributesLock)
                {
                    FImageAttributes = FBackBuffer.ImageAttributes;

                    FFrontLock.AcquireWriterLock(LockTimeout);
                    try
                    {
                        FFrontBuffer.SetImage(FBackBuffer);
                    }
                    finally
                    {
                        FFrontLock.ReleaseWriterLock();
                    }
                }

            OnImageAttributesUpdate(FImageAttributes);
        }