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

Ajout des commentaires

parent 6e8940d3
......@@ -67,7 +67,7 @@ namespace S04_Projet
elapsedTime = sw.ElapsedMilliseconds;
lastOperationMessage = "Image chargée en " + elapsedTime + "ms";
fileInfos = image.toString();
fileInfos = image.ToString();
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.grayFilterType.LINEAR);
else if (ope == Operation.GrayScaleLuminosity) output = img.ToGrayScale((byte)input, MyImage.grayFilterType.LUMINOSITY);
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.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.toString() : "";
fileInfos = (output != null) ? output.ToString() : "";
return output;
}
/// <summary>
/// Ecran d'attente
/// </summary>
public static void WaitingScreen()
{
Console.Write("Traitement de l'image en cours");
......
This diff is collapsed.
......@@ -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();
......
......@@ -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;
......
......@@ -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");
......
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