Search in sources :

Example 16 with FlameRenderer

use of org.jwildfire.create.tina.render.FlameRenderer in project JWildfire by thargor6.

the class TinaSWFAnimatorController method createPartPreview.

private SimpleImage createPartPreview(final FlameMoviePart pPart, int imageWidth, int imageHeight) {
    RenderInfo info = new RenderInfo(imageWidth, imageHeight, RenderMode.PREVIEW);
    Flame flame = pPart.getFlame().makeCopy();
    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(imageWidth);
    flame.setHeight(imageHeight);
    FlameRenderer renderer = new FlameRenderer(flame, prefs, false, false);
    RenderedFlame res = renderer.renderFlame(info);
    return res.getImage();
}
Also used : FlameRenderer(org.jwildfire.create.tina.render.FlameRenderer) RenderInfo(org.jwildfire.create.tina.render.RenderInfo) RenderedFlame(org.jwildfire.create.tina.render.RenderedFlame) Flame(org.jwildfire.create.tina.base.Flame) RenderedFlame(org.jwildfire.create.tina.render.RenderedFlame)

Example 17 with FlameRenderer

use of org.jwildfire.create.tina.render.FlameRenderer in project JWildfire by thargor6.

the class MeshGenController method refreshFlameImage.

public void refreshFlameImage(boolean pQuickRender, JPanel pRootPanel, FlameHolder pFlameHolder) {
    if (!refreshing) {
        FlamePanel imgPanel = getFlamePanel(pRootPanel, pFlameHolder);
        Rectangle bounds = imgPanel.getImageBounds();
        int width = bounds.width;
        int height = bounds.height;
        if (width >= 16 && height >= 16) {
            RenderInfo info = new RenderInfo(width, height, RenderMode.PREVIEW);
            Flame flame = pFlameHolder.getFlame();
            if (flame != null) {
                double oldSpatialFilterRadius = flame.getSpatialFilterRadius();
                double oldSampleDensity = flame.getSampleDensity();
                try {
                    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());
                    FlameRenderer renderer = new FlameRenderer(flame, prefs, false, false);
                    if (pQuickRender) {
                        renderer.setProgressUpdater(null);
                        flame.setSampleDensity(3.0);
                        flame.setSpatialFilterRadius(0.0);
                    } else {
                        renderer.setProgressUpdater(renderSequenceProgressUpdater);
                        flame.setSampleDensity(prefs.getTinaRenderPreviewQuality());
                    }
                    RenderedFlame res = renderer.renderFlame(info);
                    imgPanel.setImage(res.getImage());
                } finally {
                    flame.setSpatialFilterRadius(oldSpatialFilterRadius);
                    flame.setSampleDensity(oldSampleDensity);
                }
            }
        } else {
            imgPanel.setImage(new SimpleImage(width, height));
        }
        pRootPanel.repaint();
    }
}
Also used : SimpleImage(org.jwildfire.image.SimpleImage) Rectangle(java.awt.Rectangle) FlamePanel(org.jwildfire.create.tina.swing.flamepanel.FlamePanel) FlameRenderer(org.jwildfire.create.tina.render.FlameRenderer) RenderInfo(org.jwildfire.create.tina.render.RenderInfo) RenderedFlame(org.jwildfire.create.tina.render.RenderedFlame) Flame(org.jwildfire.create.tina.base.Flame) RenderedFlame(org.jwildfire.create.tina.render.RenderedFlame)

Example 18 with FlameRenderer

use of org.jwildfire.create.tina.render.FlameRenderer in project JWildfire by thargor6.

the class RenderSlicesThread method doRender.

@Override
protected void doRender() {
    renderer = new FlameRenderer(flame, prefs, flame.isBGTransparency(), false);
    renderer.setProgressUpdater(progressUpdater);
    renderer = new FlameRenderer(flame, prefs, flame.isBGTransparency(), false);
    int width = renderWidth;
    int height = renderHeight;
    RenderInfo info = new RenderInfo(width, height, RenderMode.PRODUCTION);
    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(quality);
    renderer.setProgressUpdater(progressUpdater);
    SliceRenderInfo renderInfo = new SliceRenderInfo(renderWidth, renderHeight, RenderMode.PRODUCTION, slicesCount, zmin, zmax, slicesPerRender);
    renderer.renderSlices(renderInfo, outFilePattern);
}
Also used : FlameRenderer(org.jwildfire.create.tina.render.FlameRenderer) SliceRenderInfo(org.jwildfire.create.tina.render.SliceRenderInfo) RenderInfo(org.jwildfire.create.tina.render.RenderInfo) SliceRenderInfo(org.jwildfire.create.tina.render.SliceRenderInfo)

