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();
}
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();
}
}
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);
}
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);
}
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);
}
Aggregations