|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.co.silentsoftware.dispatcher.WorkDispatcher
public class WorkDispatcher
Central class for the work engine that initialises a fixed thread pool and submits work for preprocessing and processing. This class also holds queues for the pre processed images (for work in process preview) and and the final images (used for both output and work in process preview).
| Field Summary | |
|---|---|
private static java.util.concurrent.ExecutorService |
exec
The processing thread |
private static java.util.Queue<java.awt.image.BufferedImage> |
graphicsPreProcessedQueue
The pre processed image queue for WIP preview |
private static java.util.Queue<java.awt.image.BufferedImage> |
graphicsResultsQueue
The actual processed image queue for WIP preview (NOT for saving, although the references held are the same object) |
static int |
THREAD_COUNT
The number of preview threads based on CPU count*4. |
| Constructor Summary | |
|---|---|
WorkDispatcher()
|
|
| Method Summary | |
|---|---|
static void |
pollGraphicsResults()
Pops (polls) the first element off the processing queues, typically done after a preview has been shown. |
static java.awt.image.BufferedImage[] |
retrieveGraphicsResults()
Returns the best effort sync'd first (peeked) images from the pre processed and graphics results queues, i.e. |
static void |
setThreadsPerCPU(int threads)
Reconfigure the engine WARNING: Calling this will stop any current processing!! |
static void |
shutdownNow()
Shut down this engine and threads |
static java.util.concurrent.Future<WorkContainer> |
submitPreviewWork(java.awt.image.BufferedImage original,
java.lang.Object dither)
Similar to submit work (the same processing procedure is followed) however the output is not added to any queues and no SCR output is provided. |
static java.util.concurrent.Future<WorkContainer> |
submitWork(java.awt.image.BufferedImage original,
boolean scrRequired)
Submit a buffered image to be pre processed and processed by a single thread The resulting Future |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int THREAD_COUNT
private static java.util.concurrent.ExecutorService exec
private static java.util.Queue<java.awt.image.BufferedImage> graphicsPreProcessedQueue
private static java.util.Queue<java.awt.image.BufferedImage> graphicsResultsQueue
| Constructor Detail |
|---|
public WorkDispatcher()
| Method Detail |
|---|
public static void shutdownNow()
public static void setThreadsPerCPU(int threads)
threads -
public static java.util.concurrent.Future<WorkContainer> submitWork(java.awt.image.BufferedImage original,
boolean scrRequired)
original - scrRequired -
public static java.util.concurrent.Future<WorkContainer> submitPreviewWork(java.awt.image.BufferedImage original,
java.lang.Object dither)
original - dither -
submitWork(BufferedImage, boolean)public static java.awt.image.BufferedImage[] retrieveGraphicsResults()
public static void pollGraphicsResults()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||