Class Renderer

java.lang.Object
yearreview.app.render.Renderer

public class Renderer extends Object
A class that manages the renderprocess by generating the frames and passing them to a VideoWorker.
Author:
ColdStone37
  • Field Details

    • renderWidth

      private final int renderWidth
      Pixel-Width of the render-surface, calculated by width*supersampling.
    • renderHeight

      private final int renderHeight
      Pixel-Height of the render-surface, calculated by height*supersampling.
    • renderingSurface

      private final BufferedImage renderingSurface
      The Image where the frames of the animation are drawn on.
    • graphics

      private final Graphics2D graphics
      The Graphics object used for rendering.
    • grid

      private final GridManager grid
      The GridManager used to get the widgets.
    • logger

      private static final Logger logger
  • Constructor Details

    • Renderer

      public Renderer(GridManager grid)
      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 the Graphics2D to a blank frame.