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.Convolutions
{
    public class Blur : AbstractOperation
    {
        public static readonly string OperationName = typeof(Blur).FullName;

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

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

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

        public override void FromXml(XmlNode node)
        {
          
        }

        public override string GetFormattedName()
        {
            return "Blur";
        }

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