private void CheckChanges(int FImageInstancescount) { bool needsInit = false; ImageRGB imgIn; if (FPinInImage[0] == null) { FImageInstances.Clear(); needsInit = true; } else if (FImageInstances.Count != FPinInImage.SliceCount) { needsInit = false; //shrink local if (FImageInstances.Count > FPinInImage.SliceCount) { for (int i = FPinInImage.SliceCount; i < FImageInstances.Count; i++) { FImageInstances.Remove(i); } needsInit = true; } //grow local else { for (int i = FImageInstances.Count; i < FPinInImage.SliceCount; i++) { if (FPinInImage[i] == null || !FPinInImage[0].HasAllocatedImage) { break; } ImageL16Instance attribs = new ImageL16Instance(); //presume L16 input attribs.InitialiseImage(FPinInImage[i]); FImageInstances.Add(i, attribs); } needsInit = true; } } SetSliceCount(FImageInstances.Count); //seems a shame to have to reinitialise absolutely everything.. if (needsInit) { Reinitialize(); } //check for data changes bool needsUpdate = false; for (int i = 0; i < FImageInstances.Count; i++) { if (FImageInstances[i].isFresh) { needsUpdate = true; } } //if (needsUpdate) //Update(); }
private void CheckChanges(int FImageInstancescount) { bool needsInit = false; ImageRGB imgIn; if (FPinInImage[0] == null) { FImageInstances.Clear(); needsInit = true; } else if (FImageInstances.Count != FPinInImage.SliceCount) { needsInit = false; //shrink local if (FImageInstances.Count > FPinInImage.SliceCount) { for (int i = FPinInImage.SliceCount; i < FImageInstances.Count; i++) FImageInstances.Remove(i); needsInit = true; } //grow local else { for (int i = FImageInstances.Count; i < FPinInImage.SliceCount; i++) { if (FPinInImage[i] == null || !FPinInImage[0].HasAllocatedImage) break; ImageL16Instance attribs = new ImageL16Instance(); //presume L16 input attribs.InitialiseImage(FPinInImage[i]); FImageInstances.Add(i, attribs); } needsInit = true; } } SetSliceCount(FImageInstances.Count); //seems a shame to have to reinitialise absolutely everything.. if (needsInit) Reinitialize(); //check for data changes bool needsUpdate = false; for (int i = 0; i < FImageInstances.Count; i++) { if (FImageInstances[i].isFresh) needsUpdate = true; } //if (needsUpdate) //Update(); }