Commit 801cdd6e authored by Théophile BORNON's avatar Théophile BORNON

Modifs

parent 84784631
......@@ -126,6 +126,7 @@ namespace S04_Projet
#region File info
opt.fileInfoHeaderSize = EndianToInt(file, 14, 18);
opt.width = EndianToInt(file, 18, 22);
opt.stride = opt.width + (opt.width % 4 != 0 ? 4 - (opt.width % 4) : 0); // A CHANGER
opt.height = EndianToInt(file, 22, 26);
opt.colorPlanesNb = EndianToInt(file, 26, 28);
opt.bitsPerPixel = EndianToInt(file, 28, 30);
......@@ -173,6 +174,16 @@ namespace S04_Projet
*/
#endregion
#region Multithreading
int nbProcessors = Environment.ProcessorCount;
for (int i = 0; i < nbProcessors; i++)
{
}
#endregion
#endregion
}
......
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace S04_Projet
{
......@@ -10,15 +11,21 @@ namespace S04_Projet
{
public byte[] file;
public MyImage image;
public long loadTime;
private Stopwatch sw;
public MyImageThread(byte[] file)
{
sw = new Stopwatch();
this.file = file;
}
public void ThreadLoop()
{
sw.Restart();
image = new MyImage(file);
sw.Stop();
loadTime = sw.ElapsedMilliseconds;
}
}
}
......@@ -11,6 +11,7 @@ namespace S04_Projet
public int fileInfoHeaderSize;
public int width;
public int height;
public int stride;
public int colorPlanesNb;
public int bitsPerPixel;
public int compressionMethod;
......@@ -31,6 +32,7 @@ namespace S04_Projet
options.fileInfoHeaderSize = fileInfoHeaderSize;
options.width = width;
options.height = height;
options.stride = stride;
options.colorPlanesNb = colorPlanesNb;
options.bitsPerPixel = bitsPerPixel;
options.compressionMethod = compressionMethod;
......
......@@ -58,6 +58,7 @@ namespace S04_Projet
Console.Clear();
}
Console.WriteLine("Image chargée en {0}ms\n", myImageThread.loadTime);
Console.WriteLine(myImageThread.image.toString());
//Console.Clear();
Console.Read();
......
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