Package paintingcanvas.extensions
Class Recorder
- java.lang.Object
-
- paintingcanvas.extensions.Recorder
-
- All Implemented Interfaces:
RenderLifecycle
public class Recorder extends java.lang.Object implements RenderLifecycle
A class that allows you to record the canvas to a image sequence, can be combined using ffmpeg or something similarstores the images in a temporary directory using
Files.createTempDirectory(java.nio.file.Path, java.lang.String, java.nio.file.attribute.FileAttribute<?>...)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface paintingcanvas.canvas.RenderLifecycle
RenderLifecycle.AntiAliasingLifecycle, RenderLifecycle.CenteringLifecycle, RenderLifecycle.ResizeListener
-
-
Constructor Summary
Constructors Constructor Description Recorder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Recorderrecord(java.nio.file.Path path, java.lang.String format)voidrenderEnd(java.awt.Graphics2D g)Runs after everything else; theimageinCanvasPanelwill not reflect your changes.voidscreenshot(java.io.File file, java.lang.String format)Recorderstop()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface paintingcanvas.canvas.RenderLifecycle
Modifier and Type Method Description default voidattach()Attach this lifecycle to the canvasdefault voidonResize(CanvasPanel canvas, java.awt.event.ComponentEvent e)default voidpostRender(java.awt.Graphics2D g)Runs after everything else; theimageinCanvasPanelwill reflect your changes.default voidpreRender(java.awt.Graphics2D g)Runs before everything else; theimageinCanvasPanelwill reflect your changes.default voidrenderEnd(java.awt.Graphics2D g)Runs after everything else; theimageinCanvasPanelwill not reflect your changes.default voidrenderStart(java.awt.Graphics2D g)Runs before everything else; theimageinCanvasPanelwill not reflect your changes.
-
-
-
-
Method Detail
-
record
public Recorder record(java.nio.file.Path path, java.lang.String format)
-
stop
public Recorder stop()
-
screenshot
public void screenshot(java.io.File file, java.lang.String format)
-
renderEnd
public void renderEnd(java.awt.Graphics2D g)
Description copied from interface:RenderLifecycleRuns after everything else; theimageinCanvasPanelwill not reflect your changes.- Specified by:
renderEndin interfaceRenderLifecycle- Parameters:
g- The graphics context
-
-