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 void
render()
Calculates the colours of each pixel, write them to the ImageWriter, then write the image to the output file.void
task()
The task to be performed.java.util.List<TaskTracker>
taskTrackers()
Get a list of all registeredTaskTracker
s.int
totalJobs()
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, wait
Methods 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:Task
The task to be performed. This function will be called byTask.performTask()
. -
taskTrackers
Description copied from interface:Task
Get a list of all registeredTaskTracker
s.- Specified by:
taskTrackers
in interfaceTask
- Returns:
- A list of all registered
TaskTracker
s.
-
totalJobs
public int totalJobs()Description copied from interface:Task
Get the total number of jobs to be performed.
-