1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| for (int i = 1; i < width-1; i++) {
for (int j = 1; j < height-1; j++) {
int boo = outImgbonb.getRGB(i,j);
int bo = (boo >> 16) & 0xff;
float courb = 0f;
if (bo<32 || bo>224)
courb = (float) Math.abs((outImgbonb.getRGB(i-1,j)&0xff-outImgbonb.getRGB(i+1,j)&0xff));
else if (bo>=32 && bo<96)
courb = (float) Math.abs((outImgbonb.getRGB(i-1,j+1)&0xff)-(outImgbonb.getRGB(i+1,j-1)&0xff));
else if (bo>=96 && bo<160)
courb = (float) Math.abs(((outImgbonb.getRGB(i,j-1))&0xff-outImgbonb.getRGB(i,j+1)&0xff));
else if (bo>=160 && bo<224)
courb = (float) Math.abs((outImgbonb.getRGB(i-1,j-1)&0xff-outImgbonb.getRGB(i+1,j+1)&0xff));
if (courb>=128)
courb=255-courb;
if (courb<=64) //Limitation courbure entre 2 pixels
{
courb=courb*4; //Mise à echelle
float hue = courb/255.0f;
Color c=new Color(hue,hue,hue);
outImgc.setRGB(i,j,c.getRGB());
}
else {
// on ne veut pas affiche ce pixel au final quand on affichera l'image
// hors une image c'est une matrice 2D de pixels : tout pixel de cette image existe et doit avoir une couleur._
// il y a donc quelque chose à faire du type outImgc.setRGB(i,j, couleur) ici !!!
// donc voir/lire ce que je t'ai déjà écrit à ce sujet, parce que je ne peux pas deviner comment est ton image
}
}} |
Partager