protected AddSurfaceRectangleToHistogram ( ISurface surface, |
||
surface | ISurface | |
rect | ||
return | void |
protected override unsafe void AddSurfaceRectangleToHistogram (ISurface surface, Rectangle rect)
{
long[] histogramB = histogram[0];
long[] histogramG = histogram[1];
long[] histogramR = histogram[2];
int rect_right = rect.Right;
for (int y = rect.Y; y <= rect.Bottom; ++y) {
ColorBgra* ptr = surface.GetPointAddress (rect.X, y);
for (int x = rect.X; x <= rect_right; ++x) {
++histogramB[ptr->B];
++histogramG[ptr->G];
++histogramR[ptr->R];
++ptr;
}
}
}