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
| for (int i = 0; i < width; ++i)
{
monTest.getMaBarre().setValue ( i * height * (rayonMax-rayonMin) * 90 );
for (int j = 0; j < height; ++j)
{
for (int k = rayonMin; k <= rayonMax; ++k)
{
for (int theta = 0 ; theta < 360 ; theta += (2*Math.PI*k < 60)?2:4)
{
t = (theta * Math.PI) / 180;
x0 = (int)Math.round(i - k * Math.cos(t));
y0 = (int)Math.round(j - k * Math.sin(t));
// System.out.println("Theta : " + theta);
// System.out.println("x0 : " + x0);
// System.out.println("y0 : " + y0);
if(x0 < width && x0 > 0 && y0 < height && y0 > 0)
{
code = Code_Color(-img.getRGB(x0, y0));
// System.out.println("Calcul : " + (code [0] + code [1] + code [2]) / 3);
if ((code [0] + code [1] + code [2]) / 3 > 150)
{
++ accu[i][j][k];
}
}
}
}
}
} |
Partager