Skip to content

Instantly share code, notes, and snippets.

@thecodejunkie
Created January 1, 2014 21:40
Show Gist options
  • Save thecodejunkie/8211769 to your computer and use it in GitHub Desktop.
Save thecodejunkie/8211769 to your computer and use it in GitHub Desktop.
I want to be able to pass in what order the colors should be iterated, while maintaining the call to the histogram (i.e needs to be called with the right values)
var axisTotal = 0;
var stackedSumByColor = new int[128];
for (var r = dimension.Min; r <= dimension.Max; r++)
{
var sum = 0;
for (var g = dimension.Min; g <= dimension.Max; g++)
{
for (var b = dimension.Min; b <= dimension.Max; b++)
{
var count =
this.histogram[r, g, b];
sum += count;
}
}
axisTotal += sum;
stackedSumByColor[r] = axisTotal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment