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());
}
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);
}
}
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;
}
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;
}
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();
}
Aggregations