internal PixelRgb BlackAndWhite(BlackAndWhiteMode mode = BlackAndWhiteMode.Regular) { byte result = 0; switch (mode) { case BlackAndWhiteMode.Regular: result = (byte)(this.R * FilterValue.BlackAndWhiteRatio[0] + this.G * FilterValue.BlackAndWhiteRatio[1] + this.B * FilterValue.BlackAndWhiteRatio[2]); break; case BlackAndWhiteMode.Red: result = this.R; break; case BlackAndWhiteMode.Green: result = this.G; break; case BlackAndWhiteMode.Blue: result = this.B; break; } this.R = result; this.G = result; this.B = result; return this; }
public Darkroom BlackAndWhite(BlackAndWhiteMode mode = BlackAndWhiteMode.Regular) { appliedFilters.Add(new Filter { Name = Filters.BlackAndWhite, Value = mode }); return this; }