Package kiyut.citra.canvas
Class FXRenderer
- java.lang.Object
-
- kiyut.citra.canvas.FXRenderer
-
public class FXRenderer extends Object
FXRenderer for the FXCanvas- Author:
- Kiyut
-
-
Field Summary
Fields Modifier and Type Field Description protected FXCanvascanvasprotected Filefileprotected BufferedImageOpfilterOpprotected BufferedImageimageprotected booleanreloadFileprotected booleanselectionFilterprotected BufferedImagesource
-
Constructor Summary
Constructors Constructor Description FXRenderer(FXCanvas canvas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply()Apply filter operation which means change the source image into the result of filterprotected voidcrop(Area area)Crop Source Imagevoiddiscard()Discard filter operationBufferedImageOpgetFilterOp()Return the filterOpFilegetImageFile()Return fileBufferedImagegetRenderedImage()Return the rendered imageBufferedImagegetSourceImage()Return the source imagevoidrender()render the image using the applied filter from sourceImage into renderedImage if there are selection Area, the filter will only applied to that area, otherwise the whole image.voidsetFilterOp(BufferedImageOp filterOp)Set the filterOpvoidsetImageFile(File file, boolean open)Set the Image file, if the param open is true file will be loaded after the first render call otherwise only set the file only, does not open or loading the image file
-
-
-
Field Detail
-
file
protected File file
-
reloadFile
protected boolean reloadFile
-
image
protected BufferedImage image
-
source
protected BufferedImage source
-
filterOp
protected BufferedImageOp filterOp
-
canvas
protected FXCanvas canvas
-
selectionFilter
protected boolean selectionFilter
-
-
Constructor Detail
-
FXRenderer
public FXRenderer(FXCanvas canvas)
-
-
Method Detail
-
getSourceImage
public BufferedImage getSourceImage()
Return the source image- Returns:
- BufferedImage
-
getRenderedImage
public BufferedImage getRenderedImage()
Return the rendered image- Returns:
- BufferedImage
-
setImageFile
public void setImageFile(File file, boolean open)
Set the Image file, if the param open is true file will be loaded after the first render call otherwise only set the file only, does not open or loading the image file- Parameters:
file- Fileopen- true/false, if true file will be loaded after the first render call- See Also:
getImageFile()
-
getImageFile
public File getImageFile()
Return file- Returns:
- File
- See Also:
setImageFile(File,boolean)
-
setFilterOp
public void setFilterOp(BufferedImageOp filterOp)
Set the filterOp- Parameters:
filterOp- BufferedImageOp- See Also:
getFilterOp()
-
getFilterOp
public BufferedImageOp getFilterOp()
Return the filterOp- Returns:
- BufferedImageOp
- See Also:
setFilterOp(BufferedImageOp)
-
apply
public void apply()
Apply filter operation which means change the source image into the result of filter
-
discard
public void discard()
Discard filter operation
-
crop
protected void crop(Area area)
Crop Source Image- Parameters:
area- the specified area for cropping
-
render
public void render()
render the image using the applied filter from sourceImage into renderedImage if there are selection Area, the filter will only applied to that area, otherwise the whole image. If the filterOp or source is null, nothing performed
-
-