private Bitmap SaveChannelHsv(Image inputImage, Func <Color, HsvCoordinates, Color> colorExtractionFunction) { Bitmap result = new Bitmap(inputImage.Width, inputImage.Height); using (Bitmap bmp = new Bitmap(inputImage)) { HsvCoordinates coordinates = new HsvCoordinates(bmp); for (int x = 0; x < bmp.Width; x++) { for (int y = 0; y < bmp.Height; y++) { Color pxl = colorExtractionFunction(bmp.GetPixel(x, y), coordinates); result.SetPixel(x, y, pxl); } } } return(result); }
private Color GetVChannel(Color inputColor, HsvCoordinates helper) { return(helper.GetVChannel(inputColor)); }