Search in sources :

Example 1 with RandomFlameGeneratorSampler

use of org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler 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 RandomFlameGeneratorSampler

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

the class RandomMovieGenerator method genRandomFlame.

protected Flame genRandomFlame(RandomFlameGenerator pRandGen, Prefs pPrefs) {
    final int IMG_WIDTH = 80;
    final int IMG_HEIGHT = 60;
    int palettePoints = 3 + Tools.randomInt(68);
    boolean fadePaletteColors = Math.random() > 0.33;
    boolean uniformWidth = Math.random() > 0.75;
    RandomFlameGeneratorSampler sampler = new RandomFlameGeneratorSampler(IMG_WIDTH, IMG_HEIGHT, pPrefs, pRandGen, RandomSymmetryGeneratorList.NONE, RandomGradientGeneratorList.DEFAULT, palettePoints, fadePaletteColors, uniformWidth, RandomBatchQuality.NORMAL);
    return sampler.createSample().getFlame();
}
Also used : RandomFlameGeneratorSampler(org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler)

Example 3 with RandomFlameGeneratorSampler

use of org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler 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 4 with RandomFlameGeneratorSampler

use of org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler 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 5 with RandomFlameGeneratorSampler

use of org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler 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

RandomFlameGeneratorSampler (org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSampler)7 RandomFlameGenerator (org.jwildfire.create.tina.randomflame.RandomFlameGenerator)5 AllRandomFlameGenerator (org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator)3 XYZProjectedPoint (org.jwildfire.create.tina.base.XYZProjectedPoint)2 RandomFlameGeneratorSample (org.jwildfire.create.tina.randomflame.RandomFlameGeneratorSample)2 ArrayList (java.util.ArrayList)1 Flame (org.jwildfire.create.tina.base.Flame)1 WikimediaCommonsRandomFlameGenerator (org.jwildfire.create.tina.randomflame.WikimediaCommonsRandomFlameGenerator)1 RenderedFlame (org.jwildfire.create.tina.render.RenderedFlame)1 SimpleImage (org.jwildfire.image.SimpleImage)1