mise a jour du travail apres visualisation du diagrame
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
private int width;
|
||||
private int height;
|
||||
private Pixel [] pixels
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
BufferedImage image;
|
||||
try {
|
||||
image = ImageIO.read(f);
|
||||
} catch (IOExeption e){
|
||||
return null;
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
return image;
|
||||
//a completer encore
|
||||
|
||||
public Pixel[] getPixels() {
|
||||
return pixels;
|
||||
}
|
||||
|
||||
public void setPixels(Pixel[] pixels) {
|
||||
this.pixels = pixels;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user