use of org.jwildfire.create.tina.render.image.PostFilterImageThread in project JWildfire by thargor6.
the class FlameRenderer method postFilterImage.
private void postFilterImage(SimpleImage pImage) {
if (pImage != null) {
int threadCount = prefs.getTinaRenderThreads();
if (threadCount < 1 || pImage.getImageHeight() < 8 * threadCount) {
threadCount = 1;
}
int rowsPerThread = pImage.getImageHeight() / threadCount;
SimpleImage input = pImage.clone();
List<PostFilterImageThread> threads = new ArrayList<PostFilterImageThread>();
for (int i = 0; i < threadCount; i++) {
int startRow = i * rowsPerThread;
int endRow = i < threadCount - 1 ? startRow + rowsPerThread : pImage.getImageHeight();
PostFilterImageThread thread = new PostFilterImageThread(startRow, endRow, input, pImage, flame.getPostNoiseFilterThreshold());
threads.add(thread);
if (threadCount > 1) {
new Thread(thread).start();
} else {
thread.run();
}
}
ThreadTools.waitForThreads(threadCount, threads);
}
}
Aggregations