Search in sources :

Example 1 with ResolutionProfile

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;
}
Also used : ResolutionProfile(org.jwildfire.base.ResolutionProfile) SimpleImage(org.jwildfire.image.SimpleImage) FlamePanel(org.jwildfire.create.tina.swing.flamepanel.FlamePanel)

Example 2 with ResolutionProfile

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;
}
Also used : ResolutionProfile(org.jwildfire.base.ResolutionProfile) SimpleImage(org.jwildfire.image.SimpleImage) FlamePanel(org.jwildfire.create.tina.swing.flamepanel.FlamePanel)

Example 3 with ResolutionProfile

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);
    }
}
Also used : ResolutionProfile(org.jwildfire.base.ResolutionProfile) QualityProfile(org.jwildfire.base.QualityProfile)

Example 4 with ResolutionProfile

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();
}
Also used : ResolutionProfile(org.jwildfire.base.ResolutionProfile) JScrollPane(javax.swing.JScrollPane) SimpleImage(org.jwildfire.image.SimpleImage) Dimension(java.awt.Dimension) ImagePanel(org.jwildfire.swing.ImagePanel)

Example 5 with ResolutionProfile

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);
        }
    }
}
Also used : ResolutionProfile(org.jwildfire.base.ResolutionProfile)

Aggregations

ResolutionProfile (org.jwildfire.base.ResolutionProfile)29 SimpleImage (org.jwildfire.image.SimpleImage)8 Flame (org.jwildfire.create.tina.base.Flame)7 QualityProfile (org.jwildfire.base.QualityProfile)6 ArrayList (java.util.ArrayList)5 RenderedFlame (org.jwildfire.create.tina.render.RenderedFlame)5 FlamePanel (org.jwildfire.create.tina.swing.flamepanel.FlamePanel)5 Dimension (java.awt.Dimension)3 Point (java.awt.Point)3 File (java.io.File)3 XYZProjectedPoint (org.jwildfire.create.tina.base.XYZProjectedPoint)3 ImagePanel (org.jwildfire.swing.ImagePanel)3 JFileChooser (javax.swing.JFileChooser)2 JPanel (javax.swing.JPanel)2 JScrollPane (javax.swing.JScrollPane)2 Test (org.junit.Test)2 Layer (org.jwildfire.create.tina.base.Layer)2 XForm (org.jwildfire.create.tina.base.XForm)2 HeadlessBatchRendererController (org.jwildfire.create.tina.batch.HeadlessBatchRendererController)2 Job (org.jwildfire.create.tina.batch.Job)2