using System.Drawing;

namespace ZionGraphics.Filtering
{
    class Light : IFilter
    {
        public override Bitmap Apply(Bitmap bitmap)
        {
            AForge.Imaging.Filters.ContrastCorrection filter1 = new AForge.Imaging.Filters.ContrastCorrection(Intensity * -1);
            AForge.Imaging.Filters.BrightnessCorrection filter2 = new AForge.Imaging.Filters.BrightnessCorrection(Intensity);

            filter2.ApplyInPlace(bitmap);

            if (Intensity < 0)
                filter1.ApplyInPlace(bitmap);
            return bitmap;
        }
    }
}
