Writing Processors

1
2
3
4
5
6
7
// normalize histogram while excluding 0 values
unsigned int maxOccurance = 0;
for (unsigned int i=1; i<numValues; i++)
    if (histogram[i]>maxOccurance) maxOccurance = histogram[i];
for (unsigned int i=1; i<numValues; i++)
    histogram_[i] = static_cast(histogram[i])/static_cast(maxOccurance);
histogram_[0] = 1.0f;