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
FieldsModifier and TypeFieldDescriptionprivate final Graphics2DThe Graphics object used for rendering.private final GridManagerTheGridManagerused to get thewidgets.private static final Loggerprivate final intPixel-Height of the render-surface, calculated byheight*supersampling.private final BufferedImageThe Image where the frames of the animation are drawn on.private final intPixel-Width of the render-surface, calculated bywidth*supersampling. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidResets theGraphics2Dto a blank frame.private voidrenderFrame(int frameIndex) Renders a single frame of the video.voidRenders 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
TheGridManagerused 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 theGraphics2Dto a blank frame.
-