예제 #1
0
        /// <summary>
        /// Check the SliceCount. Generally called from Node's evaluate
        /// </summary>
        /// <param name="SpreadMax">New SliceCount</param>
        /// <returns>true if changes were made</returns>
        public bool CheckInputSize(int SpreadMax)
        {
            if (FProcess.SliceCount == SpreadMax)
            {
                return(false);
            }

            lock (FLockProcess)
            {
                for (int i = FProcess.SliceCount; i < SpreadMax; i++)
                {
                    Add();
                }

                if (FProcess.SliceCount > SpreadMax)
                {
                    for (int i = SpreadMax; i < FProcess.SliceCount; i++)
                    {
                        Dispose(i);
                    }

                    FProcess.SliceCount = SpreadMax;
                    FOutput.SliceCount  = SpreadMax;
                }

                FOutput.AlignOutputPins();
            }

            return(true);
        }
예제 #2
0
        void IPluginEvaluate.Evaluate(int SpreadMax)
        {
            if (FFirstRun)
            {
                FFirstRun = false;
                FOutput   = new CVImageOutputSpread(FPinOutOutput);
            }

            if (FPinInInput.IsChanged || FPinInOffset.IsChanged)
            {
                if (FPinInInput[0] != null)
                {
                    FInput.Connect(FPinInInput[0]);
                    FInput.ImageAttributesUpdate += new EventHandler <ImageAttributesChangedEventArgs>(FInput_ImageAttributesUpdate);
                    FInput.ImageUpdate           += new EventHandler(FInput_ImageUpdate);
                    Initialise();
                }
                else
                {
                    FInput.Disconnect();
                }
            }
            else if (FPinInOffset.IsChanged)
            {
                Initialise();
            }

            if (FResizeOut)
            {
                FOutput.AlignOutputPins();
            }
        }
예제 #3
0
        /// <summary>
        /// Check the SliceCount
        /// </summary>
        /// <param name="SpreadMax">New SliceCount</param>
        /// <returns>true if changes were made</returns>
        public bool CheckInputSize(int SpreadMax)
        {
            if (!FInput.CheckInputSize() && FOutput.SliceCount == SpreadMax)
            {
                return(false);
            }

            lock (FLockProcess)
            {
                if (FInput.SliceCount == 0)
                {
                    SpreadMax = 0;
                }
                else if (FInput[0] == null)
                {
                    SpreadMax = 0;
                }

                for (int i = FProcess.SliceCount; i < SpreadMax; i++)
                {
                    Add(FInput[i]);
                }

                if (FProcess.SliceCount > SpreadMax)
                {
                    for (int i = SpreadMax; i < FProcess.SliceCount; i++)
                    {
                        Dispose(i);
                    }

                    FProcess.SliceCount = SpreadMax;
                    FOutput.SliceCount  = SpreadMax;
                }

                FOutput.AlignOutputPins();
            }

            return(true);
        }