Created
February 13, 2013 04:38
-
-
Save greenboxal/4942310 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private bool CheckThreshold(Vector4[] colors, out Vector4 average) | |
{ | |
int i; | |
Vector4 a = new Vector4(); | |
Vector4 min = new Vector4(1); | |
Vector4 max = new Vector4(0); | |
for (i = 0; i < colors.Length; i++) | |
{ | |
Vector4 c = colors[i]; | |
Vector4.Min(ref min, ref c, out min); | |
Vector4.Max(ref max, ref c, out max); | |
a += c; | |
} | |
a /= i; | |
average = a; | |
return ((a - _nodeThreshold) <= min && min <= a) || (a >= max && max >= (a + _nodeThreshold)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HUE