public void LoadPlayers(Dictionary<int, string> usersToDataDict) { lock (playerCalibs) { playerCalibs.Clear(); foreach (int playerID in usersToDataDict.Keys) { YCbCrColor calibColor = new YCbCrColor(); calibColor.LoadFromString(usersToDataDict[playerID]); LoadPlayer(playerID, calibColor); } } }
public float DistanceSqTo(YCbCrColor otherColor) { return (this.Y - otherColor.Y) * (this.Y - otherColor.Y) + (this.Cb - otherColor.Cb) * (this.Cb - otherColor.Cb) + (this.Cr - otherColor.Cr) * (this.Cr - otherColor.Cr); }
public void LoadPlayer(int pID, YCbCrColor calibColor) { playerCalibs[pID] = calibColor; }
public void LoadFromCalibration(YCbCrColor calibColor) { YAvg = calibColor.Y; CbAvg = calibColor.Cb; CrAvg = calibColor.Cr; IsCalibrated = true; }