use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class PolylogarithmTest method visual.
@Test
@Ignore
public void visual() throws Exception {
int side = 400;
ResolutionProfile respro = new ResolutionProfile(true, side, side);
int quality = 200;
Flame f = new Flame();
f.setWidth(side);
f.setHeight(side);
f.setGamma(4.0);
f.setBGTransparency(false);
f.setAntialiasAmount(.1);
f.setAntialiasRadius(.1);
Layer l = new Layer();
XForm xf = new XForm();
SquishFunc df = new SquishFunc();
df.setParameter("power", 10);
xf.addVariation(1, df);
PolylogarithmFunc bf = new PolylogarithmFunc();
bf.setParameter("n", 2);
bf.setParameter("zpow", 1);
xf.addVariation(.1, bf);
f.setCamZoom(6);
xf.setWeight(10);
l.getXForms().add(xf);
RGBPalette pal = new RGBPalette();
for (int i = 0; i < 256; i++) pal.addColor(0, i, 255);
pal.setFlam3Name("PolylogarithmFunc");
l.setPalette(pal);
f.setResolutionProfile(respro);
f.getLayers().clear();
f.getLayers().add(l);
f.setPixelsPerUnit(43.75);
new FlameWriter().writeFlame(f, "/dev/shm/PolylogarithmFunc.flame");
JobRenderThreadController controller = new HeadlessBatchRendererController();
List<Job> joblist = new ArrayList<>();
Job j = new Job();
j.setCustomHeight(side);
j.setCustomWidth(side);
j.setCustomQuality(quality);
j.setFlameFilename("/dev/shm/PolylogarithmFunc.flame");
joblist.add(j);
QualityProfile qualpro = new QualityProfile();
qualpro.setQuality(quality);
JobRenderThread job = new JobRenderThread(controller, joblist, respro, qualpro, true);
job.run();
}
use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class IFlamesController method getFlamePanel.
@Override
public FlamePanel getFlamePanel() {
if (flamePanel == null) {
Prefs prefs = Prefs.getPrefs();
int width = centerPanel.getWidth();
int height = centerPanel.getHeight();
SimpleImage img = new SimpleImage(width, height);
img.fillBackground(0, 0, 0);
flamePanel = new FlamePanel(prefs, img, 0, 0, centerPanel.getWidth(), this, null);
flamePanel.getConfig().setWithColoredTransforms(prefs.isTinaEditorControlsWithColor());
flamePanel.setFlamePanelTriangleMode(prefs.getTinaEditorControlsStyle());
flamePanel.getConfig().setProgressivePreview(prefs.isTinaEditorProgressivePreview());
flamePanel.importOptions(prevFlamePanel);
prevFlamePanel = null;
ResolutionProfile resProfile = getResolutionProfile();
flamePanel.setRenderWidth(resProfile.getWidth());
flamePanel.setRenderHeight(resProfile.getHeight());
flamePanel.setFocusable(true);
if (firstFlamePanel) {
centerPanel.remove(0);
firstFlamePanel = false;
}
centerPanel.add(flamePanel, BorderLayout.CENTER);
centerPanel.getParent().validate();
centerPanel.repaint();
flamePanel.requestFocusInWindow();
}
return flamePanel;
}
use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class IFlamesController method resolutionProfileCmb_changed.
public void resolutionProfileCmb_changed() {
if (noRefresh || getFlame() == null) {
return;
}
noRefresh = true;
try {
ResolutionProfile profile = getResolutionProfile();
getFlame().setResolutionProfile(profile);
removeFlamePanel();
refreshPreview();
resolutionProfileCmb.requestFocus();
} finally {
noRefresh = false;
}
}
use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class IFlamesController method refreshResolutionProfileCmb.
@SuppressWarnings("unchecked")
private void refreshResolutionProfileCmb(@SuppressWarnings("rawtypes") JComboBox pCmb, ResolutionProfile pSelectedProfile) {
boolean oldNoRefresh = noRefresh;
noRefresh = true;
try {
ResolutionProfile selected = pSelectedProfile;
ResolutionProfile defaultProfile = null;
pCmb.removeAllItems();
for (ResolutionProfile profile : prefs.getResolutionProfiles()) {
if (selected == null && profile.isDefaultProfile()) {
selected = profile;
}
if (defaultProfile == null && profile.isDefaultProfile()) {
defaultProfile = profile;
}
pCmb.addItem(profile);
}
if (selected != null) {
pCmb.setSelectedItem(selected);
}
if (pCmb.getSelectedIndex() < 0 && defaultProfile != null) {
pCmb.setSelectedItem(defaultProfile);
}
if (pCmb.getSelectedIndex() < 0 && prefs.getResolutionProfiles().size() > 0) {
pCmb.setSelectedIndex(0);
}
} finally {
noRefresh = oldNoRefresh;
}
}
use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class TinaSWFAnimatorController method refreshControls.
protected void refreshControls() {
noRefresh = true;
try {
swfAnimatorFramesPerSecondREd.setValue(currMovie.getFramesPerSecond());
for (int i = 0; i < globalScripts.size(); i++) {
ScriptContainer container = globalScripts.get(i);
setGlobalScriptToUI(currMovie.getGlobalScripts()[i], container.getScriptCmb(), container.getScriptREd());
}
for (int i = 0; i < xFormScripts.size(); i++) {
ScriptContainer container = xFormScripts.get(i);
setXFormScriptToUI(currMovie.getxFormScripts()[i], container.getScriptCmb(), container.getScriptREd());
}
{
ResolutionProfile fittingProfile = null;
ResolutionProfile doubleProfile = null;
for (int i = 0; i < swfAnimatorResolutionProfileCmb.getItemCount(); i++) {
ResolutionProfile profile = (ResolutionProfile) swfAnimatorResolutionProfileCmb.getItemAt(i);
if (profile.getWidth() == currMovie.getFrameWidth() && profile.getHeight() == currMovie.getFrameHeight()) {
fittingProfile = profile;
break;
} else if ((profile.getWidth() / 2) == currMovie.getFrameWidth() && (profile.getHeight() / 2) == currMovie.getFrameHeight()) {
doubleProfile = profile;
}
}
if (fittingProfile != null) {
swfAnimatorResolutionProfileCmb.setSelectedItem(fittingProfile);
} else if (doubleProfile != null) {
swfAnimatorResolutionProfileCmb.setSelectedItem(doubleProfile);
}
}
{
QualityProfile qualityProfile = null;
for (int i = 0; i < swfAnimatorQualityProfileCmb.getItemCount(); i++) {
QualityProfile profile = (QualityProfile) swfAnimatorQualityProfileCmb.getItemAt(i);
if (qualityProfile == null) {
qualityProfile = profile;
} else if (profile.getQuality() == currMovie.getQuality()) {
qualityProfile = profile;
break;
}
}
if (qualityProfile != null) {
swfAnimatorQualityProfileCmb.setSelectedItem(qualityProfile);
}
}
swfAnimatorOutputTypeCmb.setSelectedItem(currMovie.getSequenceOutputType());
for (JPanel panel : flamePartPanelList) {
swfAnimatorFlamesPanel.remove(panel);
}
flamePartPanelList.clear();
for (AbstractButton btn : flamePartRadioButtonList) {
swfAnimatorFlamesButtonGroup.remove(btn);
}
flamePartRadioButtonList.clear();
swfAnimatorFlamesPanel.getParent().validate();
swfAnimatorFrameSlider.setValue(1);
swfAnimatorFrameSlider.setMaximum(currMovie.getFrameCount());
int frameCount = currMovie.getFrameCount();
swfAnimatorFramesREd.setValue(frameCount);
swfAnimatorFrameREd.setValue(1);
swfAnimatorFrameREd.setMaxValue(frameCount);
swfAnimatorMotionBlurLengthREd.setValue(currMovie.getMotionBlurLength());
swfAnimatorMotionBlurTimeStepREd.setValue(currMovie.getMotionBlurTimeStep());
for (FlameMoviePart part : currMovie.getParts()) {
addFlameToFlamePanel(part);
}
enableControls();
} finally {
noRefresh = false;
}
}
Aggregations