use of org.jwildfire.create.tina.render.FlameBGColorHandler in project JWildfire by thargor6.
the class DetachedPreviewController method startRender.
public void startRender() {
cancelRender();
setPaused(false);
currQuality = 0.0;
if (flame == null || refreshing) {
return;
}
refreshImagePanel();
clearScreen();
ImgSize size = getImgSize();
RenderInfo info = new RenderInfo(size.getWidth(), size.getHeight(), RenderMode.PREVIEW);
double wScl = (double) info.getImageWidth() / (double) flame.getWidth();
double hScl = (double) info.getImageHeight() / (double) flame.getHeight();
flame.setPixelsPerUnit((wScl + hScl) * 0.5 * flame.getPixelsPerUnit());
flame.setWidth(info.getImageWidth());
flame.setHeight(info.getImageHeight());
flame.setSampleDensity(10);
info.setRenderHDR(false);
info.setRenderZBuffer(false);
new FlameBGColorHandler(flame).fillBackground(image);
renderer = new FlameRenderer(flame, prefs, flame.isBGTransparency(), false);
renderer.registerIterationObserver(this);
displayUpdater = createDisplayUpdater();
displayUpdater.initRender(prefs.getTinaRenderThreads());
threads = renderer.startRenderFlame(info);
for (Thread thread : threads.getExecutingThreads()) {
thread.setPriority(Thread.MIN_PRIORITY);
}
updateDisplayThread = new UpdateDisplayThread();
updateDisplayExecuteThread = new Thread(updateDisplayThread);
updateDisplayExecuteThread.setPriority(Thread.MIN_PRIORITY);
updateDisplayExecuteThread.start();
state = State.RENDER;
}
use of org.jwildfire.create.tina.render.FlameBGColorHandler in project JWildfire by thargor6.
the class JWildfireApplet method renderButton_clicked.
public void renderButton_clicked() {
clearScreen();
ImgSize size = getImgSize();
RenderInfo info = new RenderInfo(size.getWidth(), size.getHeight(), RenderMode.PREVIEW);
Flame flame = getCurrFlame();
double wScl = (double) info.getImageWidth() / (double) flame.getWidth();
double hScl = (double) info.getImageHeight() / (double) flame.getHeight();
flame.setPixelsPerUnit((wScl + hScl) * 0.5 * flame.getPixelsPerUnit());
flame.setWidth(info.getImageWidth());
flame.setHeight(info.getImageHeight());
flame.setSampleDensity(10);
info.setRenderHDR(false);
info.setRenderZBuffer(false);
new FlameBGColorHandler(flame).fillBackground(image);
initRender(prefs.getTinaRenderThreads());
renderer = new FlameRenderer(flame, prefs, flame.isBGTransparency(), false);
renderer.registerIterationObserver(this);
renderStartTime = System.currentTimeMillis();
pausedRenderTime = 0;
threads = renderer.startRenderFlame(info);
state = State.RENDER;
enableControls();
}
use of org.jwildfire.create.tina.render.FlameBGColorHandler in project JWildfire by thargor6.
the class FlamePreviewHelper method initImage.
private void initImage(SimpleImage pImage, Flame flame) {
if (flame.getBGImageFilename() != null && !flame.getBGImageFilename().isEmpty()) {
try {
SimpleImage bgImg = (SimpleImage) RessourceManager.getImage(flame.getBGImageFilename());
pImage.fillBackground(bgImg);
} catch (Exception ex) {
ex.printStackTrace();
}
} else {
new FlameBGColorHandler(flame).fillBackground(pImage);
}
}
Aggregations