use of org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator 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.AllRandomFlameGenerator 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.AllRandomFlameGenerator 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();
}
use of org.jwildfire.create.tina.randomflame.AllRandomFlameGenerator in project JWildfire by thargor6.
the class JWildfire method getMainDesktopPane.
private JDesktopPane getMainDesktopPane() {
if (mainDesktopPane == null) {
mainDesktopPane = createMainDesktopPane();
for (InternalFrameHolder<?> internalFrame : mainInternalFrames) {
mainDesktopPane.add(internalFrame.getInternalFrame());
}
getInternalFrame(NavigatorInternalFrame.class).setDesktop(this);
TinaInternalFrame tinaInternalFrame = getInternalFrame(TinaInternalFrame.class);
tinaInternalFrame.addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentResized(java.awt.event.ComponentEvent e) {
tinaController.refreshFlameImage(true, false, 1, true, false);
}
});
if (!tinaInternalFrame.isVisible()) {
tinaInternalFrame.setVisible(true);
}
for (InternalFrameHolder<?> internalFrame : settingsInternalFrames) {
mainDesktopPane.add(internalFrame.getInternalFrame());
}
for (InternalFrameHolder<?> internalFrame : helpInternalFrames) {
mainDesktopPane.add(internalFrame.getInternalFrame());
}
errorHandler = new StandardErrorHandler(mainDesktopPane, getShowErrorDlg(), getShowErrorDlgMessageTextArea(), getShowErrorDlgStacktraceTextArea());
NavigatorInternalFrame navigatorInternalFrame = getInternalFrame(NavigatorInternalFrame.class);
if (!navigatorInternalFrame.isVisible()) {
navigatorInternalFrame.setVisible(true);
}
navigatorInternalFrame.moveToFront();
/*
WelcomeInternalFrame welcomeInternalFrame = getInternalFrame(WelcomeInternalFrame.class);
if (!welcomeInternalFrame.isVisible()) {
welcomeInternalFrame.setVisible(true);
}
welcomeInternalFrame.moveToFront();
*/
TipOfTheDayInternalFrame tipOfTheDayInternalFrame = getInternalFrame(TipOfTheDayInternalFrame.class);
if (!tipOfTheDayInternalFrame.isVisible() && Prefs.getPrefs().isShowTipsAtStartup()) {
tipOfTheDayInternalFrame.setVisible(true);
}
tipOfTheDayInternalFrame.moveToFront();
try {
getInternalFrame(ListOfChangesInternalFrame.class).initChangesPane();
} catch (Exception ex) {
ex.printStackTrace();
}
try {
getInternalFrame(GPURenderInfoInternalFrame.class).initChangesPane();
} catch (Exception ex) {
ex.printStackTrace();
}
MutaGenInternalFrame mutaGenFrame = getInternalFrame(MutaGenInternalFrame.class);
FlameBrowserInternalFrame flameBrowserFrame = getInternalFrame(FlameBrowserInternalFrame.class);
EasyMovieMakerInternalFrame easyMovieMakerFrame = getInternalFrame(EasyMovieMakerInternalFrame.class);
DancingFlamesInternalFrame dancingFlamesFrame = getInternalFrame(DancingFlamesInternalFrame.class);
BatchFlameRendererInternalFrame batchFlameRendererFrame = getInternalFrame(BatchFlameRendererInternalFrame.class);
MeshGenInternalFrame meshGenFrame = getInternalFrame(MeshGenInternalFrame.class);
InteractiveRendererInternalFrame interactiveRendererFrame = getInternalFrame(InteractiveRendererInternalFrame.class);
VariationsSettingsInternalFrame variationsSettingsFrame = getInternalFrame(VariationsSettingsInternalFrame.class);
// create some unregistered window even when FACLRender is not available, in order to avoid further null-checks etc.
FlamesGPURenderInternalFrame gpuRendererFrame = FACLRenderTools.isFaclRenderAvalailable() ? getInternalFrame(FlamesGPURenderInternalFrame.class) : new FlamesGPURenderInternalFrame();
HelpInternalFrame helpFrame = getInternalFrame(HelpInternalFrame.class);
TinaInternalFrame tinaFrame = getInternalFrame(TinaInternalFrame.class);
tinaController = tinaFrame.createController(this, errorHandler, prefs, mutaGenFrame, flameBrowserFrame, easyMovieMakerFrame, dancingFlamesFrame, batchFlameRendererFrame, meshGenFrame, interactiveRendererFrame, gpuRendererFrame, helpFrame);
try {
RandomFlameGenerator randGen = RandomFlameGeneratorList.getRandomFlameGeneratorInstance(RandomFlameGeneratorList.DEFAULT_GENERATOR_NAME, true);
if (randGen instanceof AllRandomFlameGenerator) {
((AllRandomFlameGenerator) randGen).setUseSimpleGenerators(true);
}
RandomSymmetryGenerator randSymmGen = RandomSymmetryGeneratorList.getRandomSymmetryGeneratorInstance(RandomSymmetryGeneratorList.DEFAULT_GENERATOR_NAME, true);
RandomGradientGenerator randGradientGen = RandomGradientGeneratorList.getRandomGradientGeneratorInstance((RandomGradientGeneratorList.DEFAULT_GENERATOR_NAME), true);
tinaController.createRandomBatch(2, randGen, randSymmGen, randGradientGen, RandomBatchQuality.LOW);
} catch (Exception ex) {
ex.printStackTrace();
}
flameBrowserFrame.setTinaController(tinaController);
mutaGenFrame.setTinaController(tinaController);
easyMovieMakerFrame.setTinaController(tinaController);
dancingFlamesFrame.setTinaController(tinaController);
batchFlameRendererFrame.setTinaController(tinaController);
variationsSettingsFrame.setTinaController(tinaController);
meshGenFrame.setTinaController(tinaController);
interactiveRendererFrame.setTinaController(tinaController);
gpuRendererFrame.setTinaController(tinaController);
helpFrame.setTinaController(tinaController);
FormulaExplorerInternalFrame formulaExplorerFrame = getInternalFrame(FormulaExplorerInternalFrame.class);
formulaExplorerController = new FormulaExplorerController((FormulaPanel) formulaExplorerFrame.getFormulaPanel(), formulaExplorerFrame.getFormulaExplorerFormula1REd(), formulaExplorerFrame.getFormulaExplorerFormula2REd(), formulaExplorerFrame.getFormulaExplorerFormula3REd(), formulaExplorerFrame.getFormulaExplorerFormulaXMinREd(), formulaExplorerFrame.getFormulaExplorerFormulaXMaxREd(), formulaExplorerFrame.getFormulaExplorerFormulaXCountREd(), formulaExplorerFrame.getFormulaExplorerValuesTextArea());
OperatorsInternalFrame operatorsFrame = getInternalFrame(OperatorsInternalFrame.class);
operatorsFrame.setDesktop(this);
PreferencesInternalFrame preferencesFrame = getInternalFrame(PreferencesInternalFrame.class);
preferencesFrame.setDesktop(this);
preferencesFrame.setPrefs(prefs);
preferencesFrame.setMainController(mainController);
mainController = new MainController(prefs, errorHandler, mainDesktopPane, getWindowMenu(), operatorsFrame.getTransformerInputCmb(), operatorsFrame.getTransformerPresetCmb(), operatorsFrame.getCreatorPresetCmb(), getShowMessageDlg(), getShowMessageDlgTextArea(), null, null, null, null, null, null, null, mainInternalFrames.size());
/*
EDENInternalFrame edenFrame = (EDENInternalFrame) getEDENInternalFrame();
edenFrame.createController(mainController, errorHandler, prefs).newEmptyScene();
*/
IFlamesInternalFrame iflamesInternalFrame = getInternalFrame(IFlamesInternalFrame.class);
iflamesInternalFrame.createController(mainController, tinaController, errorHandler);
tinaController.setMainController(mainController);
operatorsFrame.setMainController(mainController);
formulaExplorerFrame.setMainController(mainController);
formulaExplorerFrame.setFormulaExplorerController(formulaExplorerController);
}
try {
getInternalFrame(WelcomeInternalFrame.class).setSelected(true);
} catch (PropertyVetoException ex) {
ex.printStackTrace();
}
return mainDesktopPane;
}
Aggregations