Package edu.ntnu.stud.chaosgame.view
Class ChaosCanvasToImageConverter
java.lang.Object
edu.ntnu.stud.chaosgame.view.ChaosCanvasToImageConverter
This class converts the state of a ChaosCanvas to a WritableImage.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javafx.scene.image.WritableImage
The image to be created or reused. -
Constructor Summary
ConstructorsConstructorDescriptionChaosCanvasToImageConverter
(ChaosCanvas chaosCanvas, boolean useIntensity, javafx.scene.image.WritableImage image) Convert the canvas to a writable image. -
Method Summary
Modifier and TypeMethodDescriptionvoid
convertWithIntensity
(ChaosCanvas canvas) Convert the ChaosCanvas to an image using the intensity of the pixels to determine the color.void
convertWithoutIntensity
(ChaosCanvas chaosCanvas) Convert the ChaosCanvas to an image without concern for the intensity of the pixels.javafx.scene.image.WritableImage
getImage()
Get the image.
-
Field Details
-
image
private javafx.scene.image.WritableImage imageThe 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
Convert the ChaosCanvas to an image using the intensity of the pixels to determine the color.- Parameters:
canvas
- the ChaosCanvas to convert.
-
convertWithoutIntensity
Convert the ChaosCanvas to an image without concern for the intensity of the pixels.- Parameters:
chaosCanvas
- the ChaosCanvas to convert.
-