From aa695e0f700e9f23bcb735b17b0756beae7016c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAEZ=20Th=C3=A9o?= <theo.saez@etu.univ-amu.fr> Date: Wed, 21 May 2025 17:44:10 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20du=20constructeur=20Matr?= =?UTF-8?q?ixGrayImage=20et=20des=20m=C3=A9thodes=20getHeight=20et=20getWi?= =?UTF-8?q?dth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/MatrixGrayImage.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/java/MatrixGrayImage.java b/src/main/java/MatrixGrayImage.java index 3754867..e000478 100644 --- a/src/main/java/MatrixGrayImage.java +++ b/src/main/java/MatrixGrayImage.java @@ -32,23 +32,18 @@ public class MatrixGrayImage implements GrayImage { @Override public int getWidth() { - // TODO : Changer les instructions pour retourner la largeur de l'image. - return 600; + return this.width; } @Override public int getHeight() { - // TODO : Changer les instructions pour retourner la hauteur de l'image. - return 400; + return this.height; } public MatrixGrayImage(int width, int height){ - /* TODO : Modifier les instructions pour initialiser correctement - les propriétés de l'instance. - */ - this.width = 0; - this.height = 0; - this.pixels = null; + this.width = width; + this.height = height; + this.pixels = new GrayColor[this.width][this.height]; } -- GitLab