Commit 6c5baa1f authored by Théophile BORNON's avatar Théophile BORNON

Update

parent ed73cdc6
...@@ -52,28 +52,23 @@ namespace S04_Projet ...@@ -52,28 +52,23 @@ namespace S04_Projet
} while (!validPath); } while (!validPath);
Console.Clear(); Console.Clear();
MyImageThread myImageThread = new MyImageThread(file); Thread waitingThread = new Thread(new ThreadStart(WaitingScreen));
Thread imageThread = new Thread(new ThreadStart(myImageThread.ThreadLoop));
Stopwatch sw = new Stopwatch(); Stopwatch sw = new Stopwatch();
sw.Start(); sw.Start();
imageThread.Start(); waitingThread.Start();
MyImage image = new MyImage(path);
waitingThread.Abort();
Console.Write("Traitement en cours de l'image.");
while (imageThread.IsAlive)
{
Thread.Sleep(250);
Console.Write(".");
}
sw.Stop(); sw.Stop();
Console.Clear(); Console.Clear();
elapsedTime = sw.ElapsedMilliseconds; elapsedTime = sw.ElapsedMilliseconds;
lastOperationMessage = "Image chargée en " + elapsedTime + "ms"; lastOperationMessage = "Image chargée en " + elapsedTime + "ms";
fileInfos = myImageThread.image.toString(); fileInfos = image.toString();
return myImageThread.image; return image;
} }
/// <summary> /// <summary>
...@@ -194,5 +189,15 @@ namespace S04_Projet ...@@ -194,5 +189,15 @@ namespace S04_Projet
return output; return output;
} }
public static void WaitingScreen()
{
Console.Write("Traitement de l'image en cours");
while(true)
{
Console.Write(".");
Thread.Sleep(250);
}
}
} }
} }
...@@ -212,6 +212,12 @@ namespace S04_Projet ...@@ -212,6 +212,12 @@ namespace S04_Projet
} }
#endregion #endregion
public MyImage Enlarge(int coeff)
{
Options options = opt.Copy();
Pixel[,] PixelArr = new Pixel[opt.width*2, opt.height*2];
}
public MyImage ToGrayScale(byte scale, grayFilterType type) public MyImage ToGrayScale(byte scale, grayFilterType type)
{ {
Options options = opt.Copy(); Options options = opt.Copy();
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace S04_Projet
{
public class MyImageThread
{
public byte[] file;
public MyImage image;
public MyImageThread(byte[] file)
{
this.file = file;
}
public void ThreadLoop()
{
image = new MyImage(file);
}
}
}
...@@ -18,6 +18,7 @@ namespace S04_Projet ...@@ -18,6 +18,7 @@ namespace S04_Projet
public int imgSize; public int imgSize;
public int horizontalRes; public int horizontalRes;
public int VerticalRes; public int VerticalRes;
public int padding;
public int nbColor; public int nbColor;
public int nbImportantColor; public int nbImportantColor;
public string format; public string format;
...@@ -33,6 +34,7 @@ namespace S04_Projet ...@@ -33,6 +34,7 @@ namespace S04_Projet
options.width = width; options.width = width;
options.height = height; options.height = height;
options.stride = stride; options.stride = stride;
options.padding = padding;
options.colorPlanesNb = colorPlanesNb; options.colorPlanesNb = colorPlanesNb;
options.bitsPerPixel = bitsPerPixel; options.bitsPerPixel = bitsPerPixel;
options.compressionMethod = compressionMethod; options.compressionMethod = compressionMethod;
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="MyImage.cs" /> <Compile Include="MyImage.cs" />
<Compile Include="Display.cs" /> <Compile Include="Display.cs" />
<Compile Include="MyImageThread.cs" />
<Compile Include="Options.cs" /> <Compile Include="Options.cs" />
<Compile Include="Pixel.cs" /> <Compile Include="Pixel.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
......
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment