using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Xml;
using ImageBlockz.Operations.InOut;
using ImageBlockz.Api;
using ImageBlockz.Core;
using AForge.Imaging.Filters;

namespace ImageBlockz.Operations.Filters
{
    public class HistogramEqualization : AbstractOperation
    {
        public static readonly string OperationName = typeof(HistogramEqualization).FullName;

        public HistogramEqualization()
            : base(OperationType.Filter)
        {
        
        }

        public override Bitmap Do(Bitmap bmp)
        {
            AForge.Imaging.Filters.HistogramEqualization filter = new AForge.Imaging.Filters.HistogramEqualization();
            return filter.Apply(bmp);
        }

        public override XmlNode ToXml(XmlDocument xmlDoc)
        {
            return xmlDoc.CreateElement(OperationName);
        }

        public override void FromXml(XmlNode node)
        {
            Console.WriteLine(OperationName);
        }

        public override string GetFormattedName()
        {
            return "Histogram Equalization";
        }


        public override string GetInfo()
        {
            return "No parameters.";
        }
    }
}
