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

Modifs

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