Package yearreview.app.render
Class Renderer
java.lang.Object
yearreview.app.render.Renderer
A class that manages the renderprocess by generating the frames and passing them to a
VideoWorker
.- Author:
- ColdStone37
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Graphics2D
The Graphics object used for rendering.private final GridManager
TheGridManager
used to get thewidgets
.private static final Logger
private final int
Pixel-Height of the render-surface, calculated byheight
*supersampling
.private final BufferedImage
The Image where the frames of the animation are drawn on.private final int
Pixel-Width of the render-surface, calculated bywidth
*supersampling
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
Resets theGraphics2D
to a blank frame.private void
renderFrame
(int frameIndex) Renders a single frame of the video.void
Renders the video and saves it to a file.
-
Field Details
-
renderWidth
private final int renderWidthPixel-Width of the render-surface, calculated bywidth
*supersampling
. -
renderHeight
private final int renderHeightPixel-Height of the render-surface, calculated byheight
*supersampling
. -
renderingSurface
The Image where the frames of the animation are drawn on. -
graphics
The Graphics object used for rendering. -
grid
TheGridManager
used to get thewidgets
. -
logger
-
-
Constructor Details
-
Renderer
Default Constructor for a Renderer.- Parameters:
grid
- manager to get the widgets from
-
-
Method Details
-
renderVideo
public void renderVideo()Renders the video and saves it to a file. -
renderFrame
private void renderFrame(int frameIndex) Renders a single frame of the video.- Parameters:
frameIndex
- index of the frame to be rendered
-
drawBackground
private void drawBackground()Resets theGraphics2D
to a blank frame.
-