Ejemplo n.º 1
0
        private void Add(CVImageInput input)
        {
            T addition = new T();

            addition.SetInput(input);

            FProcess.Add(addition);
        }
Ejemplo n.º 2
0
        private void Add(CVImageInput input)
        {
            CVImageOutput output   = new CVImageOutput();
            T             addition = new T();

            addition.SetInput(input);

            FProcess.Add(addition);
        }
 public bool HasInput(CVImageInput input)
 {
     return(FInput == input);
 }
 public void SetInput(CVImageInput input)
 {
     FInput = input;
     ReAllocate();
 }
        public bool CheckInputSize()
        {
            bool noInput = false;

            if (FInputPin.SliceCount == 0)
            {
                noInput = true;
            }
            else if (FInputPin[0] == null)
            {
                noInput = true;
            }

            if (noInput)
            {
                if (FInput.SliceCount == 0)
                {
                    return(false);
                }
                else
                {
                    FInput.SliceCount = 0;
                    return(true);
                }
            }

            bool changed = false;

            if (FInput.SliceCount != FInputPin.SliceCount)
            {
                changed = true;

                //add
                for (int iAdd = FInput.SliceCount; iAdd < FInputPin.SliceCount; iAdd++)
                {
                    CVImageInput add = new CVImageInput();
                    if (FInputPin[iAdd] != null)
                    {
                        add.Connect(FInputPin[iAdd]);
                    }
                    FInput.Add(add);
                }

                //remove
                if (FInput.SliceCount != FInputPin.SliceCount)
                {
                    for (int iDispose = FInputPin.SliceCount; iDispose < FInput.SliceCount; iDispose++)
                    {
                        FInput[iDispose].Dispose();
                    }

                    FInput.SliceCount = FInputPin.SliceCount;
                }
            }

            for (int i = 0; i < FInput.SliceCount; i++)
            {
                if (!FInput[i].ConnectedTo(FInputPin[i]))
                {
                    changed = true;
                    FInput[i].Connect(FInputPin[i]);
                }
            }

            return(changed);
        }