Search in sources :

Example 1 with QualityProfile

use of org.jwildfire.base.QualityProfile 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 2 with QualityProfile

use of org.jwildfire.base.QualityProfile in project JWildfire by thargor6.

the class TinaController method editQualityProfiles.

public void editQualityProfiles() {
    QualityProfileDialog dlg = new QualityProfileDialog(SwingUtilities.getWindowAncestor(centerPanel));
    dlg.setProfiles(prefs.getQualityProfiles());
    dlg.setProfile(getQualityProfile());
    dlg.setModal(true);
    dlg.setVisible(true);
    if (dlg.isConfirmed() && dlg.isConfigChanged()) {
        try {
            QualityProfile profile = getQualityProfile();
            prefs.getQualityProfiles().clear();
            prefs.getQualityProfiles().addAll(dlg.getProfiles());
            prefs.saveToFile();
            refreshQualityProfileCmb(data.qualityProfileCmb, profile);
            refreshQualityProfileCmb(data.batchQualityProfileCmb, profile);
            refreshQualityProfileCmb(data.gpuQualityProfileCmb, profile);
            refreshQualityProfileCmb(data.swfAnimatorQualityProfileCmb, profile);
            qualityProfileCmb_changed();
        } catch (Throwable ex) {
            errorHandler.handleError(ex);
        }
    }
}
Also used : QualityProfile(org.jwildfire.base.QualityProfile)

Example 3 with QualityProfile

use of org.jwildfire.base.QualityProfile in project JWildfire by thargor6.

the class TinaController method qualityProfileCmb_changed.

public void qualityProfileCmb_changed() {
    if (noRefresh) {
        return;
    }
    if (getCurrFlame() == null) {
        return;
    }
    noRefresh = true;
    try {
        QualityProfile profile = getQualityProfile();
        getCurrFlame().setQualityProfile(profile);
    } finally {
        noRefresh = false;
    }
}
Also used : QualityProfile(org.jwildfire.base.QualityProfile)

Example 4 with QualityProfile

use of org.jwildfire.base.QualityProfile in project JWildfire by thargor6.

the class QualityProfileDialog method refreshProfileView.

private void refreshProfileView() {
    QualityProfile profile;
    if (editStatus == EditStatus.NEW) {
        profile = null;
    } else {
        profile = (QualityProfile) getProfileCmb().getSelectedItem();
    }
    if (profile == null) {
        getCaptionREd().setText("");
        getQualityREd().setText("");
        getWithHDRCBx().setSelected(false);
        getWithZBufferCBx().setSelected(false);
        getDefaultCBx().setSelected(false);
    } else {
        getCaptionREd().setText(profile.getCaption());
        getQualityREd().setText(String.valueOf(profile.getQuality()));
        getWithHDRCBx().setSelected(profile.isWithHDR());
        getWithZBufferCBx().setSelected(profile.isWithZBuffer());
        getDefaultCBx().setSelected(profile.isDefaultProfile());
    }
}
Also used : QualityProfile(org.jwildfire.base.QualityProfile)

Example 5 with QualityProfile

use of org.jwildfire.base.QualityProfile in project JWildfire by thargor6.

the class Boarders2Test method visual.

// @Ignore
@Test
public void visual() throws Exception {
    Prefs.getPrefs().setTinaRandomNumberGenerator(RandomGeneratorType.JAVA_INTERNAL);
    System.out.println(Prefs.getPrefs().getTinaRandomNumberGenerator().name());
    int side = 600;
    ResolutionProfile respro = new ResolutionProfile(true, side, side);
    int quality = 80;
    Flame f = new Flame();
    f.setWidth(side);
    f.setHeight(side);
    f.setGamma(4.0);
    f.setBGTransparency(false);
    f.setAntialiasAmount(1.0);
    f.setAntialiasRadius(.1);
    Layer l = new Layer();
    XForm xf = new XForm();
    Boarders2Func bf = new Boarders2Func();
    bf.setParameter("c", .6);
    bf.setParameter("left", .65);
    bf.setParameter("right", .35);
    xf.addVariation(1.0, bf);
    f.setCamZoom(6.461);
    xf.setWeight(5.5);
    l.getXForms().add(xf);
    RGBPalette pal = new RGBPalette();
    for (int i = 0; i < 256; i++) pal.addColor(0, i, 255);
    pal.setFlam3Name("test");
    l.setPalette(pal);
    f.setResolutionProfile(respro);
    f.getLayers().clear();
    f.getLayers().add(l);
    // this is "scale"
    f.setPixelsPerUnit(43.75);
    new FlameWriter().writeFlame(f, "/dev/shm/test.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/test.flame");
    joblist.add(j);
    QualityProfile qualpro = new QualityProfile();
    qualpro.setQuality(quality);
    JobRenderThread job = new JobRenderThread(controller, joblist, respro, qualpro, true);
    job.run();
}
Also used : ResolutionProfile(org.jwildfire.base.ResolutionProfile) XForm(org.jwildfire.create.tina.base.XForm) RGBPalette(org.jwildfire.create.tina.palette.RGBPalette) HeadlessBatchRendererController(org.jwildfire.create.tina.batch.HeadlessBatchRendererController) ArrayList(java.util.ArrayList) Layer(org.jwildfire.create.tina.base.Layer) XYZPoint(org.jwildfire.create.tina.base.XYZPoint) FlameWriter(org.jwildfire.create.tina.io.FlameWriter) JobRenderThread(org.jwildfire.create.tina.batch.JobRenderThread) QualityProfile(org.jwildfire.base.QualityProfile) Job(org.jwildfire.create.tina.batch.Job) JobRenderThreadController(org.jwildfire.create.tina.batch.JobRenderThreadController) Flame(org.jwildfire.create.tina.base.Flame) Test(org.junit.Test)

Aggregations

QualityProfile (org.jwildfire.base.QualityProfile)14 ResolutionProfile (org.jwildfire.base.ResolutionProfile)6 ArrayList (java.util.ArrayList)4 Point (java.awt.Point)3 Flame (org.jwildfire.create.tina.base.Flame)3 File (java.io.File)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 JobRenderThread (org.jwildfire.create.tina.batch.JobRenderThread)2 JobRenderThreadController (org.jwildfire.create.tina.batch.JobRenderThreadController)2 FlameWriter (org.jwildfire.create.tina.io.FlameWriter)2 RGBPalette (org.jwildfire.create.tina.palette.RGBPalette)2 LinkedList (java.util.LinkedList)1 AbstractButton (javax.swing.AbstractButton)1 JFileChooser (javax.swing.JFileChooser)1 JPanel (javax.swing.JPanel)1 Ignore (org.junit.Ignore)1