Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imageProcessing
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ecole
imageProcessing
Commits
801cdd6e
Commit
801cdd6e
authored
Feb 13, 2018
by
Théophile BORNON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modifs
parent
84784631
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
MyImage.cs
S04_Projet/MyImage.cs
+11
-0
MyImageThread.cs
S04_Projet/MyImageThread.cs
+7
-0
Options.cs
S04_Projet/Options.cs
+2
-0
Program.cs
S04_Projet/Program.cs
+1
-0
No files found.
S04_Projet/MyImage.cs
View file @
801cdd6e
...
@@ -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
}
}
...
...
S04_Projet/MyImageThread.cs
View file @
801cdd6e
...
@@ -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
;
}
}
}
}
}
}
S04_Projet/Options.cs
View file @
801cdd6e
...
@@ -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
;
...
...
S04_Projet/Program.cs
View file @
801cdd6e
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment