public Histogram GetHistogram(int channel) { if (channel < 0 || channel > 2) throw new ArgumentOutOfRangeException("channel", channel, "Expected channel between 0 and 2 for 24-bit color image."); var histogram = new Histogram(Byte.MinValue, Byte.MaxValue); for (int i = channel; i < Data.Length; i += 3) histogram.Add(Data[i]); return histogram; }
public Histogram GetHistogram(int channel) { if (channel != 0) throw new ArgumentOutOfRangeException("channel", channel, "Expected channel 0 for grayscale image."); var histogram = new Histogram(0, 1); for (int i = 0; i < Data.Length; i++) histogram.Add(Data[i]); return histogram; }
public Histogram GetHistogram(int channel) { if (channel != 0) throw new ArgumentOutOfRangeException("channel", channel, "Expected channel 0 for grayscale image."); var histogram = new Histogram(_bits.MinimumValue, _bits.MaximumValue); var data = Data; for (int i = 0; i < data.Length; i++) histogram.Add(data[i]); return histogram; }