/// <summary> /// Provides a factory method for all the <see cref="RgbFltr"/> /// implementing the <see cref="IRgbFilter"/>. /// </summary> public IRgbFilter Get(RgbFltr filter) { var rec = _rec.Get(_settings.Rec); return(filter switch { RgbFltr.Binary => new BinaryFilter(rec), RgbFltr.Grayscale => new GrayscaleFilter(rec), RgbFltr.Inversion => new InversionFilter(), RgbFltr.Flopping => new FloppingFilter(), RgbFltr.Flipping => new FlippingFilter(), RgbFltr.SepiaTone => new SepiaToneFilter(), RgbFltr.MirrorLeft => new MirrorLeftFilter(), RgbFltr.MirrorRight => new MirrorRightFilter(), _ => throw new NotImplementedException(nameof(filter)) });
public IRgbFilter Get(RgbFltr model) => _factory.Get(model);
/// <inheritdoc/> public Bitmap Apply(Bitmap bmp, RgbFltr filter) => _cache.GetOrCreate(filter, () => _rgb.Get(filter).Filter(bmp) );