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
4ff17f98
Commit
4ff17f98
authored
Feb 20, 2018
by
BORNON Théophile
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error correction & activate / desactivate multithreading
parent
a16182bc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
14 deletions
+39
-14
ImageProcessing_Test.dll
ImageProcessing_Test/bin/Debug/ImageProcessing_Test.dll
+0
-0
S04_Projet.exe
ImageProcessing_Test/bin/Debug/S04_Projet.exe
+0
-0
Display.cs
S04_Projet/Display.cs
+30
-11
MyImage.cs
S04_Projet/MyImage.cs
+8
-2
Program.cs
S04_Projet/Program.cs
+1
-1
S04_Projet.exe
S04_Projet/bin/Debug/S04_Projet.exe
+0
-0
No files found.
ImageProcessing_Test/bin/Debug/ImageProcessing_Test.dll
View file @
4ff17f98
No preview for this file type
ImageProcessing_Test/bin/Debug/S04_Projet.exe
View file @
4ff17f98
No preview for this file type
S04_Projet/Display.cs
View file @
4ff17f98
...
@@ -13,15 +13,28 @@ namespace S04_Projet
...
@@ -13,15 +13,28 @@ namespace S04_Projet
/// </summary>
/// </summary>
public
enum
Operation
public
enum
Operation
{
{
Rotate90
,
Rotate90
=
0
,
Rotate180
,
Rotate180
,
Rotate270
,
Rotate270
,
GrayScaleLinear
,
GrayScaleLinear
,
GrayScaleLuminosity
,
GrayScaleLuminosity
,
Shrink
,
Shrink
,
SwitchMultiThreading
,
Save
Save
}
}
private
static
string
[]
menuItems
=
new
string
[]
{
"Rotation à 90°"
,
"Rotation à 180°"
,
"Rotation à 270°"
,
"Passage à une image en nuances de gris (linéairement)"
,
"Passage à une image en nuances de gris (luminosité)"
,
"Rétrécissement de l'image"
,
"Désactiver le multithreading"
,
"Sauvegarder"
};
public
static
long
elapsedTime
;
public
static
long
elapsedTime
;
public
static
string
lastOperationMessage
;
public
static
string
lastOperationMessage
;
public
static
string
fileInfos
;
public
static
string
fileInfos
;
...
@@ -87,16 +100,6 @@ namespace S04_Projet
...
@@ -87,16 +100,6 @@ namespace S04_Projet
Console
.
ForegroundColor
=
ConsoleColor
.
White
;
Console
.
ForegroundColor
=
ConsoleColor
.
White
;
int
choosenItem
=
0
;
int
choosenItem
=
0
;
string
[]
menuItems
=
new
string
[]
{
"Rotation à 90°"
,
"Rotation à 180°"
,
"Rotation à 270°"
,
"Passage à une image en nuances de gris (linéairement)"
,
"Passage à une image en nuances de gris (luminosité)"
,
"Rétrécissement de l'image"
,
"Sauvegarder"
};
for
(
int
i
=
0
;
i
<
menuItems
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
menuItems
.
Length
;
i
++)
{
{
...
@@ -179,6 +182,22 @@ namespace S04_Projet
...
@@ -179,6 +182,22 @@ namespace S04_Projet
sw
.
Restart
();
sw
.
Restart
();
output
=
img
.
Shrink
(
input
);
output
=
img
.
Shrink
(
input
);
}
}
else
if
(
ope
==
Operation
.
SwitchMultiThreading
)
{
Program
.
MULTITHREADING
=
!
Program
.
MULTITHREADING
;
if
(
Program
.
MULTITHREADING
)
{
lastOperationMessage
=
"Multithreading activé avec succès"
;
menuItems
[(
int
)
ope
]
=
"Désactiver le multithreading"
;
}
else
{
lastOperationMessage
=
"Multithreading désactivé avec succès"
;
menuItems
[(
int
)
ope
]
=
"Activer le multithreading"
;
}
elapsedTime
=
0
;
return
img
;
}
else
if
(
ope
==
Operation
.
Save
)
else
if
(
ope
==
Operation
.
Save
)
{
{
string
path
;
string
path
;
...
...
S04_Projet/MyImage.cs
View file @
4ff17f98
...
@@ -89,7 +89,7 @@ namespace S04_Projet
...
@@ -89,7 +89,7 @@ namespace S04_Projet
opt
.
fileInfoHeaderSize
=
EndianToInt
(
file
,
14
);
opt
.
fileInfoHeaderSize
=
EndianToInt
(
file
,
14
);
opt
.
width
=
EndianToInt
(
file
,
18
);
opt
.
width
=
EndianToInt
(
file
,
18
);
opt
.
padding
=
opt
.
width
%
4
;
opt
.
padding
=
opt
.
width
%
4
;
opt
.
height
=
EndianToInt
(
file
,
22
6
);
opt
.
height
=
EndianToInt
(
file
,
22
);
opt
.
colorPlanesNb
=
EndianToInt
(
file
,
26
);
opt
.
colorPlanesNb
=
EndianToInt
(
file
,
26
);
opt
.
bitsPerPixel
=
EndianToInt
(
file
,
28
);
opt
.
bitsPerPixel
=
EndianToInt
(
file
,
28
);
opt
.
compressionMethod
=
EndianToInt
(
file
,
30
);
opt
.
compressionMethod
=
EndianToInt
(
file
,
30
);
...
@@ -158,6 +158,8 @@ namespace S04_Projet
...
@@ -158,6 +158,8 @@ namespace S04_Projet
int
x
,
y
;
int
x
,
y
;
byte
r
,
g
,
b
;
byte
r
,
g
,
b
;
Pixel
_pix
;
for
(
int
j
=
start
;
j
<
end
;
j
++)
for
(
int
j
=
start
;
j
<
end
;
j
++)
{
{
x
=
j
%
opt
.
width
;
x
=
j
%
opt
.
width
;
...
@@ -166,7 +168,11 @@ namespace S04_Projet
...
@@ -166,7 +168,11 @@ namespace S04_Projet
g
=
file
[
j
*
3
+
opt
.
padding
*
y
+
opt
.
offset
+
1
];
g
=
file
[
j
*
3
+
opt
.
padding
*
y
+
opt
.
offset
+
1
];
r
=
file
[
j
*
3
+
opt
.
padding
*
y
+
opt
.
offset
+
2
];
r
=
file
[
j
*
3
+
opt
.
padding
*
y
+
opt
.
offset
+
2
];
Pixels
[
x
,
y
]
=
new
Pixel
(
r
,
g
,
b
);
_pix
=
new
Pixel
(
r
,
g
,
b
);
lock
(
Pixels
){
Pixels
[
x
,
y
]
=
_pix
;
}
}
}
}
}
...
...
S04_Projet/Program.cs
View file @
4ff17f98
...
@@ -11,7 +11,7 @@ namespace S04_Projet
...
@@ -11,7 +11,7 @@ namespace S04_Projet
{
{
class
Program
class
Program
{
{
public
static
bool
MULTITHREADING
=
fals
e
;
public
static
bool
MULTITHREADING
=
tru
e
;
static
void
Main
(
string
[]
args
)
static
void
Main
(
string
[]
args
)
{
{
#
region
Filters
Matrix
#
region
Filters
Matrix
...
...
S04_Projet/bin/Debug/S04_Projet.exe
View file @
4ff17f98
No preview for this file type
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