diff --git a/src/fr/iutfbleau/sae/ConverterController.java b/src/fr/iutfbleau/sae/ConverterController.java index 5f0bf03..b1698d2 100644 --- a/src/fr/iutfbleau/sae/ConverterController.java +++ b/src/fr/iutfbleau/sae/ConverterController.java @@ -1,6 +1,23 @@ package fr.iutfbleau.sae; +import java.awt.*; +import java.io.*; +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; public class ConverterController { + + public BufferedImage loadImage(File f){ + //verification si le fichier contient quelque chose, si il est exesistant et si c'est un fichier "normal" d'apres la javadoc. + if (f == null || !f.exists() || !f.isFile()) { + return null; + } + BufferedImage image; + try { + image = ImageIO.read(f); + } catch (IOExeption e){ + return null; + } + return image; } diff --git a/src/fr/iutfbleau/sae/mimage/Pixel.java b/src/fr/iutfbleau/sae/mimage/Pixel.java index 63ac671..f4f37e1 100644 --- a/src/fr/iutfbleau/sae/mimage/Pixel.java +++ b/src/fr/iutfbleau/sae/mimage/Pixel.java @@ -1,4 +1,36 @@ package fr.iutfbleau.sae; -public class Pixel { +public class Pixel{ + private int r; + private int g; + private int b; + + //à completer + public Pixel(){ + + } + + public int getB() { + return b; + } + + public int getG() { + return g; + } + + public int getR() { + return r; + } + + public void setR(int r) { + this.r = r; + } + + public void setB(int b) { + this.b = b; + } + + public void setG(int g) { + this.g = g; + } } \ No newline at end of file diff --git a/src/fr/iutfbleau/sae/mimage/RGBImage.java b/src/fr/iutfbleau/sae/mimage/RGBImage.java index df20cea..a0b99e4 100644 --- a/src/fr/iutfbleau/sae/mimage/RGBImage.java +++ b/src/fr/iutfbleau/sae/mimage/RGBImage.java @@ -1,24 +1,24 @@ package fr.iutfbleau.sae; -import java.awt.*; -import java.io.*; -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; - public class RGBImage { - public BufferedImage chargementDeImage(File f){ - //verification si le fichier contient quelque chose, si il est exesistant et si c'est un fichier "normal" d'apres la javadoc. - if (f == null || !f.exists() || !f.isFile()) { - return null; - } - BufferedImage image; - try { - image = ImageIO.read(f); - } catch (IOExeption e){ - return null; - } - return image; -//a completer encore + private int width; + private int height; + private Pixel [] pixels + + public int getWidth() { + return width; + } + + public int getHeight() { + return height; + } + + public Pixel[] getPixels() { + return pixels; + } + + public void setPixels(Pixel[] pixels) { + this.pixels = pixels; } } \ No newline at end of file