src/main/java/chalmers/pimp/service/ImageExportService.java
private static void renderToImage(BufferedImage img, Iterable<? extends IReadOnlyLayer> layers) {
    Objects.requireNonNull(img);
    Objects.requireNonNull(layers);

    int width = img.getWidth();
    int height = img.getHeight();
    IReadOnlyViewport viewport = ViewportFactory.createViewport(0, 0, width, height);
    IRenderer renderer = RendererFactory.createSwingRenderer(img.createGraphics(), viewport);

    for (IReadOnlyLayer layer : layers) {
      layer.draw(renderer, viewport);
    }
  }
/**
   * Renders the supplied layers on the supplied image.
   *
   * @param img    the image that will be rendered on.
   * @param layers the layers that will be rendered.
   * @throws NullPointerException if any references are {@code null}.
   */
Renders the supplied layers on the supplied image.
@param img    the image that will be rendered on.
@param layers the layers that will be rendered.
@throws NullPointerException if any references are  null.
Renders the supplied layers on the supplied image . @param img the image that will be rendered on . @param layers the layers that will be rendered . @throws NullPointerException if any references are null .
private static void renderToImage(BufferedImage img, Iterable<? extends IReadOnlyLayer> layers) {
    Objects.requireNonNull(img);
    Objects.requireNonNull(layers);
    int width = img.getWidth();
    int height = img.getHeight();
    IReadOnlyViewport viewport = ViewportFactory.createViewport(0, 0, width, height);
    IRenderer renderer = RendererFactory.createSwingRenderer(img.createGraphics(), viewport);
    for (IReadOnlyLayer layer : layers) {
      layer.draw(renderer, viewport);
    }
  }
private static void renderToImage ( BufferedImage img , Iterable < ? extends IReadOnlyLayer > layers ) { Objects . requireNonNull ( img ) ; Objects . requireNonNull ( layers ) ; int width = img . getWidth ( ) ; int height = img . getHeight ( ) ; IReadOnlyViewport viewport = ViewportFactory . createViewport ( 0 , 0 , width , height ) ; IRenderer renderer = RendererFactory . createSwingRenderer ( img . createGraphics ( ) , viewport ) ; for ( IReadOnlyLayer layer : layers ) { layer . draw ( renderer , viewport ) ; } }
Renders the supplied layers on the supplied image.
Renders the supplied layers on the supplied image .