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 boolean
protected ExecutorService
protected AtomicInteger
protected AtomicInteger
protected AtomicInteger
protected AtomicInteger
protected FrameRate
protected BufferedImage
protected TicToc
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
protected abstract void
doAddFrameByRunnable
(BufferedImage image, boolean isLastImage) protected abstract void
doAddFrameByRunnable
(BufferedImage image, int interFrameDelay, boolean isLastImage) void
export
(BufferedImage image) protected void
Handle images that should be exported regularly.protected void
getTimer()
boolean
Returns true if the delay is set globally or if it is defined per frame.boolean
isDebug()
protected void
scheduleImageExport
(BufferedImage image) protected void
scheduleImageExport
(BufferedImage image, boolean isLastImage) protected void
scheduleImageExport
(BufferedImage image, int interFrameDelay) protected void
scheduleImageExport
(BufferedImage image, int interFrameDelay, boolean isLastImage) void
setDebug
(boolean debug) void
boolean
Await 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:
export
in 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:
terminate
in 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)
-