Exemple #1
0
        static void Main(string[] args)
        {
            var photoProcessor = new PhotoProcessor();
            var filter         = new PhotoFilters();

            Action <Photo> filterHandler = filter.ApplyBrightness;

            filterHandler += filter.ApplyContrast;
            filterHandler += RemoveRedEyeFilter;

            photoProcessor.Process("C:\\abc.jpg", filterHandler);

            Console.ReadLine();
        }
        public void Process(string path, Action <Photo> filterHandler)
        {
            //System.Action<>
            //System.Func<>


            var photo = Photo.Load(path);

            var filters = new PhotoFilters();

            //filters.ApplyBrightness(photo);
            //filters.ApplyContrast(photo);
            //filters.Resize(photo);

            filterHandler(photo);

            photo.Save();
        }