CIImage Apply(ModifyFilter modifyFilter, CIImage input, bool dirty)
        {
            if (modifyFilter == null || !modifyFilter.Active || !dirty)
            {
                return(null);
            }

            CIFilter filter = new CISepiaTone {
                Image     = input,
                Intensity = modifyFilter.Intensity,
            };

            return(filter.OutputImage);
        }
        static ImageFilter CreateFilter(string key, bool setDefaults)
        {
            ImageFilter filter = null;

            if (key == BlurFilter.Key)
            {
                filter = new BlurFilter(setDefaults);
            }
            else if (key == ModifyFilter.Key)
            {
                filter = new ModifyFilter(setDefaults);
            }
            else
            {
                throw new NotImplementedException();
            }

            UIApplication.RegisterObjectForStateRestoration(filter, key);
            filter.Dirty           = false;
            filter.RestorationType = typeof(DetailViewController);
            return(filter);
        }
		static ImageFilter CreateFilter(string key, bool setDefaults)
		{
			ImageFilter filter = null;
			if (key == BlurFilter.Key)
				filter = new BlurFilter (setDefaults);
			else if (key == ModifyFilter.Key)
				filter = new ModifyFilter (setDefaults);
			else
				throw new NotImplementedException ();

			UIApplication.RegisterObjectForStateRestoration (filter, key);
			filter.Dirty = false;
			filter.RestorationType = typeof(DetailViewController);
			return filter;
		}
		CIImage Apply(ModifyFilter modifyFilter, CIImage input, bool dirty)
		{
			if (modifyFilter == null || !modifyFilter.Active || !dirty)
				return null;

			CIFilter filter = new CISepiaTone {
				Image = input,
				Intensity = modifyFilter.Intensity,
			};
			return filter.OutputImage;
		}