using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Drawing;
using System.Diagnostics;
using System.IO;

namespace S04_Projet
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("#############################################################");
            Console.WriteLine("###                       Bienvenue                       ###");
            Console.WriteLine("#############################################################");
            Console.WriteLine();

            MyImage img = Display.LoadImage();
            Display.Operation ToDo = Display.AskForOperation();
            MyImage newImg = Display.PerformOperation(ToDo, img);

            while (newImg != null)
            {
                ToDo = Display.AskForOperation();
                newImg = Display.PerformOperation(ToDo, newImg);
            }

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Image sauvegardée en {0}ms!", Display.elapsedTime);
            

            //Console.Clear();
            Console.Read();




            #region Test
            /*MyImage imgRotate90 = img.Rotate90();
            imgRotate90.Save("90.bmp");
            MyImage imgRotate180 = img.Rotate180();
            imgRotate180.Save("180.bmp");
            MyImage imgRotate270 = img.Rotate270();
            imgRotate270.Save("270.bmp");
            Console.WriteLine("Rotations terminées");

            MyImage bwLumnisity = img.ToGrayScale(2, MyImage.grayFilterType.LUMINOSITY);
            bwLumnisity.Save("bwLumnosity.bmp");
            MyImage bwLinear = img.ToGrayScale(2, MyImage.grayFilterType.LINEAR);
            bwLinear.Save("bwLinear.bmp");
            Console.WriteLine("Done");*/

            /*int[,] convFilter = new int[,]
            {
                { 0, 0, 0 },
                { 0, 0, 7 },
                { 3, 5, 1 }
            };
            MyImage conv = img.ApplyConvFilter(convFilter, (1.0 / 16.0));
            conv.Save("dither.bmp");
            Console.WriteLine("Done");*/
            #endregion
        }
    }
}
