Skip to content
Snippets Groups Projects
Commit 07fb6eb3 authored by SAEZ Theo's avatar SAEZ Theo
Browse files

Ajout de la méthode setAllPixelsToWhite pour initialiser la grille du...

Ajout de la méthode setAllPixelsToWhite pour initialiser la grille du constructeur avec que des pixels blancs
parent 7daa1b26
No related branches found
No related tags found
No related merge requests found
Pipeline #48818 passed
......@@ -22,7 +22,7 @@ public class MatrixGrayImage implements GrayImage {
@Override
public GrayColor getPixelGrayColor(int x, int y) {
return new ByteGrayColor(pixels[x][y].getLuminosity());
return pixels[x][y];
}
@Override
......@@ -40,10 +40,20 @@ public class MatrixGrayImage implements GrayImage {
return this.height;
}
public void setAllPixelsToWhite() {
for (int i = 0; i < this.width ; i++) {
for (int j = 0; j < this.height ; j++) {
setPixel(ByteGrayColor.WHITE, i, j);
}
}
}
public MatrixGrayImage(int width, int height){
this.width = width;
this.height = height;
this.pixels = new GrayColor[this.width][this.height];
setAllPixelsToWhite();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment