Class ChaosCanvasToImageConverter

java.lang.Object
edu.ntnu.stud.chaosgame.view.ChaosCanvasToImageConverter

public class ChaosCanvasToImageConverter extends Object
This class converts the state of a ChaosCanvas to a WritableImage.
  • Field Details

    • image

      private javafx.scene.image.WritableImage image
      The image to be created or reused.
  • Constructor Details

    • ChaosCanvasToImageConverter

      public ChaosCanvasToImageConverter(ChaosCanvas chaosCanvas, boolean useIntensity, javafx.scene.image.WritableImage image)
      Convert the canvas to a writable image.
      Parameters:
      chaosCanvas - the canvas to work upon.
      useIntensity - whether to use intensity for coloring.
      image - the reusable image.
  • Method Details

    • getImage

      public javafx.scene.image.WritableImage getImage()
      Get the image.
      Returns:
      the image.
    • convertWithIntensity

      public void convertWithIntensity(ChaosCanvas canvas)
      Convert the ChaosCanvas to an image using the intensity of the pixels to determine the color.
      Parameters:
      canvas - the ChaosCanvas to convert.
    • convertWithoutIntensity

      public void convertWithoutIntensity(ChaosCanvas chaosCanvas)
      Convert the ChaosCanvas to an image without concern for the intensity of the pixels.
      Parameters:
      chaosCanvas - the ChaosCanvas to convert.