mise a jour du travail apres visualisation du diagrame
This commit is contained in:
@@ -1,6 +1,23 @@
|
|||||||
package fr.iutfbleau.sae;
|
package fr.iutfbleau.sae;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.io.*;
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
public class ConverterController {
|
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;
|
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;
|
package fr.iutfbleau.sae;
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
import java.io.*;
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
|
|
||||||
public class RGBImage {
|
public class RGBImage {
|
||||||
|
|
||||||
public BufferedImage chargementDeImage(File f){
|
private int width;
|
||||||
//verification si le fichier contient quelque chose, si il est exesistant et si c'est un fichier "normal" d'apres la javadoc.
|
private int height;
|
||||||
if (f == null || !f.exists() || !f.isFile()) {
|
private Pixel [] pixels
|
||||||
return null;
|
|
||||||
|
public int getWidth() {
|
||||||
|
return width;
|
||||||
}
|
}
|
||||||
BufferedImage image;
|
|
||||||
try {
|
public int getHeight() {
|
||||||
image = ImageIO.read(f);
|
return height;
|
||||||
} catch (IOExeption e){
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
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