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
bdf3478e
Commit
bdf3478e
authored
Feb 20, 2018
by
BORNON Théophile
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout des commentaires
parent
6e8940d3
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
73 deletions
+150
-73
Display.cs
S04_Projet/Display.cs
+7
-4
MyImage.cs
S04_Projet/MyImage.cs
+124
-22
Options.cs
S04_Projet/Options.cs
+4
-0
Pixel.cs
S04_Projet/Pixel.cs
+14
-7
Program.cs
S04_Projet/Program.cs
+1
-40
No files found.
S04_Projet/Display.cs
View file @
bdf3478e
...
...
@@ -67,7 +67,7 @@ namespace S04_Projet
elapsedTime
=
sw
.
ElapsedMilliseconds
;
lastOperationMessage
=
"Image chargée en "
+
elapsedTime
+
"ms"
;
fileInfos
=
image
.
t
oString
();
fileInfos
=
image
.
T
oString
();
return
image
;
}
...
...
@@ -160,8 +160,8 @@ namespace S04_Projet
}
while
(
retry
&&
input
>=
2
&&
input
<=
255
);
sw
.
Restart
();
if
(
ope
==
Operation
.
GrayScaleLinear
)
output
=
img
.
ToGrayScale
((
byte
)
input
,
MyImage
.
g
rayFilterType
.
LINEAR
);
else
if
(
ope
==
Operation
.
GrayScaleLuminosity
)
output
=
img
.
ToGrayScale
((
byte
)
input
,
MyImage
.
g
rayFilterType
.
LUMINOSITY
);
if
(
ope
==
Operation
.
GrayScaleLinear
)
output
=
img
.
ToGrayScale
((
byte
)
input
,
MyImage
.
G
rayFilterType
.
LINEAR
);
else
if
(
ope
==
Operation
.
GrayScaleLuminosity
)
output
=
img
.
ToGrayScale
((
byte
)
input
,
MyImage
.
G
rayFilterType
.
LUMINOSITY
);
}
else
if
(
ope
==
Operation
.
Shrink
)
{
...
...
@@ -203,11 +203,14 @@ namespace S04_Projet
sw
.
Stop
();
elapsedTime
=
sw
.
ElapsedMilliseconds
;
lastOperationMessage
=
String
.
Format
(
"Opération {0}, effectuée avec succès en {1}ms"
,
ope
,
elapsedTime
);
fileInfos
=
(
output
!=
null
)
?
output
.
t
oString
()
:
""
;
fileInfos
=
(
output
!=
null
)
?
output
.
T
oString
()
:
""
;
return
output
;
}
/// <summary>
/// Ecran d'attente
/// </summary>
public
static
void
WaitingScreen
()
{
Console
.
Write
(
"Traitement de l'image en cours"
);
...
...
S04_Projet/MyImage.cs
View file @
bdf3478e
This diff is collapsed.
Click to expand it.
S04_Projet/Options.cs
View file @
bdf3478e
...
...
@@ -26,6 +26,10 @@ namespace S04_Projet
public
Options
()
{
}
/// <summary>
/// Return a new instance of Options with the same parameters
/// </summary>
/// <returns>New option instance</returns>
public
Options
Copy
()
{
Options
options
=
new
Options
();
...
...
S04_Projet/Pixel.cs
View file @
bdf3478e
...
...
@@ -16,6 +16,10 @@ namespace S04_Projet
public
double
S
{
get
;
private
set
;
}
public
double
L
{
get
;
private
set
;
}
public
void
SetR
(
byte
r
)
=>
this
.
r
=
r
;
public
void
SetG
(
byte
g
)
=>
this
.
g
=
g
;
public
void
SetB
(
byte
b
)
=>
this
.
b
=
b
;
/// <summary>
/// Prend les trois couleurs en paramètres
/// </summary>
...
...
@@ -51,6 +55,10 @@ namespace S04_Projet
b
=
rgb
[
2
];
}
/// <summary>
/// Créer un pixel à partir d'un tableau contenant les couleurs rouge, vert, bleu (respectivement)
/// </summary>
/// <param name="rgb">Tableau composé dans cet ordre des couleurs rouge, vert, bleu</param>
public
Pixel
(
int
[]
rgb
)
{
r
=
(
byte
)
rgb
[
0
];
...
...
@@ -97,11 +105,10 @@ namespace S04_Projet
return
new
Pixel
(
total
);
}
public
void
SetR
(
byte
r
)
{
this
.
r
=
r
;
}
public
void
SetG
(
byte
g
)
{
this
.
g
=
g
;
}
public
void
SetB
(
byte
b
)
{
this
.
b
=
b
;
}
private
void
computeHSl
()
/// <summary>
/// Calcul les valeurs de variables HSL (Hue, Saturation, Lightness)
/// </summary>
private
void
computeHSL
()
{
double
rH
=
r
/
255.0
;
double
gH
=
g
/
255.0
;
...
...
S04_Projet/Program.cs
View file @
bdf3478e
...
...
@@ -17,46 +17,7 @@ namespace S04_Projet
MyImage
img
=
new
MyImage
(
"img/lena.bmp"
);
img
.
Save
(
"output.bmp"
);
/*short[,] boxBlurFilter = new short[,] {
{1,1,1 },
{1,1,1 },
{1,1,1 }
};
short[,] identityFilter = new short[,]
{
{ 0, 0, 0 },
{ 0, 1, 0 },
{ 0, 0, 0 }
};
short[,] edgeDetect1Filter = new short[,]
{
{ 1, 0, -1 },
{ 0, 0, 0 },
{ -1, 0, 1 }
};
short[,] edgeDetect2Filter = new short[,]
{
{ 0, 1, 0 },
{ 1, -4, 1 },
{ 0, 1, 0 }
};
short[,] edgeDetect3Filter = new short[,]
{
{ -1, -1, -1 },
{ -1, 8, -1 },
{ -1, -1, -1 }
};
short[,] sharpenFilter = new short[,]
{
{ 0, -1, 0 },
{ -1, 5, -1 },
{ 0, -1, 0 }
};
/*
MyImage imgg = new MyImage("img/coco.bmp");
imgg.ApplyConvFilter(identityFilter, 1).Save("id.bmp");
...
...
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