Package org.jzy3d.io
Class AbstractImageExporter
java.lang.Object
org.jzy3d.io.AbstractImageExporter
- All Implemented Interfaces:
AWTImageExporter
- Direct Known Subclasses:
GifExporter
The
AbstractImageExporter can receive BufferedImage image from a renderer to
export them somewhere.
The exporter as a target frame rate. If it receive images at a higher rate, exceeding images will
be dropped. If it receive images as a lower rate, it will repeat the last known image until the
new one arrives.
The exporter uses its own thread to handle export image queries without slowing down the caller
thread.- Author:
- Martin Pernollet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected ExecutorServiceprotected AtomicIntegerprotected AtomicIntegerprotected AtomicIntegerprotected AtomicIntegerprotected FrameRateprotected BufferedImageprotected TicToc -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidprotected abstract voiddoAddFrameByRunnable(BufferedImage image, boolean isLastImage) protected abstract voiddoAddFrameByRunnable(BufferedImage image, int interFrameDelay, boolean isLastImage) voidexport(BufferedImage image) protected voidHandle images that should be exported regularly.protected voidgetTimer()booleanReturns true if the delay is set globally or if it is defined per frame.booleanisDebug()protected voidscheduleImageExport(BufferedImage image) protected voidscheduleImageExport(BufferedImage image, boolean isLastImage) protected voidscheduleImageExport(BufferedImage image, int interFrameDelay) protected voidscheduleImageExport(BufferedImage image, int interFrameDelay, boolean isLastImage) voidsetDebug(boolean debug) voidbooleanAwait completion of all image addition, add the last image, and finish the file.
-
Field Details
-
previousImage
-
timer
-
numberSubmittedImages
-
numberOfPendingImages
-
numberOfSkippedImages
-
numberOfSavedImages
-
executor
-
outputFrameRate
-
debug
protected boolean debug
-
-
Constructor Details
-
AbstractImageExporter
-
-
Method Details
-
export
- Specified by:
exportin interfaceAWTImageExporter
-
exportWithVariableFrameRate
-
exportWithContinuousFrameRate
Handle images that should be exported regularly. Skip image if comes too early w.r.t. global delay, repeat image if it comes too late w.r.t global delay, simply add it otherwise.- Parameters:
image-
-
scheduleImageExport
-
scheduleImageExport
-
doAddFrameByRunnable
protected abstract void doAddFrameByRunnable(BufferedImage image, boolean isLastImage) throws IOException - Throws:
IOException
-
scheduleImageExport
-
scheduleImageExport
-
doAddFrameByRunnable
protected abstract void doAddFrameByRunnable(BufferedImage image, int interFrameDelay, boolean isLastImage) throws IOException - Throws:
IOException
-
terminate
Await completion of all image addition, add the last image, and finish the file. If a time unit is given, the timeout Returns true if all images have been flushed before the timeout ends, false otherwise- Specified by:
terminatein interfaceAWTImageExporter
-
closeOutput
- Throws:
IOException
-
isContinuousFrameRate
public boolean isContinuousFrameRate()Returns true if the delay is set globally or if it is defined per frame. -
getTimer
-
setTimer
-
getNumberSubmittedImages
-
getNumberOfSkippedImages
-
getNumberOfSavedImages
-
isDebug
public boolean isDebug() -
setDebug
public void setDebug(boolean debug)
-