Eu estou aprendendo Processamento de Imagens e preciso desenhar bandeiras. Caiu pra mim fazer a de Israel, porém não tenho ideia de como desenhar uma estrela:
int width = 500;
int height = 500;
BufferedImage image= new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);
WritableRaster raster = image.getRaster();
int[] blue = new int[] {0,0,255};
int[] white = new int[] {255,255,255};
for(int h = 0; h < height; h++){
for(int w = 0; w < width; w++){
if (w < 500) {
raster.setPixel(w, h, white);
}
if (h >= 40 && h < 100)
{
raster.setPixel(w, h, blue);
}
if (h >= 400 && h < 460)
{
raster.setPixel (w, h, blue);
}
}
ImageIO.write(image, "PNG", new File("Israel.png"));
Esse é o código. Alguém tem alguma ideia de como faz?