Search in sources :

Example 1 with RandomFlameGenerator

use of org.jwildfire.create.tina.randomflame.RandomFlameGenerator in project JWildfire by thargor6.

the class RandomFlameMutation method execute.

@Override
public void execute(Layer pLayer) {
    RandomFlameGenerator randGen = new AllRandomFlameGenerator();
    int palettePoints = 3 + Tools.randomInt(68);
    boolean fadePaletteColors = Math.random() > 0.33;
    boolean uniformWidth = Math.random() > 0.75;
    int IMG_WIDTH = 80;
    int IMG_HEIGHT = 60;
    RandomFlameGeneratorSampler sampler = new RandomFlameGeneratorSampler(IMG_WIDTH, IMG_HEIGHT, Prefs.getPrefs(), randGen, RandomSymmetryGeneratorList.SPARSE, RandomGradientGeneratorList.DEFAULT, palettePoints, fadePaletteColors, uniformWidth, RandomBatchQuality.NORMAL);
    RandomFlameGeneratorSample sample = sampler.createSample();
    pLayer.assign(sample.getFlame().getFirstLayer());
}
Also used : AllRandomFlameGenerator(org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator) RandomFlameGeneratorSample(org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSample) RandomFlameGeneratorSampler(org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler) AllRandomFlameGenerator(org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator) RandomFlameGenerator(org.jwildfire.create.tina.randomflame.RandomFlameGenerator)

Example 2 with RandomFlameGenerator

use of org.jwildfire.create.tina.randomflame.RandomFlameGenerator in project JWildfire by thargor6.

the class DancingFractalsController method genRandomFlames.

public void genRandomFlames() {
    try {
        final int IMG_WIDTH = 80;
        final int IMG_HEIGHT = 60;
        int count = (int) ((Double) randomCountIEd.getValue() + 0.5);
        for (int i = 0; i < count; i++) {
            RandomFlameGenerator randGen = RandomFlameGeneratorList.getRandomFlameGeneratorInstance((String) randomGenCmb.getSelectedItem(), true);
            int palettePoints = 3 + Tools.randomInt(68);
            boolean fadePaletteColors = Math.random() > 0.33;
            boolean uniformSize = Math.random() > 0.75;
            RandomFlameGeneratorSampler sampler = new RandomFlameGeneratorSampler(IMG_WIDTH, IMG_HEIGHT, prefs, randGen, RandomSymmetryGeneratorList.NONE, RandomGradientGeneratorList.DEFAULT, palettePoints, fadePaletteColors, uniformSize, RandomBatchQuality.NORMAL);
            project.getFlames().add(validateDancingFlame(sampler.createSample().getFlame()));
        }
        refreshProjectFlames();
        enableControls();
    } catch (Throwable ex) {
        errorHandler.handleError(ex);
    }
}
Also used : RandomFlameGeneratorSampler(org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler) RandomFlameGenerator(org.jwildfire.create.tina.randomflame.RandomFlameGenerator)

Example 3 with RandomFlameGenerator

use of org.jwildfire.create.tina.randomflame.RandomFlameGenerator in project JWildfire by thargor6.

the class TinaController method getCurrFlame.

@Override
public Flame getCurrFlame(boolean autoGenerateIfEmpty) {
    if (_currFlame == null) {
        final int IMG_WIDTH = 80;
        final int IMG_HEIGHT = 60;
        RandomFlameGenerator randGen = new AllRandomFlameGenerator();
        int palettePoints = 3 + Tools.randomInt(21);
        boolean fadePaletteColors = Math.random() > 0.09;
        boolean uniformWidth = Math.random() > 0.75;
        RandomFlameGeneratorSampler sampler = new RandomFlameGeneratorSampler(IMG_WIDTH, IMG_HEIGHT, prefs, randGen, RandomSymmetryGeneratorList.SPARSE, RandomGradientGeneratorList.DEFAULT, palettePoints, fadePaletteColors, uniformWidth, RandomBatchQuality.LOW);
        Flame flame = sampler.createSample().getFlame();
        setCurrFlame(flame);
    }
    return _currFlame;
}
Also used : AllRandomFlameGenerator(org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator) RandomFlameGeneratorSampler(org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler) AllRandomFlameGenerator(org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator) RandomFlameGenerator(org.jwildfire.create.tina.randomflame.RandomFlameGenerator) WikimediaCommonsRandomFlameGenerator(org.jwildfire.create.tina.randomflame.WikimediaCommonsRandomFlameGenerator) Flame(org.jwildfire.create.tina.base.Flame) RenderedFlame(org.jwildfire.create.tina.render.RenderedFlame)

Example 4 with RandomFlameGenerator

use of org.jwildfire.create.tina.randomflame.RandomFlameGenerator in project JWildfire by thargor6.

the class TinaInternalFrame method getRandomBatchButton.

/**
 * This method initializes randomBatchButton
 *
 * @return javax.swing.JButton
 */
