commit
efe8f6eb52
|
|
@ -1,3 +1,4 @@
|
|||
<<<<<<< HEAD
|
||||
*.class
|
||||
.classpath
|
||||
.project
|
||||
|
|
@ -20,29 +21,179 @@ hs_err_pid*
|
|||
# OSX
|
||||
# =========================
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
=======
|
||||
#################
|
||||
## Eclipse
|
||||
#################
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
*.pydevproject
|
||||
.project
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.classpath
|
||||
.settings/
|
||||
.loadpath
|
||||
*.var
|
||||
*.png
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Files that might appear on external disk
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
# CDT-specific
|
||||
.cproject
|
||||
|
||||
# Windows
|
||||
# =========================
|
||||
# PDT-specific
|
||||
.buildpath
|
||||
|
||||
|
||||
#################
|
||||
## Visual Studio
|
||||
#################
|
||||
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.sln.docstates
|
||||
|
||||
# Build results
|
||||
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
x64/
|
||||
build/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.log
|
||||
*.scc
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
*.ncrunch*
|
||||
.*crunch*.local.xml
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.Publish.xml
|
||||
*.pubxml
|
||||
|
||||
# NuGet Packages Directory
|
||||
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
|
||||
#packages/
|
||||
|
||||
# Windows Azure Build Output
|
||||
csx
|
||||
*.build.csdef
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
|
||||
# Others
|
||||
sql/
|
||||
*.Cache
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.[Pp]ublish.xml
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file to a newer
|
||||
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
App_Data/*.mdf
|
||||
App_Data/*.ldf
|
||||
|
||||
#############
|
||||
## Windows detritus
|
||||
#############
|
||||
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
|
|
@ -54,8 +205,38 @@ Desktop.ini
|
|||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
# Mac crap
|
||||
>>>>>>> origin/master
|
||||
.DS_Store
|
||||
|
||||
|
||||
#############
|
||||
## Python
|
||||
#############
|
||||
|
||||
*.py[co]
|
||||
|
||||
# Packages
|
||||
*.egg
|
||||
*.egg-info
|
||||
dist/
|
||||
build/
|
||||
eggs/
|
||||
parts/
|
||||
var/
|
||||
sdist/
|
||||
develop-eggs/
|
||||
.installed.cfg
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
.coverage
|
||||
.tox
|
||||
|
||||
#Translations
|
||||
*.mo
|
||||
|
||||
#Mr Developer
|
||||
.mr.developer.cfg
|
||||
|
|
|
|||
105
src/Main.java
105
src/Main.java
|
|
@ -11,21 +11,27 @@ import javax.imageio.ImageIO;
|
|||
|
||||
public class Main {
|
||||
private static Variable nameVar = new Variable("", "name", "0", false);
|
||||
private static int stars = 100;
|
||||
private static int stars = 10;
|
||||
private static BufferedImage buffer;
|
||||
private static Graphics2D graphics;
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
while (true) {
|
||||
//while (true) {
|
||||
String name = "" + Integer.parseInt(nameVar.getValue());
|
||||
nameVar.setValue("" + (Integer.parseInt(nameVar.getValue()) + 1));
|
||||
//nameVar.setValue("" + (Integer.parseInt(nameVar.getValue()) + 1));
|
||||
|
||||
Random rand = new Random();
|
||||
BufferedImage image = new BufferedImage(1024, 600, 3);
|
||||
Graphics2D graphics = (Graphics2D) image.getGraphics();
|
||||
buffer = new BufferedImage(1024, 600, 3);
|
||||
graphics = (Graphics2D) buffer.getGraphics();
|
||||
|
||||
final int WIDTH = 1024;
|
||||
final int HEIGHT = 600;
|
||||
|
||||
for (int y = 0; y < 600; y++)
|
||||
for (int x = 0; x < 1024; x++) {
|
||||
final int MIN_STAR_SIZE = 20, MAX_STAR_SIZE = 50;
|
||||
|
||||
for (int y = 0; y < HEIGHT; y++) {
|
||||
for (int x = 0; x < WIDTH; x++) {
|
||||
|
||||
int k = rand.nextInt(10);
|
||||
int r = 0 + k;
|
||||
|
|
@ -33,67 +39,59 @@ public class Main {
|
|||
int b = 0 + k;
|
||||
graphics.setColor(new Color(r, g, b));
|
||||
graphics.fillRect(x, y, 1, 1);
|
||||
}
|
||||
|
||||
// int stars = 1;
|
||||
for (int i = 0; i < stars; i++) {
|
||||
int size = (int) Math.pow(2, rand.nextInt(4) + 3) + 1;
|
||||
double x = rand.nextInt(1024 - size);
|
||||
double y = rand.nextInt(600 - size);
|
||||
int r = (rand.nextInt(4) * 10) + 10;
|
||||
int g = (rand.nextInt(4) * 10) + 10;
|
||||
int b = (rand.nextInt(4) * 10) + 10;
|
||||
graphics.drawImage(getScaledImage(getStar(r, g, b), size, size), (int) x, (int) y, null);
|
||||
if (size == 65 && rand.nextBoolean() && rand.nextBoolean() && rand.nextBoolean()) {
|
||||
|
||||
x += 32;
|
||||
y += 32;
|
||||
|
||||
double angle = rand.nextDouble() * 360;
|
||||
double modifier = 5 + (rand.nextDouble() * 16);
|
||||
|
||||
// UIFM UNIDENTIFIABLE FLYING MATH
|
||||
|
||||
x += Math.sin(angle) * modifier;
|
||||
y += Math.cos(angle) * modifier;
|
||||
|
||||
size = (int) Math.pow(2, rand.nextInt(2) + 3) + 1;
|
||||
|
||||
x -= (size - 1) / 2;
|
||||
y -= (size - 1) / 2;
|
||||
|
||||
r = (rand.nextInt(6) * 10) + 20;
|
||||
g = (rand.nextInt(6) * 10) + 20;
|
||||
b = (rand.nextInt(6) * 10) + 20;
|
||||
graphics.drawImage(getScaledImage(getStar(r, g, b), size, size), (int) x, (int) y, null);
|
||||
}
|
||||
}
|
||||
System.out.println("Saving...");
|
||||
|
||||
ImageIO.write(image, "png", new File(name + ".png"));
|
||||
for(int i = 0; i < stars; i ++) {
|
||||
|
||||
int size = MIN_STAR_SIZE + (int)(Math.random() * (MAX_STAR_SIZE - MIN_STAR_SIZE));
|
||||
|
||||
int r = (int)(Math.random() * 50);
|
||||
int g = (int)(Math.random() * 50);
|
||||
int b = (int)(Math.random() * 50);
|
||||
|
||||
int x = (int)(Math.random() * WIDTH - (size * 2 + 1));
|
||||
int y = (int)(Math.random() * HEIGHT - (size * 2 + 1));
|
||||
|
||||
graphics.drawImage(getStar(r, g, b, size), x, y, null);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
ImageIO.write(buffer, "png", new File(name + ".png"));
|
||||
|
||||
System.out.println("Saved!");
|
||||
}
|
||||
//}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static BufferedImage getStar(int r, int g, int b) {
|
||||
/**
|
||||
* size, given such that the output dimensions = 2 * size + 1
|
||||
* @param r
|
||||
* @param g
|
||||
* @param b
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
public static BufferedImage getStar(int r, int g, int b, int size) {
|
||||
// abs(sqrt(sqrt(abs(3.14x))+sqrt(abs(3.14y)))-2.4)
|
||||
|
||||
BufferedImage image = new BufferedImage(1001, 1001, 3);
|
||||
BufferedImage image = new BufferedImage(size*2 + 1, size*2 + 1, 3);
|
||||
Graphics2D graphics = (Graphics2D) image.getGraphics();
|
||||
|
||||
//lets make a huge image...
|
||||
for (int y = 0; y < 1001; y++)
|
||||
for (int x = 0; x < 1001; x++) {
|
||||
for (int y = 0; y < size*2 + 1; y++)
|
||||
for (int x = 0; x < size*2 + 1; x++) {
|
||||
|
||||
//lets use variables that dont make sense
|
||||
double x2 = x - 500;
|
||||
x2 /= 50;
|
||||
double y2 = y - 500;
|
||||
y2 /= 50;
|
||||
double x2 = x - size;
|
||||
x2 /= size/10;
|
||||
double y2 = y - size;
|
||||
y2 /= size/10;
|
||||
double a = 0 - (Math.sqrt(Math.sqrt(Math.abs(Math.PI * (x2))) + Math.sqrt(Math.abs(Math.PI * (y2)))) - 2.35);
|
||||
int baseColor = a >= 0 ? 255 : 0;
|
||||
int opacity = (int) ((a / 6d) * 255);
|
||||
|
|
@ -103,13 +101,6 @@ public class Main {
|
|||
//whatever, this works.
|
||||
}
|
||||
|
||||
try {
|
||||
//scale that shit down.
|
||||
image = getScaledImage(image, 129, 129);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return image;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue