コード例 #1
0
        /// <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))
            });
コード例 #2
0
 public virtual IRecommendation Get(Luma model)
 => _factory.Get(model);