private JButton getRandomBatchButton() {
    if (randomBatchButton == null) {
        randomBatchButton = new JButton();
        randomBatchButton.setToolTipText("Create a batch of random flames");
        randomBatchButton.setMaximumSize(new Dimension(32000, 46));
        randomBatchButton.setMinimumSize(new Dimension(100, 46));
        randomBatchButton.setFont(Prefs.getPrefs().getFont("Dialog", Font.BOLD, 10));
        randomBatchButton.setText("Random batch");
        randomBatchButton.setPreferredSize(new Dimension(115, 46));
        randomBatchButton.setIcon(new ImageIcon(TinaInternalFrame.class.getResource("/org/jwildfire/swing/icons/new/roll.png")));
        randomBatchButton.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent e) {
                RandomFlameGenerator randGen = RandomFlameGeneratorList.getRandomFlameGeneratorInstance((String) randomStyleCmb.getSelectedItem(), true);
                RandomSymmetryGenerator randSymmGen = RandomSymmetryGeneratorList.getRandomSymmetryGeneratorInstance((String) randomSymmetryCmb.getSelectedItem(), true);
                RandomGradientGenerator randGradientGen = RandomGradientGeneratorList.getRandomGradientGeneratorInstance((String) randomGradientCmb.getSelectedItem(), true);
                if (tinaController.createRandomBatch(-1, randGen, randSymmGen, randGradientGen, RandomBatchQuality.NORMAL)) {
                    tinaController.importFromRandomBatch(0);
                }
            }
        });
    }
    return randomBatchButton;
}
Also used : ImageIcon(javax.swing.ImageIcon) RandomGradientGenerator(org.jwildfire.create.tina.randomgradient.RandomGradientGenerator) ActionListener(java.awt.event.ActionListener) JButton(javax.swing.JButton) Dimension(java.awt.Dimension) RandomSymmetryGenerator(org.jwildfire.create.tina.randomsymmetry.RandomSymmetryGenerator) ActionEvent(java.awt.event.ActionEvent) RandomFlameGenerator(org.jwildfire.create.tina.randomflame.RandomFlameGenerator)

Example 5 with RandomFlameGenerator

use of org.jwildfire.create.tina.randomflame.RandomFlameGenerator in project JWildfire by thargor6.

the class JWildfireApplet method genRandomFlame.

public void genRandomFlame(RandomBatchQuality pQuality) {
    final int IMG_WIDTH = 80;
    final int IMG_HEIGHT = 60;
    RandomFlameGenerator randGen = new AllRandomFlameGenerator();
    int palettePoints = 3 + Tools.randomInt(21);
    boolean fadePaletteColors = Math.random() > 0.09;
    boolean uniformSize = Math.random() > 0.75;
    RandomFlameGeneratorSampler sampler = new RandomFlameGeneratorSampler(IMG_WIDTH, IMG_HEIGHT, prefs, randGen, RandomSymmetryGeneratorList.SPARSE, RandomGradientGeneratorList.DEFAULT, palettePoints, fadePaletteColors, uniformSize, pQuality);
    currFlame = sampler.createSample().getFlame();
}
Also used : AllRandomFlameGenerator(org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator) RandomFlameGeneratorSampler(org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler) XYZProjectedPoint(org.jwildfire.create.tina.base.XYZProjectedPoint) AllRandomFlameGenerator(org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator) RandomFlameGenerator(org.jwildfire.create.tina.randomflame.RandomFlameGenerator)

Aggregations

RandomFlameGenerator (org.jwildfire.create.tina.randomflame.RandomFlameGenerator)7 RandomFlameGeneratorSampler (org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler)5 AllRandomFlameGenerator (org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator)4 XYZProjectedPoint (org.jwildfire.create.tina.base.XYZProjectedPoint)2 RandomGradientGenerator (org.jwildfire.create.tina.randomgradient.RandomGradientGenerator)2 RandomSymmetryGenerator (org.jwildfire.create.tina.randomsymmetry.RandomSymmetryGenerator)2 Dimension (java.awt.Dimension)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 PropertyVetoException (java.beans.PropertyVetoException)1 ImageIcon (javax.swing.ImageIcon)1 JButton (javax.swing.JButton)1 IFlamesInternalFrame (org.jwildfire.create.iflames.swing.IFlamesInternalFrame)1 Flame (org.jwildfire.create.tina.base.Flame)1 RandomFlameGeneratorSample (org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSample)1 WikimediaCommonsRandomFlameGenerator (org.jwildfire.create.tina.randomflame.WikimediaCommonsRandomFlameGenerator)1 RenderedFlame (org.jwildfire.create.tina.render.RenderedFlame)1 BatchFlameRendererInternalFrame (org.jwildfire.create.tina.swing.BatchFlameRendererInternalFrame)1 DancingFlamesInternalFrame (org.jwildfire.create.tina.swing.DancingFlamesInternalFrame)1 EasyMovieMakerInternalFrame (org.jwildfire.create.tina.swing.EasyMovieMakerInternalFrame)1