use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class IFlamesController method getBaseFlamePreviewPanel.
private FlamePanel getBaseFlamePreviewPanel() {
if (baseFlamePreviewPanel == null) {
int width = baseFlamePreviewRootPnl.getWidth();
int height = baseFlamePreviewRootPnl.getHeight();
SimpleImage img = new SimpleImage(width, height);
img.fillBackground(0, 0, 0);
baseFlamePreviewPanel = new FlamePanel(prefs, img, 0, 0, baseFlamePreviewRootPnl.getWidth(), this, null);
ResolutionProfile resProfile = getResolutionProfile();
baseFlamePreviewPanel.setRenderWidth(resProfile.getWidth());
baseFlamePreviewPanel.setRenderHeight(resProfile.getHeight());
baseFlamePreviewPanel.setFocusable(true);
baseFlamePreviewRootPnl.add(baseFlamePreviewPanel, BorderLayout.CENTER);
baseFlamePreviewRootPnl.getParent().validate();
baseFlamePreviewRootPnl.repaint();
baseFlamePreviewPanel.requestFocusInWindow();
}
return baseFlamePreviewPanel;
}
use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class BatchRendererController method getBatchPreviewFlamePanel.
private FlamePanel getBatchPreviewFlamePanel() {
if (batchPreviewFlamePanel == null) {
int width = data.batchPreviewRootPanel.getWidth();
int height = data.batchPreviewRootPanel.getHeight();
SimpleImage img = new SimpleImage(width, height);
img.fillBackground(0, 0, 0);
batchPreviewFlamePanel = new FlamePanel(prefs, img, 0, 0, data.batchPreviewRootPanel.getWidth(), getBatchRenderPreviewFlameHolder(), null);
ResolutionProfile resProfile = getBatchRenderResolutionProfile();
batchPreviewFlamePanel.setRenderWidth(resProfile.getWidth());
batchPreviewFlamePanel.setRenderHeight(resProfile.getHeight());
batchPreviewFlamePanel.setDrawTriangles(false);
data.batchPreviewRootPanel.add(batchPreviewFlamePanel, BorderLayout.CENTER);
data.batchPreviewRootPanel.getParent().validate();
data.batchPreviewRootPanel.repaint();
}
return batchPreviewFlamePanel;
}
use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class FlamesGPURenderController method renderFlame.
private void renderFlame() {
if (getCurrFlame() == null) {
return;
}
try {
clearScreen();
ResolutionProfile resProfile = getResolutionProfile();
QualityProfile qualityProfile = getQualityProfile();
int width = resProfile.getWidth();
int height = resProfile.getHeight();
if (quarterSizeButton.isSelected()) {
width /= 4;
height /= 4;
} else if (halveSizeButton.isSelected()) {
width /= 2;
height /= 2;
}
setState(State.RENDERING);
GPURenderThread renderThread = new GPURenderThread(width, height, qualityProfile.getQuality());
new Thread(renderThread).start();
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class FlamesGPURenderController method refreshImagePanel.
private void refreshImagePanel() {
if (imageScrollPane != null) {
imageRootPanel.remove(imageScrollPane);
imageScrollPane = null;
}
ResolutionProfile profile = getResolutionProfile();
int width = profile.getWidth();
int height = profile.getHeight();
if (quarterSizeButton.isSelected()) {
width /= 4;
height /= 4;
} else if (halveSizeButton.isSelected()) {
width /= 2;
height /= 2;
}
image = new SimpleImage(width, height);
image.getBufferedImg().setAccelerationPriority(1.0f);
image.fillBackground(prefs.getTinaRandomBatchBGColorRed(), prefs.getTinaRandomBatchBGColorGreen(), prefs.getTinaRandomBatchBGColorBlue());
ImagePanel imagePanel = new ImagePanel(image, 0, 0, image.getImageWidth());
imagePanel.setSize(image.getImageWidth(), image.getImageHeight());
imagePanel.setPreferredSize(new Dimension(image.getImageWidth(), image.getImageHeight()));
imageScrollPane = new JScrollPane(imagePanel);
imageScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
imageScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
imageRootPanel.add(imageScrollPane, BorderLayout.CENTER);
imageRootPanel.getParent().validate();
}
use of org.jwildfire.base.ResolutionProfile in project JWildfire by thargor6.
the class TinaController method editResolutionProfiles.
public void editResolutionProfiles() {
ResolutionProfileDialog dlg = new ResolutionProfileDialog(SwingUtilities.getWindowAncestor(centerPanel));
dlg.setProfiles(prefs.getResolutionProfiles());
dlg.setProfile(getResolutionProfile());
dlg.setModal(true);
dlg.setVisible(true);
if (dlg.isConfirmed() && dlg.isConfigChanged()) {
try {
ResolutionProfile profile = getResolutionProfile();
prefs.getResolutionProfiles().clear();
prefs.getResolutionProfiles().addAll(dlg.getProfiles());
prefs.saveToFile();
refreshResolutionProfileCmb(data.resolutionProfileCmb, profile);
refreshResolutionProfileCmb(data.interactiveResolutionProfileCmb, profile);
refreshResolutionProfileCmb(data.swfAnimatorResolutionProfileCmb, profile);
refreshResolutionProfileCmb(data.batchResolutionProfileCmb, profile);
refreshResolutionProfileCmb(data.gpuResolutionProfileCmb, profile);
resolutionProfileCmb_changed();
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
}
Aggregations