Example 19 with FlameRenderer

use of org.jwildfire.create.tina.render.FlameRenderer in project JWildfire by thargor6.

the class Boarders2Test method testTransformYbigYNeg.

@Test
public void testTransformYbigYNeg() {
    XYZPoint pt = new XYZPoint();
    pt.y = -.4;
    pt.x = .2;
    pt.z = 1;
    XYZPoint pt2 = new XYZPoint();
    pt2.y = -.4;
    pt2.x = .2;
    pt2.z = 1;
    Boarders2Func bf = new Boarders2Func();
    bf.init(null, null, new XForm(), 10);
    Flame f = new Flame();
    f.setHeight(500);
    f.setWidth(500);
    f.setName("test1");
    bf.transform(new FlameTransformationContext(new FlameRenderer(f, Prefs.getPrefs(), true, false), new ZigguratRandomGenerator(), 1), new XForm(), pt, pt2, 10);
}
Also used : XForm(org.jwildfire.create.tina.base.XForm) XYZPoint(org.jwildfire.create.tina.base.XYZPoint) FlameRenderer(org.jwildfire.create.tina.render.FlameRenderer) ZigguratRandomGenerator(org.jwildfire.create.tina.random.ZigguratRandomGenerator) Flame(org.jwildfire.create.tina.base.Flame) Test(org.junit.Test)

Example 20 with FlameRenderer

use of org.jwildfire.create.tina.render.FlameRenderer in project JWildfire by thargor6.

the class Boarders2Test method testTransformXbigXPos.

@Test
public void testTransformXbigXPos() {
    XYZPoint pt = new XYZPoint();
    pt.y = .4;
    pt.x = .5;
    pt.z = 1;
    XYZPoint pt2 = new XYZPoint();
    pt2.y = .4;
    pt2.x = .5;
    pt2.z = 1;
    Boarders2Func bf = new Boarders2Func();
    bf.init(null, null, new XForm(), 10);
    Flame f = new Flame();
    f.setHeight(500);
    f.setWidth(500);
    f.setName("test1");
    bf.transform(new FlameTransformationContext(new FlameRenderer(f, Prefs.getPrefs(), true, false), new ZigguratRandomGenerator(), 1), new XForm(), pt, pt2, 10);
}
Also used : XForm(org.jwildfire.create.tina.base.XForm) XYZPoint(org.jwildfire.create.tina.base.XYZPoint) FlameRenderer(org.jwildfire.create.tina.render.FlameRenderer) ZigguratRandomGenerator(org.jwildfire.create.tina.random.ZigguratRandomGenerator) Flame(org.jwildfire.create.tina.base.Flame) Test(org.junit.Test)

Aggregations

FlameRenderer (org.jwildfire.create.tina.render.FlameRenderer)34 RenderInfo (org.jwildfire.create.tina.render.RenderInfo)28 Flame (org.jwildfire.create.tina.base.Flame)27 RenderedFlame (org.jwildfire.create.tina.render.RenderedFlame)25 SimpleImage (org.jwildfire.image.SimpleImage)12 Rectangle (java.awt.Rectangle)10 FlamePanel (org.jwildfire.create.tina.swing.flamepanel.FlamePanel)9 XYZProjectedPoint (org.jwildfire.create.tina.base.XYZProjectedPoint)5 Test (org.junit.Test)4 XForm (org.jwildfire.create.tina.base.XForm)4 XYZPoint (org.jwildfire.create.tina.base.XYZPoint)4 ZigguratRandomGenerator (org.jwildfire.create.tina.random.ZigguratRandomGenerator)4 AbstractRenderThread (org.jwildfire.create.tina.render.AbstractRenderThread)4 DrawFocusPointFlameRenderer (org.jwildfire.create.tina.render.DrawFocusPointFlameRenderer)4 ImageIcon (javax.swing.ImageIcon)3 FlameReader (org.jwildfire.create.tina.io.FlameReader)3 FlamePanelConfig (org.jwildfire.create.tina.swing.flamepanel.FlamePanelConfig)3 File (java.io.File)2 ResolutionProfile (org.jwildfire.base.ResolutionProfile)2 Layer (org.jwildfire.create.tina.base.Layer)2