public void setColor(byte whihcLED, byte r, byte g, byte b) { lock (this) { ledVals[whihcLED] = new RGBVal(r, g, b); hasUpdate = true; manualMode = true; } }
public int sampleLessThan(byte[] array) { RGBVal sample = ColorSampler.Sample3Channels(array, VideoCaptureManager.Instance.ImageWidth, VideoCaptureManager.Instance.ImageHeight); this.ColorAverage = sample; if (sample.R < ColorThresh.R && sample.G < ColorThresh.G && sample.B < ColorThresh.B) { return(1); } return(0); }
public int sampleGreaterThan(byte[] array) { RGBVal sample = ColorSampler.Sample3Channels(array, VideoCaptureManager.Instance.ImageWidth, VideoCaptureManager.Instance.ImageHeight); this.ColorAverage = sample; if (sample.R > ColorThresh.R && sample.G > ColorThresh.G && sample.B > ColorThresh.B) { VideoCaptureManager.Instance.RemoveCallback(sampleGreaterThan); return(1); } return(0); }
public LatencyTesterVM() { //captureControl = control; stopwatch = new Stopwatch(); rectColor = Brushes.DarkGray; colorThreshold = new RGBVal(); colorThreshold.R = 150; colorThreshold.G = 0; colorThreshold.B = 0; colorAverage = new RGBVal(); colorAverage.R = 0; colorAverage.G = 0; colorAverage.B = 0; BaseColor = Brushes.Black; TestColor = Brushes.Red; // VideoCaptureManager.Instance.AddCallback(sampleGreaterThan); }