src/main/java/chalmers/pimp/service/RasterDataService.java
public static IRasterData createPixelDataCopy(Image image) {
    Objects.requireNonNull(image);

    final int imageWidth = (int) image.getWidth();
    final int imageHeight = (int) image.getHeight();

    IRasterData rasterData = RasterDataFactory.createRasterData(imageWidth, imageHeight);
    PixelReader reader = image.getPixelReader();

    for (int row = 0; row < imageHeight; row++) {
      writeImageRow(rasterData, reader, imageWidth, row);
    }

    return rasterData;
  }
/**
   * Creates a pixel data copy of the supplied JavaFX image.
   *
   * @param image the image that will be copied.
   * @return a pixel data copy of the supplied JavaFX image.
   * @throws NullPointerException if the supplied image is {@code null}.
   */
Creates a pixel data copy of the supplied JavaFX image.
@param image the image that will be copied.
@return a pixel data copy of the supplied JavaFX image.
@throws NullPointerException if the supplied image is  null.
Creates a pixel data copy of the supplied JavaFX image . @param image the image that will be copied . @return a pixel data copy of the supplied JavaFX image . @throws NullPointerException if the supplied image is null .
public static IRasterData createPixelDataCopy(Image image) {
    Objects.requireNonNull(image);
    final int imageWidth = (int) image.getWidth();
    final int imageHeight = (int) image.getHeight();
    IRasterData rasterData = RasterDataFactory.createRasterData(imageWidth, imageHeight);
    PixelReader reader = image.getPixelReader();
    for (int row = 0; row < imageHeight; row++) {
      writeImageRow(rasterData, reader, imageWidth, row);
    }
    return rasterData;
  }
public static IRasterData createPixelDataCopy ( Image image ) { Objects . requireNonNull ( image ) ; final int imageWidth = ( int ) image . getWidth ( ) ; final int imageHeight = ( int ) image . getHeight ( ) ; IRasterData rasterData = RasterDataFactory . createRasterData ( imageWidth , imageHeight ) ; PixelReader reader = image . getPixelReader ( ) ; for ( int row = 0 ; row < imageHeight ; row ++ ) { writeImageRow ( rasterData , reader , imageWidth , row ) ; } return rasterData ; }
Creates a pixel data copy of the supplied JavaFX image.
Creates a pixel data copy of the supplied JavaFX image .