Commit bdf3478e authored by BORNON Théophile's avatar BORNON Théophile

Ajout des commentaires

parent 6e8940d3
...@@ -67,7 +67,7 @@ namespace S04_Projet ...@@ -67,7 +67,7 @@ namespace S04_Projet
elapsedTime = sw.ElapsedMilliseconds; elapsedTime = sw.ElapsedMilliseconds;
lastOperationMessage = "Image chargée en " + elapsedTime + "ms"; lastOperationMessage = "Image chargée en " + elapsedTime + "ms";
fileInfos = image.toString(); fileInfos = image.ToString();
return image; return image;
} }
...@@ -160,8 +160,8 @@ namespace S04_Projet ...@@ -160,8 +160,8 @@ namespace S04_Projet
} while (retry && input >= 2 && input <= 255); } while (retry && input >= 2 && input <= 255);
sw.Restart(); sw.Restart();
if (ope == Operation.GrayScaleLinear) output = img.ToGrayScale((byte)input, MyImage.grayFilterType.LINEAR); if (ope == Operation.GrayScaleLinear) output = img.ToGrayScale((byte)input, MyImage.GrayFilterType.LINEAR);
else if (ope == Operation.GrayScaleLuminosity) output = img.ToGrayScale((byte)input, MyImage.grayFilterType.LUMINOSITY); else if (ope == Operation.GrayScaleLuminosity) output = img.ToGrayScale((byte)input, MyImage.GrayFilterType.LUMINOSITY);
} }
else if(ope == Operation.Shrink) else if(ope == Operation.Shrink)
{ {
...@@ -203,11 +203,14 @@ namespace S04_Projet ...@@ -203,11 +203,14 @@ namespace S04_Projet
sw.Stop(); sw.Stop();
elapsedTime = sw.ElapsedMilliseconds; elapsedTime = sw.ElapsedMilliseconds;
lastOperationMessage = String.Format("Opération {0}, effectuée avec succès en {1}ms", ope, elapsedTime); lastOperationMessage = String.Format("Opération {0}, effectuée avec succès en {1}ms", ope, elapsedTime);
fileInfos = (output != null) ? output.toString() : ""; fileInfos = (output != null) ? output.ToString() : "";
return output; return output;
} }
/// <summary>
/// Ecran d'attente
/// </summary>
public static void WaitingScreen() public static void WaitingScreen()
{ {
Console.Write("Traitement de l'image en cours"); Console.Write("Traitement de l'image en cours");
......
This diff is collapsed.
...@@ -26,6 +26,10 @@ namespace S04_Projet ...@@ -26,6 +26,10 @@ namespace S04_Projet
public Options() { } public Options() { }
/// <summary>
/// Return a new instance of Options with the same parameters
/// </summary>
/// <returns>New option instance</returns>
public Options Copy() public Options Copy()
{ {
Options options = new Options(); Options options = new Options();
......
...@@ -16,6 +16,10 @@ namespace S04_Projet ...@@ -16,6 +16,10 @@ namespace S04_Projet
public double S { get; private set; } public double S { get; private set; }
public double L { 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> /// <summary>
/// Prend les trois couleurs en paramètres /// Prend les trois couleurs en paramètres
/// </summary> /// </summary>
...@@ -51,6 +55,10 @@ namespace S04_Projet ...@@ -51,6 +55,10 @@ namespace S04_Projet
b = rgb[2]; 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) public Pixel(int[] rgb)
{ {
r = (byte)rgb[0]; r = (byte)rgb[0];
...@@ -97,11 +105,10 @@ namespace S04_Projet ...@@ -97,11 +105,10 @@ namespace S04_Projet
return new Pixel(total); return new Pixel(total);
} }
public void SetR(byte r) { this.r = r; } /// <summary>
public void SetG(byte g) { this.g = g; } /// Calcul les valeurs de variables HSL (Hue, Saturation, Lightness)
public void SetB(byte b) { this.b = b; } /// </summary>
private void computeHSL()
private void computeHSl()
{ {
double rH = r / 255.0; double rH = r / 255.0;
double gH = g / 255.0; double gH = g / 255.0;
......
...@@ -17,46 +17,7 @@ namespace S04_Projet ...@@ -17,46 +17,7 @@ namespace S04_Projet
MyImage img = new MyImage("img/lena.bmp"); MyImage img = new MyImage("img/lena.bmp");
img.Save("output.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"); MyImage imgg = new MyImage("img/coco.bmp");
imgg.ApplyConvFilter(identityFilter, 1).Save("id.bmp"); imgg.ApplyConvFilter(identityFilter, 1).Save("id.bmp");
......
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