src/exercises/o2_executors/Problem2_2.java
private static void plot(int[][] imageArea) throws IOException
  {
    int width = imageArea.length;
    int height = imageArea.length;

    BufferedImage imageOut = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);

    for (int i = 0; i < width; i++)
    {
      for (int j = 0; j < height; j++)
      {
        int rgb = getRgbColor(imageArea[i][j]);
        imageOut.setRGB(i, j, rgb);
      }
    }

    File file = new File("Mandelbrot.png");
    ImageIO.write(imageOut, "png", file);
  }
// store the array as png-file using the specified color map
store the array as png-file using the specified color map
store the array as png - file using the specified color map
private static void plot(int[][] imageArea) throws IOException
  {
    int width = imageArea.length;
    int height = imageArea.length;
    BufferedImage imageOut = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    for (int i = 0; i < width; i++)
    {
      for (int j = 0; j < height; j++)
      {
        int rgb = getRgbColor(imageArea[i][j]);
        imageOut.setRGB(i, j, rgb);
      }
    }
    File file = new File("Mandelbrot.png");
    ImageIO.write(imageOut, "png", file);
  }
private static void plot ( int [ ] [ ] imageArea ) throws IOException { int width = imageArea . length ; int height = imageArea . length ; BufferedImage imageOut = new BufferedImage ( width , height , BufferedImage . TYPE_INT_RGB ) ; for ( int i = 0 ; i < width ; i ++ ) { for ( int j = 0 ; j < height ; j ++ ) { int rgb = getRgbColor ( imageArea [ i ] [ j ] ) ; imageOut . setRGB ( i , j , rgb ) ; } } File file = new File ( "Mandelbrot.png" ) ; ImageIO . write ( imageOut , "png" , file ) ; }
store the array as png-file using the specified color map
store the array as png - file using the specified color map