Search in sources :

Example 1 with FlameBGColorHandler

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;
}
Also used : FlameBGColorHandler(org.jwildfire.create.tina.render.FlameBGColorHandler) FlameRenderer(org.jwildfire.create.tina.render.FlameRenderer) RenderInfo(org.jwildfire.create.tina.render.RenderInfo) AbstractRenderThread(org.jwildfire.create.tina.render.AbstractRenderThread)

Example 2 with FlameBGColorHandler

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();
}
Also used : FlameBGColorHandler(org.jwildfire.create.tina.render.FlameBGColorHandler) FlameRenderer(org.jwildfire.create.tina.render.FlameRenderer) RenderInfo(org.jwildfire.create.tina.render.RenderInfo) Flame(org.jwildfire.create.tina.base.Flame)

Example 3 with FlameBGColorHandler

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);
    }
}
Also used : FlameBGColorHandler(org.jwildfire.create.tina.render.FlameBGColorHandler) SimpleImage(org.jwildfire.image.SimpleImage)

Aggregations

FlameBGColorHandler (org.jwildfire.create.tina.render.FlameBGColorHandler)3 FlameRenderer (org.jwildfire.create.tina.render.FlameRenderer)2 RenderInfo (org.jwildfire.create.tina.render.RenderInfo)2 Flame (org.jwildfire.create.tina.base.Flame)1 AbstractRenderThread (org.jwildfire.create.tina.render.AbstractRenderThread)1 SimpleImage (org.jwildfire.image.SimpleImage)1