//called when data for any output pin is requested public void Evaluate(int SpreadMax) { if (!FInitialised) { FInputs = new CVImageInputSpread(FPinInImage); FInitialised = true; } FInputs.CheckInputSize(); Output(FInputs.SliceCount); }
public bool CheckInputSize() { bool changed = FInput.CheckInputSize(); for (int i = FProcess.SliceCount; i < FInput.SliceCount; i++) { Add(FInput[i]); } if (FProcess.SliceCount > FInput.SliceCount) { for (int i = FInput.SliceCount; i < FProcess.SliceCount; i++) { FProcess[i].Dispose(); } FProcess.SliceCount = FInput.SliceCount; } return(changed); }
/// <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); }