Package rendering
Class Renderer
java.lang.Object
rendering.Renderer
- All Implemented Interfaces:
Task
public class Renderer extends java.lang.Object implements Task
This class is responsible for communicating between a
RayTracer and an ImageWriter.-
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidrender()Calculates the colours of each pixel, write them to the ImageWriter, then write the image to the output file.voidtask()The task to be performed.java.util.List<TaskTracker>taskTrackers()Get a list of all registeredTaskTrackers.inttotalJobs()Get the total number of jobs to be performed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cli.Task
completeJobs, finished, performTask, register, start
-
Constructor Details
-
Renderer
Construct a renderer with the provided data.- Parameters:
camera- The camera to use to render the scene.rayTracer- The rayTracer to use to calculate the colour of each pixel.filename- The filename to write the rendered image to.threads- The number of threads to use to render the image.
-
-
Method Details
-
render
public void render()Calculates the colours of each pixel, write them to the ImageWriter, then write the image to the output file. -
task
public void task()Description copied from interface:TaskThe task to be performed. This function will be called byTask.performTask(). -
taskTrackers
Description copied from interface:TaskGet a list of all registeredTaskTrackers.- Specified by:
taskTrackersin interfaceTask- Returns:
- A list of all registered
TaskTrackers.
-
totalJobs
public int totalJobs()Description copied from interface:TaskGet the total number of jobs to be performed.
-