polycasso-commit Mailing List for polycasso
Brought to you by:
dbrosius
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(115) |
Dec
(92) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
(1) |
Oct
(4) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <dbr...@us...> - 2012-04-21 00:23:31
|
Revision: 250
http://polycasso.svn.sourceforge.net/polycasso/?rev=250&view=rev
Author: dbrosius
Date: 2012-04-21 00:23:24 +0000 (Sat, 21 Apr 2012)
Log Message:
-----------
merge from github
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2012-03-18 02:35:10 UTC (rev 249)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2012-04-21 00:23:24 UTC (rev 250)
@@ -38,7 +38,7 @@
private static final String ROOTURL = "http://search.lycos.com";
private static final String URL = ROOTURL + "/images/?q={0}";
private static final Pattern IMAGE_HTML_PATTERN = Pattern.compile("\\<a href=\"(/image-preview\\?image=.*)\"");
- private static final Pattern IMAGE_PATTERN = Pattern.compile("<a href=\"([^\"]*)\" title=\"Full-size Image\">");
+ private static final Pattern IMAGE_PATTERN = Pattern.compile("<a href=\"([^\"]*)\" title=\"Full-size image\">");
private static final int NAMELEN = 3;
private static final int ATTEMPTS = 5;
@@ -67,6 +67,7 @@
return findImageAt(MessageFormat.format(URL, new String(ranName)), settings);
} catch (IOException ioe) {
+ ioe.printStackTrace();
}
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java 2012-03-18 02:35:10 UTC (rev 249)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java 2012-04-21 00:23:24 UTC (rev 250)
@@ -70,7 +70,10 @@
proxy = Proxy.NO_PROXY;
}
con = (HttpURLConnection)u.openConnection(proxy);
- con.addRequestProperty("User-Agent", "Mozilla/4.76");
+ con.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6");
+ con.addRequestProperty("Accept-Charset", "UTF-8");
+ con.addRequestProperty("Accept-Language", "en-US,en");
+ con.addRequestProperty("Accept", "text/html,image/*");
con.setDoInput(true);
con.setDoOutput(false);
con.connect();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2012-03-18 02:35:16
|
Revision: 249
http://polycasso.svn.sourceforge.net/polycasso/?rev=249&view=rev
Author: dbrosius
Date: 2012-03-18 02:35:10 +0000 (Sun, 18 Mar 2012)
Log Message:
-----------
pull from github
Modified Paths:
--------------
trunk/polycasso/build.xml
trunk/polycasso/polycasso.store
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2012-03-18 02:19:37 UTC (rev 248)
+++ trunk/polycasso/build.xml 2012-03-18 02:35:10 UTC (rev 249)
@@ -37,6 +37,7 @@
<property name="forms.version" value="1.2.1"/>
<property name="commons-io.version" value="1.4"/>
+ <property name="junit.version" value="4.10"/>
<property name="polycasso.version" value="1.6.0"/>
@@ -67,6 +68,7 @@
<property name="forms_url" value="http://repo1.maven.org/maven2/com/jgoodies/forms/${forms.version}/forms-${forms.version}.jar"/>
<property name="commonsio_url" value="http://repo1.maven.org/maven2/commons-io/commons-io/${commons-io.version}/commons-io-${commons-io.version}.jar"/>
+ <property name="junit_url" value="http://repo1.maven.org/maven2/junit/junit/${junit.version}/junit-${junit.version}.jar"/>
<target name="forms_check">
<available file="${basedir}/lib/forms-${forms.version}.jar" property="forms_exists"/>
@@ -75,17 +77,25 @@
<target name="commonsio_check">
<available file="${basedir}/lib/commons-io-${commons-io.version}.jar" property="commonsio.exists"/>
</target>
+
+ <target name="junit_check">
+ <available file="${basedir}/lib/junit-${junit.version}.jar" property="junit.exists"/>
+ </target>
<target name="install_forms" depends="forms_check" unless="forms_exists" description="installs forms.jar into lib">
- <get src="${forms_url}" dest="${basedir}/lib/forms-${forms.version}.jar" verbose="true" ignoreerrors="true"/>
+ <get src="${forms_url}" dest="${lib.dir}/forms-${forms.version}.jar" verbose="true" ignoreerrors="true"/>
</target>
<target name="install_commonsio" depends="commonsio_check" unless="commonsio.exists" description="installs commons-io.jar into lib">
- <get src="${commonsio_url}" dest="${basedir}/lib/commons-io-${commons-io.version}.jar" verbose="true" ignoreerrors="true"/>
+ <get src="${commonsio_url}" dest="${lib.dir}/commons-io-${commons-io.version}.jar" verbose="true" ignoreerrors="true"/>
</target>
- <target name="pull" depends="install_forms, install_commonsio" description="pulls in the 3rd party jars">
+ <target name="install_junit" depends="junit_check" unless="junit.exists" description="installs junit.jar into lib">
+ <get src="${junit_url}" dest="${lib.dir}/junit-${junit.version}.jar" verbose="true" ignoreerrors="true"/>
</target>
+
+ <target name="pull" depends="install_forms, install_commonsio, install_junit" description="pulls in the 3rd party jars">
+ </target>
<target name="compile" depends="-init, pull" description="compiles java files">
<javac srcdir="${src.dir}"
@@ -160,6 +170,7 @@
<target name="test" depends="-init, compile, resources" description="runs unit tests">
<path id="polycassotest.classpath">
<pathelement location="${classes.dir}"/>
+ <pathelement location="${lib.dir}/junit-${junit.version}.jar"/>
</path>
<junit
printsummary="true"
@@ -168,7 +179,7 @@
showoutput="true"
fork="true">
- <classpath><path refid="polycasso.classpath"/></classpath>
+ <classpath><path refid="polycassotest.classpath"/></classpath>
<batchtest fork="true">
<fileset dir="${classes.dir}"
excludes="test/*$*"
Modified: trunk/polycasso/polycasso.store
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2012-03-18 02:19:44
|
Revision: 248
http://polycasso.svn.sourceforge.net/polycasso/?rev=248&view=rev
Author: dbrosius
Date: 2012-03-18 02:19:37 +0000 (Sun, 18 Mar 2012)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2012-01-16 20:36:26 UTC (rev 247)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2012-03-18 02:19:37 UTC (rev 248)
@@ -35,10 +35,10 @@
*/
public class RandomImageFinder {
- private static final String ROOTURL = "http://search.lycos.com/";
- private static final String URL = ROOTURL + "?tab=multi&loc=searchbox&sortMode=&safeSearch=&cat=images&query={0}&x=0&y=0";
- private static final Pattern IMAGE_HTML_PATTERN = Pattern.compile("<div\\s+class=\"imageResult\"><a\\s+href=\"([^\"]*)\"");
- private static final Pattern IMAGE_PATTERN = Pattern.compile("image_url=([^&]*)&");
+ private static final String ROOTURL = "http://search.lycos.com";
+ private static final String URL = ROOTURL + "/images/?q={0}";
+ private static final Pattern IMAGE_HTML_PATTERN = Pattern.compile("\\<a href=\"(/image-preview\\?image=.*)\"");
+ private static final Pattern IMAGE_PATTERN = Pattern.compile("<a href=\"([^\"]*)\" title=\"Full-size Image\">");
private static final int NAMELEN = 3;
private static final int ATTEMPTS = 5;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2012-01-16 20:36:34
|
Revision: 247
http://polycasso.svn.sourceforge.net/polycasso/?rev=247&view=rev
Author: dbrosius
Date: 2012-01-16 20:36:26 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
update from github
Modified Paths:
--------------
trunk/polycasso/build.xml
trunk/polycasso/htdocs/polylamp.svg
trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java
trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java
trunk/polycasso/src/com/mebigfatguy/polycasso/DoubleDocument.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java
trunk/polycasso/src/com/mebigfatguy/polycasso/FileSelector.java
trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedEvent.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedListener.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java
trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PainterPanel.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ProxyDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Score.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/build.xml 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,8 +1,8 @@
<!--
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -55,6 +55,7 @@
</target>
<target name="-init" description="prepares repository for a build">
+ <mkdir dir="${lib.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${javadoc.dir}"/>
<path id="polycasso.classpath">
Modified: trunk/polycasso/htdocs/polylamp.svg
===================================================================
--- trunk/polycasso/htdocs/polylamp.svg 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/htdocs/polylamp.svg 2012-01-16 20:36:26 UTC (rev 247)
@@ -55,7 +55,7 @@
<polygon fill="#b8a296" fill-opacity="0.7066416" points="123,233 124,223 95,243"/>
<polygon fill="#ffe4ba" fill-opacity="0.08091611" points="123,393 102,363 138,320 126,303 116,350 69,350 50,386"/>
<polygon fill="#968a84" fill-opacity="0.70623696" points="105,181 134,228 116,225 116,223 111,254 98,301 33,153"/>
- <polygon fill="#00001a" fill-opacity="0.2011652" points="219,122 225,127 232,140 240,149 301,135 277,95 201,48"/>
+ <polygon fill="#00001a" fill-opacity="0.2012652" points="219,122 225,127 232,140 240,149 301,135 277,95 201,48"/>
<polygon fill="#0000b5" fill-opacity="0.26807457" points="45,213 45,226 21,228 21,240 21,256 28,259 36,261"/>
<polygon fill="#9a8d61" fill-opacity="0.22238308" points="103,176 166,189 189,197 229,174 278,265 253,317 242,283"/>
<polygon fill="#8d7869" fill-opacity="0.55219734" points="45,151 66,170 31,145 37,169 58,169 41,261"/>
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/DoubleDocument.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DoubleDocument.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DoubleDocument.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/FileSelector.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/FileSelector.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/FileSelector.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -86,9 +86,8 @@
generationElites++;
return ImprovementResult.ELITE;
}
-
- return ImprovementResult.FAIL;
}
+ return ImprovementResult.FAIL;
}
/**
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedEvent.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedEvent.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedEvent.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedListener.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedListener.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedListener.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,20 +1,20 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and limitations
- * under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
*/
package com.mebigfatguy.polycasso;
@@ -35,159 +35,154 @@
* generates a java source code that draws the image with polygons in a JFrame
*/
public class JavaSaver implements Saver {
-
- private static final String EXTENSION = ".java";
- private static final String TABS = "\t\t\t\t\t";
-
- /**
- * saves the polygon data as a java file that opens a JFrame and draws the polygons
- *
- * @param fileName the name of the file to write to
- * @param imageSize the dimension of the image
- * @param data the polygons to draw
- */
- @Override
- public void save(String fileName, Dimension imageSize, PolygonData[] data)
- throws IOException {
- InputStream templateStream = null;
- PrintWriter pw = null;
-
- int sep = fileName.lastIndexOf(File.separator);
- String className;
- if (sep >= 0)
- className = fileName.substring(sep + 1);
- else
- className = fileName;
-
- if (className.endsWith(EXTENSION)) {
- className = className.substring(0, className.length() - EXTENSION.length());
- }
-
- try {
- pw = new PrintWriter(new BufferedWriter(new FileWriter(fileName)));
-
- templateStream = getClass().getResourceAsStream("/com/mebigfatguy/polycasso/JavaSaver.template");
- String template = IOUtils.toString(templateStream);
-
- String polygonData = getPolygonData(data);
- String colorData = getColorData(data);
- String transparencyData = getTransparencyData(data);
-
- /* All the curly braces confuses MessageFormat, so just do it manually */
- template = template.replaceAll("\\{0\\}", className);
- template = template.replaceAll("\\{1\\}", String.valueOf(imageSize.width));
- template = template.replaceAll("\\{2\\}", String.valueOf(imageSize.height));
- template = template.replaceAll("\\{3\\}", polygonData);
- template = template.replaceAll("\\{4\\}", colorData);
- template = template.replaceAll("\\{5\\}", transparencyData);
-
- pw.println(template);
-
- } catch (IOException ioe) {
-
- } finally {
- IOUtils.closeQuietly(templateStream);
- IOUtils.closeQuietly(pw);
- }
- }
-
- private String getPolygonData(PolygonData[] data) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- String outerComma = "";
- String innerComma;
- for (int i = 0; i < data.length; i++) {
-
- PolygonData pd = data[i];
-
- pw.println(outerComma);
- pw.print(TABS);
- pw.println("{");
-
- /* Xs */
- pw.print(TABS);
- pw.print("\t{");
-
- innerComma = "";
- Polygon poly = pd.getPolygon();
- for (int j = 0; j < poly.npoints; j++) {
- pw.print(innerComma);
- pw.print(poly.xpoints[j]);
- innerComma = ",";
- }
-
- pw.println("},");
-
- /* Ys */
- pw.print(TABS);
- pw.print("\t{");
-
- innerComma = "";
- poly = pd.getPolygon();
- for (int j = 0; j < poly.npoints; j++) {
- pw.print(innerComma);
- pw.print(poly.ypoints[j]);
- innerComma = ",";
- }
-
- pw.println("}");
-
- pw.print(TABS);
- pw.print("}");
- outerComma = ",";
- }
-
- pw.flush();
- return sw.toString();
- }
-
- private String getColorData(PolygonData[] data) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- String comma = "";
- for (int i = 0; i < data.length; i++) {
-
- PolygonData pd = data[i];
-
- pw.println(comma);
- pw.print(TABS);
- pw.print("{");
-
- Color color = pd.getColor();
- pw.print(color.getRed());
- pw.print(",");
- pw.print(color.getGreen());
- pw.print(",");
- pw.print(color.getBlue());
- pw.print("}");
- comma = ",";
- }
-
- pw.flush();
- return sw.toString();
- }
-
- private String getTransparencyData(PolygonData[] data) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- pw.println();
- pw.print(TABS);
- String comma = "";
- for (int i = 0; i < data.length; i++) {
-
- PolygonData pd = data[i];
-
- pw.print(comma);
- pw.print(pd.getAlpha());
- pw.print("f");
- comma = ",";
- }
-
- pw.flush();
- return sw.toString();
- }
+ private static final String EXTENSION = ".java";
+ private static final String TABS = "\t\t\t\t\t";
+ /**
+ * saves the polygon data as a java file that opens a JFrame and draws the polygons
+ *
+ * @param fileName the name of the file to write to
+ * @param imageSize the dimension of the image
+ * @param data the polygons to draw
+ */
+ @Override
+ public void save(String fileName, Dimension imageSize, PolygonData[] data)
+ throws IOException {
+
+ InputStream templateStream = null;
+ PrintWriter pw = null;
+
+ int sep = fileName.lastIndexOf(File.separator);
+ String className;
+ if (sep >= 0) {
+ className = fileName.substring(sep + 1);
+ } else {
+ className = fileName;
+ }
+
+ if (className.endsWith(EXTENSION)) {
+ className = className.substring(0, className.length() - EXTENSION.length());
+ }
+
+ try {
+ pw = new PrintWriter(new BufferedWriter(new FileWriter(fileName)));
+
+ templateStream = getClass().getResourceAsStream("/com/mebigfatguy/polycasso/JavaSaver.template");
+ String template = IOUtils.toString(templateStream);
+
+ String polygonData = getPolygonData(data);
+ String colorData = getColorData(data);
+ String transparencyData = getTransparencyData(data);
+
+ /* All the curly braces confuses MessageFormat, so just do it manually */
+ template = template.replaceAll("\\{0\\}", className);
+ template = template.replaceAll("\\{1\\}", String.valueOf(imageSize.width));
+ template = template.replaceAll("\\{2\\}", String.valueOf(imageSize.height));
+ template = template.replaceAll("\\{3\\}", polygonData);
+ template = template.replaceAll("\\{4\\}", colorData);
+ template = template.replaceAll("\\{5\\}", transparencyData);
+
+ pw.println(template);
+
+ } catch (IOException ioe) {
+
+ } finally {
+ IOUtils.closeQuietly(templateStream);
+ IOUtils.closeQuietly(pw);
+ }
+ }
+
+ private String getPolygonData(PolygonData[] data) {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+
+ String outerComma = "";
+ String innerComma;
+ for (PolygonData pd : data) {
+
+ pw.println(outerComma);
+ pw.print(TABS);
+ pw.println("{");
+
+ /* Xs */
+ pw.print(TABS);
+ pw.print("\t{");
+
+ innerComma = "";
+ Polygon poly = pd.getPolygon();
+ for (int j = 0; j < poly.npoints; j++) {
+ pw.print(innerComma);
+ pw.print(poly.xpoints[j]);
+ innerComma = ",";
+ }
+
+ pw.println("},");
+
+ /* Ys */
+ pw.print(TABS);
+ pw.print("\t{");
+
+ innerComma = "";
+ poly = pd.getPolygon();
+ for (int j = 0; j < poly.npoints; j++) {
+ pw.print(innerComma);
+ pw.print(poly.ypoints[j]);
+ innerComma = ",";
+ }
+
+ pw.println("}");
+
+ pw.print(TABS);
+ pw.print("}");
+ outerComma = ",";
+ }
+
+ pw.flush();
+ return sw.toString();
+ }
+
+ private String getColorData(PolygonData[] data) {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+
+ String comma = "";
+ for (PolygonData pd : data) {
+
+ pw.println(comma);
+ pw.print(TABS);
+ pw.print("{");
+
+ Color color = pd.getColor();
+ pw.print(color.getRed());
+ pw.print(",");
+ pw.print(color.getGreen());
+ pw.print(",");
+ pw.print(color.getBlue());
+ pw.print("}");
+ comma = ",";
+ }
+
+ pw.flush();
+ return sw.toString();
+ }
+
+ private String getTransparencyData(PolygonData[] data) {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ pw.println();
+ pw.print(TABS);
+ String comma = "";
+ for (PolygonData pd : data) {
+
+ pw.print(comma);
+ pw.print(pd.getAlpha());
+ pw.print("f");
+ comma = ",";
+ }
+
+ pw.flush();
+ return sw.toString();
+ }
+
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PainterPanel.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PainterPanel.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PainterPanel.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,7 +28,7 @@
/**
* enable some console debugging, and show the target image
*/
- public static final boolean DEBUG = true;
+ public static final boolean DEBUG = false;
;
/**
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ProxyDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ProxyDialog.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ProxyDialog.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Score.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Score.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Score.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java 2012-01-16 20:34:46 UTC (rev 246)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java 2012-01-16 20:36:26 UTC (rev 247)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2011 MeBigFatGuy.com
- * Copyright 2009-2011 Dave Brosius
+ * Copyright 2009-2012 MeBigFatGuy.com
+ * Copyright 2009-2012 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2012-01-16 20:34:53
|
Revision: 246
http://polycasso.svn.sourceforge.net/polycasso/?rev=246&view=rev
Author: dbrosius
Date: 2012-01-16 20:34:46 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
remove jars from repo
Removed Paths:
-------------
trunk/polycasso/lib/commons-io-1.4.jar
trunk/polycasso/lib/forms-1.2.1.jar
Deleted: trunk/polycasso/lib/commons-io-1.4.jar
===================================================================
(Binary files differ)
Deleted: trunk/polycasso/lib/forms-1.2.1.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-08-13 06:12:21
|
Revision: 245
http://polycasso.svn.sourceforge.net/polycasso/?rev=245&view=rev
Author: dbrosius
Date: 2011-08-13 06:12:14 +0000 (Sat, 13 Aug 2011)
Log Message:
-----------
fix the calculation of the changed area
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java 2011-08-07 02:14:13 UTC (rev 244)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java 2011-08-13 06:12:14 UTC (rev 245)
@@ -79,17 +79,6 @@
score = calculateXMajorScore(testBuffer, previousScore, changedArea);
}
- // uncomment to test whether the grid based scoring is accurate
- // if (Math.random() < 0.05) {
- // long realScore = calculateGridScore(testBuffer, 0, 0, width, height);
- // if (realScore != score.getDelta()) {
- // System.out.println("ERROR: Real: " + realScore + " calc: " + score.getDelta());
- // Score s = calculateYMajorScore(testBuffer, null, null);
- // System.out.println("Full Recalc: " + s.getDelta());
- // calculateScore(testImage, previousScore, changedArea);
- // }
- // }
-
return score;
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2011-08-07 02:14:13 UTC (rev 244)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2011-08-13 06:12:14 UTC (rev 245)
@@ -63,6 +63,9 @@
* @return the list of polygons
*/
public List<PolygonData> getData() {
+ if (polygons == null) {
+ return new ArrayList<PolygonData>();
+ }
return Collections.<PolygonData>unmodifiableList(polygons);
}
@@ -137,7 +140,7 @@
System.arraycopy(polygon.ypoints, insPos, polygon.ypoints, insPos + 1, numCopyPts);
polygon.ypoints[insPos] = y;
polygon.invalidate();
- changedArea.union(polygon.getBounds());
+ changedArea = changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
} else {
@@ -161,7 +164,7 @@
System.arraycopy(polygon.ypoints, delPos+1, polygon.ypoints, delPos, numPtCopy);
polygon.npoints--;
polygon.invalidate();
- changedArea.union(polygon.getBounds());
+ changedArea = changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
} else {
randomCompleteChange();
@@ -186,7 +189,7 @@
clipToRange(0, imageSize.width, polygon.xpoints[movePos]);
clipToRange(0, imageSize.height, polygon.ypoints[movePos]);
polygon.invalidate();
- changedArea.union(polygon.getBounds());
+ changedArea = changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -206,7 +209,7 @@
polygon.ypoints[rectifyPos] = polygon.ypoints[targetPos];
}
polygon.invalidate();
- changedArea.union(polygon.getBounds());
+ changedArea = changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -240,7 +243,7 @@
polygon.ypoints[i] += (polygon.ypoints[i] < midY) ? shrinkFactor : -shrinkFactor;
}
polygon.invalidate();
- changedArea.union(polygon.getBounds());
+ changedArea = changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -262,7 +265,7 @@
polygon.ypoints[i] = clipToRange(0, imageSize.height, polygon.ypoints[i]);
}
polygon.invalidate();
- changedArea.union(polygon.getBounds());
+ changedArea = changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -283,7 +286,7 @@
polygon.ypoints[i] = clipToRange(0, imageSize.height, polygon.ypoints[i]);
}
polygon.invalidate();
- changedArea.union(polygon.getBounds());
+ changedArea = changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -363,7 +366,7 @@
} else {
changedArea = polygons.get(idx).getPolygon().getBounds();
polygons.set(idx, copyData[idx]);
- changedArea.union(polygons.get(idx).getPolygon().getBounds());
+ changedArea = changedArea.union(polygons.get(idx).getPolygon().getBounds());
}
}
}
@@ -382,7 +385,7 @@
} else {
changedArea = polygons.get(idx).getPolygon().getBounds();
polygons.set(idx, copyData[idx]);
- changedArea.union(polygons.get(idx).getPolygon().getBounds());
+ changedArea = changedArea.union(polygons.get(idx).getPolygon().getBounds());
}
}
}
@@ -422,7 +425,7 @@
int idx = r.nextInt(polygons.size());
changedArea = polygons.get(idx).getPolygon().getBounds();
PolygonData randomPoly = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
- changedArea.union(randomPoly.getPolygon().getBounds());
+ changedArea = changedArea.union(randomPoly.getPolygon().getBounds());
polygons.set(idx, randomPoly);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-08-07 02:14:20
|
Revision: 244
http://polycasso.svn.sourceforge.net/polycasso/?rev=244&view=rev
Author: dbrosius
Date: 2011-08-07 02:14:13 +0000 (Sun, 07 Aug 2011)
Log Message:
-----------
use grid scoring
Modified Paths:
--------------
trunk/polycasso/build.xml
trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java
trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultScore.java
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ProxyDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Score.java
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2011-08-03 06:00:34 UTC (rev 243)
+++ trunk/polycasso/build.xml 2011-08-07 02:14:13 UTC (rev 244)
@@ -92,7 +92,8 @@
source="${javac.source}"
target="${javac.target}"
deprecation="${javac.deprecation}"
- debug="${javac.debug}">
+ debug="${javac.debug}"
+ includeantruntime="false">
<classpath refid="polycasso.classpath"/>
</javac>
</target>
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java 2011-08-03 06:00:34 UTC (rev 243)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java 2011-08-07 02:14:13 UTC (rev 244)
@@ -30,6 +30,7 @@
private byte[] targetBuffer;
private int width, height;
+ private int gridWidth, gridHeight;
/**
* creates a feedback object with a given targetImage. Caches the image bytes in
@@ -48,6 +49,8 @@
WritableRaster raster = targetImage.getRaster();
width = targetImage.getWidth();
height = targetImage.getHeight();
+ gridWidth = (width / DefaultScore.NUM_DIVISIONS);
+ gridHeight = (height / DefaultScore.NUM_DIVISIONS);
DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
targetBuffer = dbb.getData();
}
@@ -65,18 +68,41 @@
@Override
public Score calculateScore(BufferedImage testImage, Score previousScore, Rectangle changedArea) {
- DefaultScore score = (previousScore != null) ? (DefaultScore)previousScore.clone() : new DefaultScore();
-
WritableRaster raster = testImage.getRaster();
DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
byte[] testBuffer = dbb.getData();
- boolean needAutoRecalc = (previousScore == null) || (changedArea == null);
+ Score score;
+ if ((changedArea == null) || (changedArea.width > changedArea.height)) {
+ score = calculateYMajorScore(testBuffer, previousScore, changedArea);
+ } else {
+ score = calculateXMajorScore(testBuffer, previousScore, changedArea);
+ }
+
+ // uncomment to test whether the grid based scoring is accurate
+ // if (Math.random() < 0.05) {
+ // long realScore = calculateGridScore(testBuffer, 0, 0, width, height);
+ // if (realScore != score.getDelta()) {
+ // System.out.println("ERROR: Real: " + realScore + " calc: " + score.getDelta());
+ // Score s = calculateYMajorScore(testBuffer, null, null);
+ // System.out.println("Full Recalc: " + s.getDelta());
+ // calculateScore(testImage, previousScore, changedArea);
+ // }
+ // }
+
+ return score;
+
+ }
+
+ private Score calculateYMajorScore(byte[] testBuffer, Score previousScore, Rectangle changedArea) {
+
+ DefaultScore score = (previousScore != null) ? (DefaultScore)previousScore.clone() : new DefaultScore();
+
+ boolean needFullRecalc = (previousScore == null) || (changedArea == null);
score.overallScore = 0L;
+ int gridTop = 0;
for (int y = 0; y < DefaultScore.NUM_DIVISIONS; y++) {
- int gridHeight = (height / DefaultScore.NUM_DIVISIONS);
- int gridTop = y * gridHeight;
int gridBottom;
if (y < (DefaultScore.NUM_DIVISIONS - 1)) {
gridBottom = gridTop + gridHeight;
@@ -84,10 +110,9 @@
gridBottom = height;
}
- if (needAutoRecalc || ((changedArea.y <= gridBottom) && ((changedArea.y + changedArea.height) >= gridTop))) {
+ if (needFullRecalc || ((changedArea.y <= gridBottom) && ((changedArea.y + changedArea.height) >= gridTop))) {
+ int gridLeft = 0;
for (int x = 0; x < DefaultScore.NUM_DIVISIONS; x++) {
- int gridWidth = (width / DefaultScore.NUM_DIVISIONS);
- int gridLeft = x * gridWidth;
int gridRight;
if (x < (DefaultScore.NUM_DIVISIONS - 1)) {
gridRight = gridLeft + gridWidth;
@@ -95,46 +120,107 @@
gridRight = width;
}
- if (needAutoRecalc || ((changedArea.x <= gridRight) && ((changedArea.x + changedArea.width) >= gridLeft))) {
+ if (needFullRecalc || ((changedArea.x <= gridRight) && ((changedArea.x + changedArea.width) >= gridLeft))) {
- long gridError = 0L;
- for (int gy = gridTop; gy < gridBottom; gy++) {
- int pixelStart = (gy * width * 4) + (gridLeft * 4);
- int pixelEnd = pixelStart + (gridRight - gridLeft) * 4;
+ long gridError = calculateGridScore(testBuffer, gridLeft, gridTop, gridRight, gridBottom);
- //index 0 is alpha, start at 1 (blue)
- for (int i = pixelStart + 1; i < pixelEnd; i++) {
- int blue1 = targetBuffer[i] & 0x0FF;
- int blue2 = testBuffer[i++] & 0x0FF;
- long blueError = blue1 - blue2;
- blueError *= blueError;
+ score.gridScores[x][y] = gridError;
+ score.overallScore += gridError;
+ } else {
+ score.overallScore += score.gridScores[x][y];
+ }
- int green1 = targetBuffer[i] & 0x0FF;
- int green2 = testBuffer[i++] & 0x0FF;
- long greenError = green1 - green2;
- greenError *= greenError;
+ gridLeft = gridRight;
+ }
+ } else {
+ for (int x = 0; x < DefaultScore.NUM_DIVISIONS; x++) {
+ score.overallScore += score.gridScores[x][y];
+ }
+ }
- int red1 = targetBuffer[i] & 0x0FF;
- int red2 = testBuffer[i++] & 0x0FF;
- long redError = red1 - red2;
- redError *= redError;
+ gridTop = gridBottom;
+ }
- gridError += redError + greenError + blueError;
- }
- }
+ return score;
+ }
+
+ private Score calculateXMajorScore(byte[] testBuffer, Score previousScore, Rectangle changedArea) {
+
+ DefaultScore score = (previousScore != null) ? (DefaultScore)previousScore.clone() : new DefaultScore();
+
+ boolean needFullRecalc = (previousScore == null) || (changedArea == null);
+ score.overallScore = 0L;
+
+ int gridLeft = 0;
+ for (int x = 0; x < DefaultScore.NUM_DIVISIONS; x++) {
+ int gridRight;
+ if (x < (DefaultScore.NUM_DIVISIONS - 1)) {
+ gridRight = gridLeft + gridWidth;
+ } else {
+ gridRight = width;
+ }
+
+ if (needFullRecalc || ((changedArea.x <= gridRight) && ((changedArea.x + changedArea.width) >= gridLeft))) {
+ int gridTop = 0;
+ for (int y = 0; y < DefaultScore.NUM_DIVISIONS; y++) {
+ int gridBottom;
+ if (y < (DefaultScore.NUM_DIVISIONS - 1)) {
+ gridBottom = gridTop + gridHeight;
+ } else {
+ gridBottom = height;
+ }
+
+ if (needFullRecalc || ((changedArea.y <= gridBottom) && ((changedArea.y + changedArea.height) >= gridTop))) {
+
+ long gridError = calculateGridScore(testBuffer, gridLeft, gridTop, gridRight, gridBottom);
+
score.gridScores[x][y] = gridError;
score.overallScore += gridError;
} else {
score.overallScore += score.gridScores[x][y];
}
+
+ gridTop = gridBottom;
}
} else {
- for (int x = 0; x < DefaultScore.NUM_DIVISIONS; x++) {
+ for (int y = 0; y < DefaultScore.NUM_DIVISIONS; y++) {
score.overallScore += score.gridScores[x][y];
}
}
+
+ gridLeft = gridRight;
}
return score;
}
+
+ private long calculateGridScore(byte[] testBuffer, int gridLeft, int gridTop, int gridRight, int gridBottom) {
+ long gridError = 0L;
+ for (int gy = gridTop; gy < gridBottom; gy++) {
+ int pixelStart = (gy * width * 4) + (gridLeft * 4);
+ int pixelEnd = pixelStart + ((gridRight - gridLeft) * 4);
+
+ //index 0 is alpha, start at 1 (blue)
+ for (int i = pixelStart + 1; i < pixelEnd; i++) {
+ int blue1 = targetBuffer[i] & 0x0FF;
+ int blue2 = testBuffer[i++] & 0x0FF;
+ long blueError = blue1 - blue2;
+ blueError *= blueError;
+
+ int green1 = targetBuffer[i] & 0x0FF;
+ int green2 = testBuffer[i++] & 0x0FF;
+ long greenError = green1 - green2;
+ greenError *= greenError;
+
+ int red1 = targetBuffer[i] & 0x0FF;
+ int red2 = testBuffer[i++] & 0x0FF;
+ long redError = red1 - red2;
+ redError *= redError;
+
+ gridError += redError + greenError + blueError;
+ }
+ }
+
+ return gridError;
+ }
}
\ No newline at end of file
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultScore.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultScore.java 2011-08-03 06:00:34 UTC (rev 243)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultScore.java 2011-08-07 02:14:13 UTC (rev 244)
@@ -3,11 +3,12 @@
/**
* a default implementation of a score for the error in a image against a target image
* this score maintains a grid of scores representing scores in sections of the image, and
- * then rolls up these scores to an overall score
+ * then rolls up these scores to an overall score.
*/
public class DefaultScore implements Score {
- static final int NUM_DIVISIONS = 4;
+ private static final long serialVersionUID = 2603006530810631094L;
+ static final int NUM_DIVISIONS = 8;
/**
* a worst case score
@@ -52,7 +53,7 @@
}
/**
- * compares this core to another
+ * compares this score to another
*
* @param o the score to compare to
* @return whether the two scores have the same delta
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-08-03 06:00:34 UTC (rev 243)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-08-07 02:14:13 UTC (rev 244)
@@ -4,17 +4,17 @@
* Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and limitations
- * under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
*/
package com.mebigfatguy.polycasso;
@@ -29,144 +29,145 @@
* class that maintains the set of polygon data for this generation of images
*/
public class GenerationHandler implements Serializable {
-
- private static final long serialVersionUID = 2375492293685052783L;
+ private static final long serialVersionUID = 2375492293685052783L;
+
private List<GenerationMember> generation;
- private Random random;
- private Settings settings;
- private int generationNumber;
- private double annealingValue;
- private GenerationMember bestMember;
- private double eliteCutOff;
- private int generationBests;
- private int generationElites;
-
- /**
- * constructs a handler for managing successive generations of image samples
- *
- * @param confSettings settings to use for generation and elite size
- * @param imageSize the size of the target image
- */
- public GenerationHandler(Settings confSettings, Dimension imageSize) {
- random = new Random();
- generationNumber = 0;
- settings = confSettings;
- bestMember = new GenerationMember(DefaultScore.MAX_SCORE, new PolygonData[0]);
- eliteCutOff = Long.MAX_VALUE;
- generation = new ArrayList<GenerationMember>(settings.getGenerationSize() + 10);
- annealingValue = settings.getStartTemperature() * settings.getStartTemperature() * imageSize.height * imageSize.width;
- generationBests = 0;
- generationElites = 0;
- }
-
- /**
- * add a sample polygon set to this generation with a given score
- *
- * @param score the deviation from perfection this set calculates
- *
- * @param polygonData the polygons that draw the image
- *
- * @return whether this is the best polygon set so far
- */
- public ImprovementResult addPolygonData(Score score, PolygonData[] polygonData) {
- synchronized(generation) {
- GenerationMember newMember = new GenerationMember(score, polygonData);
- generation.add(newMember);
- if (generation.size() >= settings.getGenerationSize()) {
- processGeneration();
- } else {
- Collections.sort(generation);
- }
- if (score.getDelta() < bestMember.getScore().getDelta()) {
- bestMember = newMember;
- generationBests++;
- return ImprovementResult.BEST;
- } else if (score.getDelta() < eliteCutOff) {
- generationElites++;
- return ImprovementResult.ELITE;
- }
-
- return ImprovementResult.FAIL;
- }
- }
-
- /**
+ private final Random random;
+ private final Settings settings;
+ private int generationNumber;
+ private double annealingValue;
+ private GenerationMember bestMember;
+ private double eliteCutOff;
+ private int generationBests;
+ private int generationElites;
+
+ /**
+ * constructs a handler for managing successive generations of image samples
+ *
+ * @param confSettings settings to use for generation and elite size
+ * @param imageSize the size of the target image
+ */
+ public GenerationHandler(Settings confSettings, Dimension imageSize) {
+ random = new Random();
+ generationNumber = 0;
+ settings = confSettings;
+ bestMember = new GenerationMember(DefaultScore.MAX_SCORE, new PolygonData[0]);
+ eliteCutOff = Long.MAX_VALUE;
+ generation = new ArrayList<GenerationMember>(settings.getGenerationSize() + 10);
+ annealingValue = settings.getStartTemperature() * settings.getStartTemperature() * imageSize.height * imageSize.width;
+ generationBests = 0;
+ generationElites = 0;
+ }
+
+ /**
+ * add a sample polygon set to this generation with a given score
+ *
+ * @param score the deviation from perfection this set calculates
+ *
+ * @param polygonData the polygons that draw the image
+ *
+ * @return whether this is the best polygon set so far
+ */
+ public ImprovementResult addPolygonData(Score score, PolygonData[] polygonData) {
+ GenerationMember newMember = new GenerationMember(score, polygonData);
+ synchronized(generation) {
+ generation.add(newMember);
+ if (generation.size() >= settings.getGenerationSize()) {
+ processGeneration();
+ } else {
+ Collections.sort(generation);
+ }
+ if (score.getDelta() < bestMember.getScore().getDelta()) {
+ bestMember = newMember;
+ generationBests++;
+ return ImprovementResult.BEST;
+ } else if (score.getDelta() < eliteCutOff) {
+ generationElites++;
+ return ImprovementResult.ELITE;
+ }
+
+ return ImprovementResult.FAIL;
+ }
+ }
+
+ /**
* pick a random member either from the general pool or elite pool
* skew the results towards the elite
*
* @param elite whether to pick from the elite pool or not
* @return a random member
*/
- public GenerationMember getRandomMember(boolean elite) {
- synchronized(generation) {
- int size = elite ? (settings.getEliteSize() % generation.size()) : generation.size();
+ public GenerationMember getRandomMember(boolean elite) {
+ synchronized(generation) {
+ int size = elite ? (settings.getEliteSize() % generation.size()) : generation.size();
- if (size == 0)
- return null;
-
- int r = random.nextInt(size);
-
- int idx = (int)(r * ((double) r / (double) size));
-
- return generation.get(idx);
- }
- }
-
- /**
- * returns the best polygon set to draw the picture
- *
- * @return the best polygon set
- */
- public GenerationMember getBestMember() {
- synchronized(generation) {
- return bestMember;
- }
- }
-
- private void processGeneration() {
- int eliteSize = settings.getEliteSize();
-
- Collections.<GenerationMember>sort(generation);
- int sz = generation.size();
-
- List<GenerationMember> nextGeneration = new ArrayList<GenerationMember>(settings.getGenerationSize() + 10);
- for (int i = 0; i < eliteSize; i++) {
- nextGeneration.add(generation.get(i));
- }
-
- if (settings.isUseAnnealing() && (annealingValue > 0.01)) {
+ if (size == 0) {
+ return null;
+ }
+
+ int r = random.nextInt(size);
+
+ int idx = (int)(r * ((double) r / (double) size));
+
+ return generation.get(idx);
+ }
+ }
+
+ /**
+ * returns the best polygon set to draw the picture
+ *
+ * @return the best polygon set
+ */
+ public GenerationMember getBestMember() {
+ synchronized(generation) {
+ return bestMember;
+ }
+ }
+
+ private void processGeneration() {
+ int eliteSize = settings.getEliteSize();
+
+ Collections.<GenerationMember>sort(generation);
+ int sz = generation.size();
+
+ List<GenerationMember> nextGeneration = new ArrayList<GenerationMember>(settings.getGenerationSize() + 10);
+ for (int i = 0; i < eliteSize; i++) {
+ nextGeneration.add(generation.get(i));
+ }
+
+ if (settings.isUseAnnealing() && (annealingValue > 0.01)) {
int annealingReplacements = 0;
-
- /* always keep the best, so start at 1 */
- for (int i = 1; i < eliteSize; i++) {
- int candidateIndex = random.nextInt(sz - eliteSize) + eliteSize;
- GenerationMember candidate = generation.get(candidateIndex);
- GenerationMember elite = generation.get(i);
- long delta = candidate.getScore().getDelta() - elite.getScore().getDelta();
- if (delta < annealingValue) {
- nextGeneration.set(i, candidate);
- if (Polycasso.DEBUG) {
- annealingReplacements++;
- }
- }
- }
-
+
+ /* always keep the best, so start at 1 */
+ for (int i = 1; i < eliteSize; i++) {
+ int candidateIndex = random.nextInt(sz - eliteSize) + eliteSize;
+ GenerationMember candidate = generation.get(candidateIndex);
+ GenerationMember elite = generation.get(i);
+ long delta = candidate.getScore().getDelta() - elite.getScore().getDelta();
+ if (delta < annealingValue) {
+ nextGeneration.set(i, candidate);
+ if (Polycasso.DEBUG) {
+ annealingReplacements++;
+ }
+ }
+ }
+
if (Polycasso.DEBUG) {
System.out.println("Generation " + generationNumber + " had " + annealingReplacements + " annealing replacements with annealing value: " + annealingValue);
}
- }
-
- generation = nextGeneration;
-
- eliteCutOff = generation.get(eliteSize-1).getScore().getDelta();
-
+ }
+
+ generation = nextGeneration;
+
+ eliteCutOff = generation.get(eliteSize-1).getScore().getDelta();
+
if (Polycasso.DEBUG) {
- System.out.println("Generation " + generationNumber + " had " + generationBests + " bests and " + generationElites + " elites. Best Score: " + generation.get(0).getScore());
+ System.out.println("Generation " + generationNumber + " had " + generationBests + " bests and " + generationElites + " elites. Best Score: " + generation.get(0).getScore());
}
generationBests = 0;
generationElites = 0;
- generationNumber++;
- annealingValue *= (1.0 - settings.getCoolingRate());
- }
+ generationNumber++;
+ annealingValue *= (1.0 - settings.getCoolingRate());
+ }
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java 2011-08-03 06:00:34 UTC (rev 243)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java 2011-08-07 02:14:13 UTC (rev 244)
@@ -4,78 +4,82 @@
* Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and limitations
- * under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
*/
package com.mebigfatguy.polycasso;
+import java.io.Serializable;
import java.util.Arrays;
/**
* class that holds a sample set of polygons and it's score
*/
-public class GenerationMember implements Comparable<GenerationMember> {
-
- private Score score;
- private PolygonData[] data;
-
- GenerationMember(Score polyScore, PolygonData[] polyData) {
- score = polyScore;
- data = polyData;
- }
-
- /**
- * returns the score for this member
- * @return the score
- */
- public Score getScore() {
- return score;
- }
+public class GenerationMember implements Comparable<GenerationMember>, Serializable {
- /**
- * returns the polygon data for this member
- *
- * @return the polygon data
- */
- public PolygonData[] getData() {
- return data;
- }
+ private static final long serialVersionUID = 3227390661297952844L;
- @Override
- public int compareTo(GenerationMember o) {
- long delta = score.getDelta() - o.score.getDelta();
- if (delta > 0)
- return 1;
- else if (delta < 0)
- return -1;
-
- return data.length - o.data.length;
- }
-
- @Override
- public int hashCode() {
- return score.hashCode();
- }
-
- @Override
- public boolean equals(Object o) {
- if (o instanceof GenerationMember) {
- return score.getDelta() == ((GenerationMember)o).score.getDelta();
- }
- return false;
- }
-
- @Override
- public String toString() {
- return "(" + score + ": " + Arrays.toString(data) + ")";
- }
+ private final Score score;
+ private final PolygonData[] data;
+
+ GenerationMember(Score polyScore, PolygonData[] polyData) {
+ score = polyScore;
+ data = polyData;
+ }
+
+ /**
+ * returns the score for this member
+ * @return the score
+ */
+ public Score getScore() {
+ return score;
+ }
+
+ /**
+ * returns the polygon data for this member
+ *
+ * @return the polygon data
+ */
+ public PolygonData[] getData() {
+ return data;
+ }
+
+ @Override
+ public int compareTo(GenerationMember o) {
+ long delta = score.getDelta() - o.score.getDelta();
+ if (delta > 0) {
+ return 1;
+ } else if (delta < 0) {
+ return -1;
+ }
+
+ return data.length - o.data.length;
+ }
+
+ @Override
+ public int hashCode() {
+ return score.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof GenerationMember) {
+ return score.getDelta() == ((GenerationMember)o).score.getDelta();
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "(" + score + ": " + Arrays.toString(data) + ")";
+ }
}
\ No newline at end of file
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2011-08-03 06:00:34 UTC (rev 243)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2011-08-07 02:14:13 UTC (rev 244)
@@ -4,17 +4,17 @@
* Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and limitations
- * under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
*/
package com.mebigfatguy.polycasso;
@@ -24,417 +24,424 @@
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.Random;
/**
- * a class that applies various improvement attempts to a polygon, attempts to prioritize
+ * a class that applies various improvement attempts to a polygon, attempts to prioritize
* which algorithms to pick based on what has worked in the past, as well as priorities which
* polygons have had success being transformed.
*/
public class Improver {
- private Settings settings;
- private GenerationHandler generationHandler;
- private Dimension imageSize;
- private Random r;
- private List<PolygonData> polygons = null;
- private Rectangle changedArea;
- private GenerationMember changedMember;
- private ImprovementTypeStats stats;
-
- /**
- * create an improver using a specified image size
- * @param confSettings the settings to be used
- * @param genHandler the generation handler
- * @param size the size of the image
- */
- public Improver(Settings confSettings, GenerationHandler genHandler, Dimension size) {
- settings = confSettings;
- generationHandler = genHandler;
- imageSize = size;
- stats = new ImprovementTypeStats();
- r = new Random();
- }
-
- /**
- * get the list of polygons usually after attempted to be improved
- *
- * @return the list of polygons
- */
- public List<PolygonData> getData() {
- return polygons;
- }
-
- /**
- * updates the stats for types that successfully improved the image
- *
- * @param type the improvement type that was successful
- * @param successful whether the improvement was successful
- */
- public void typeWasSuccessful(ImprovementType type, boolean successful) {
- stats.typeWasSuccessful(type, successful);
- }
-
- /**
- * attempts to improve on one polygon randomly by adjusting it according to a randomly
- * selected improvement type
- *
- * @return the improvement type used to alter the data
- */
- public ImprovementType improveRandomly() {
- changedMember = generationHandler.getRandomMember(false);
- if (changedMember != null)
- polygons = new ArrayList<PolygonData>(Arrays.asList(changedMember.getData().clone()));
- else
- polygons = new ArrayList<PolygonData>();
-
- ImprovementType type = (polygons.isEmpty()) ? ImprovementType.AddPolygon : stats.getRandomImprovementType();
-
- switch (type) {
- case AddPolygon: {
- if (polygons.size() < settings.getMaxPolygons()) {
- PolygonData pd = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
- polygons.add(pd);
- changedArea = pd.getPolygon().getBounds();
- } else {
- randomCompleteChange();
- type = ImprovementType.CompleteChange;
- typeWasSuccessful(ImprovementType.AddPolygon, false);
- }
- }
- break;
-
- case RemovePolygon: {
- int idx = r.nextInt(polygons.size());
- changedArea = polygons.get(idx).getPolygon().getBounds();
- polygons.remove(idx);
- }
- break;
-
- case AddPoint: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
- Polygon polygon = pd.getPolygon();
- changedArea = polygon.getBounds();
- if (polygon.npoints < settings.getMaxPoints()) {
- polygon.addPoint(0, 0);
- int insPos = r.nextInt(polygon.npoints);
- int lastPt = (insPos + polygon.npoints - 1) % polygon.npoints;
- int maxMovement = settings.getMaxPtMovement();
- int maxX = Math.max(maxMovement, Math.abs(polygon.xpoints[lastPt] - polygon.xpoints[insPos]));
- int maxY = Math.max(maxMovement, Math.abs(polygon.ypoints[lastPt] - polygon.ypoints[insPos]));
-
- int x = r.nextInt(maxX) + Math.min(polygon.xpoints[lastPt], polygon.xpoints[insPos]);
- int y = r.nextInt(maxY) + Math.min(polygon.ypoints[lastPt], polygon.ypoints[insPos]);
-
- int numCopyPts = polygon.npoints - insPos - 1;
- System.arraycopy(polygon.xpoints, insPos, polygon.xpoints, insPos + 1, numCopyPts);
- polygon.xpoints[insPos] = x;
- System.arraycopy(polygon.ypoints, insPos, polygon.ypoints, insPos + 1, numCopyPts);
- polygon.ypoints[insPos] = y;
- polygon.invalidate();
- changedArea.union(polygon.getBounds());
- polygons.set(idx, pd);
-
- } else {
- randomCompleteChange();
- type = ImprovementType.CompleteChange;
- typeWasSuccessful(ImprovementType.AddPoint, false);
- }
- }
- break;
-
- case RemovePoint: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
- Polygon polygon = pd.getPolygon();
- changedArea = polygon.getBounds();
- if (polygon.npoints > 3) {
- int delPos = r.nextInt(polygon.npoints);
-
- int numPtCopy = polygon.npoints - delPos - 1;
- System.arraycopy(polygon.xpoints, delPos+1, polygon.xpoints, delPos, numPtCopy);
- System.arraycopy(polygon.ypoints, delPos+1, polygon.ypoints, delPos, numPtCopy);
- polygon.npoints--;
+ private final Settings settings;
+ private final GenerationHandler generationHandler;
+ private final Dimension imageSize;
+ private final Random r;
+ private List<PolygonData> polygons = null;
+ private Rectangle changedArea;
+ private GenerationMember changedMember;
+ private final ImprovementTypeStats stats;
+
+ /**
+ * create an improver using a specified image size
+ * @param confSettings the settings to be used
+ * @param genHandler the generation handler
+ * @param size the size of the image
+ */
+ public Improver(Settings confSettings, GenerationHandler genHandler, Dimension size) {
+ settings = confSettings;
+ generationHandler = genHandler;
+ imageSize = size;
+ stats = new ImprovementTypeStats();
+ r = new Random();
+ }
+
+ /**
+ * get the list of polygons usually after attempted to be improved
+ *
+ * @return the list of polygons
+ */
+ public List<PolygonData> getData() {
+ return Collections.<PolygonData>unmodifiableList(polygons);
+ }
+
+ /**
+ * updates the stats for types that successfully improved the image
+ *
+ * @param type the improvement type that was successful
+ * @param successful whether the improvement was successful
+ */
+ public void typeWasSuccessful(ImprovementType type, boolean successful) {
+ stats.typeWasSuccessful(type, successful);
+ }
+
+ /**
+ * attempts to improve on one polygon randomly by adjusting it according to a randomly
+ * selected improvement type
+ *
+ * @return the improvement type used to alter the data
+ */
+ public ImprovementType improveRandomly() {
+ changedMember = generationHandler.getRandomMember(false);
+ if (changedMember != null) {
+ polygons = new ArrayList<PolygonData>(Arrays.<PolygonData>asList(changedMember.getData().clone()));
+ } else {
+ polygons = new ArrayList<PolygonData>();
+ }
+
+ ImprovementType type = (polygons.isEmpty()) ? ImprovementType.AddPolygon : stats.getRandomImprovementType();
+
+ switch (type) {
+ case AddPolygon: {
+ if (polygons.size() < settings.getMaxPolygons()) {
+ PolygonData pd = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
+ polygons.add(pd);
+ changedArea = pd.getPolygon().getBounds();
+ } else {
+ randomCompleteChange();
+ type = ImprovementType.CompleteChange;
+ typeWasSuccessful(ImprovementType.AddPolygon, false);
+ }
+ }
+ break;
+
+ case RemovePolygon: {
+ if (polygons.size() > 0) {
+ int idx = r.nextInt(polygons.size());
+ changedArea = polygons.get(idx).getPolygon().getBounds();
+ polygons.remove(idx);
+ }
+ }
+ break;
+
+ case AddPoint: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
+ if (polygon.npoints < settings.getMaxPoints()) {
+ polygon.addPoint(0, 0);
+ int insPos = r.nextInt(polygon.npoints);
+ int lastPt = ((insPos + polygon.npoints) - 1) % polygon.npoints;
+ int maxMovement = settings.getMaxPtMovement();
+ int maxX = Math.max(maxMovement, Math.abs(polygon.xpoints[lastPt] - polygon.xpoints[insPos]));
+ int maxY = Math.max(maxMovement, Math.abs(polygon.ypoints[lastPt] - polygon.ypoints[insPos]));
+
+ int x = r.nextInt(maxX) + Math.min(polygon.xpoints[lastPt], polygon.xpoints[insPos]);
+ int y = r.nextInt(maxY) + Math.min(polygon.ypoints[lastPt], polygon.ypoints[insPos]);
+
+ int numCopyPts = polygon.npoints - insPos - 1;
+ System.arraycopy(polygon.xpoints, insPos, polygon.xpoints, insPos + 1, numCopyPts);
+ polygon.xpoints[insPos] = x;
+ System.arraycopy(polygon.ypoints, insPos, polygon.ypoints, insPos + 1, numCopyPts);
+ polygon.ypoints[insPos] = y;
polygon.invalidate();
changedArea.union(polygon.getBounds());
- polygons.set(idx, pd);
- } else {
- randomCompleteChange();
- type = ImprovementType.CompleteChange;
- typeWasSuccessful(ImprovementType.RemovePoint, false);
- }
- }
- break;
-
- case MovePoint: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
- Polygon polygon = pd.getPolygon();
- changedArea = polygon.getBounds();
- int movePos = r.nextInt(polygon.npoints);
- int maxMovement = settings.getMaxPtMovement();
- int dblMax = maxMovement << 1;
- int moveX = r.nextInt(dblMax) - maxMovement;
- int moveY = r.nextInt(dblMax) - maxMovement;
- polygon.xpoints[movePos] += moveX;
- polygon.ypoints[movePos] += moveY;
- clipToRange(0, imageSize.width, polygon.xpoints[movePos]);
- clipToRange(0, imageSize.height, polygon.ypoints[movePos]);
+ polygons.set(idx, pd);
+
+ } else {
+ randomCompleteChange();
+ type = ImprovementType.CompleteChange;
+ typeWasSuccessful(ImprovementType.AddPoint, false);
+ }
+ }
+ break;
+
+ case RemovePoint: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
+ if (polygon.npoints > 3) {
+ int delPos = r.nextInt(polygon.npoints);
+
+ int numPtCopy = polygon.npoints - delPos - 1;
+ System.arraycopy(polygon.xpoints, delPos+1, polygon.xpoints, delPos, numPtCopy);
+ System.arraycopy(polygon.ypoints, delPos+1, polygon.ypoints, delPos, numPtCopy);
+ polygon.npoints--;
+ polygon.invalidate();
+ changedArea.union(polygon.getBounds());
+ polygons.set(idx, pd);
+ } else {
+ randomCompleteChange();
+ type = ImprovementType.CompleteChange;
+ typeWasSuccessful(ImprovementType.RemovePoint, false);
+ }
+ }
+ break;
+
+ case MovePoint: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
+ int movePos = r.nextInt(polygon.npoints);
+ int maxMovement = settings.getMaxPtMovement();
+ int dblMax = maxMovement << 1;
+ int moveX = r.nextInt(dblMax) - maxMovement;
+ int moveY = r.nextInt(dblMax) - maxMovement;
+ polygon.xpoints[movePos] += moveX;
+ polygon.ypoints[movePos] += moveY;
+ clipToRange(0, imageSize.width, polygon.xpoints[movePos]);
+ clipToRange(0, imageSize.height, polygon.ypoints[movePos]);
polygon.invalidate();
- changedArea.union(polygon.getBounds());
- polygons.set(idx, pd);
- }
- break;
-
- case RectifyPoint: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
- Polygon polygon = pd.getPolygon();
- changedArea = polygon.getBounds();
- int rectifyPos = r.nextInt(polygon.npoints);
- int targetPos = (rectifyPos == 0) ? polygon.npoints - 1 : (rectifyPos - 1);
-
- if (Math.abs(polygon.xpoints[rectifyPos] - polygon.xpoints[targetPos]) <
- Math.abs(polygon.ypoints[rectifyPos] - polygon.ypoints[targetPos])) {
- polygon.xpoints[rectifyPos] = polygon.xpoints[targetPos];
- } else {
- polygon.ypoints[rectifyPos] = polygon.ypoints[targetPos];
- }
+ changedArea.union(polygon.getBounds());
+ polygons.set(idx, pd);
+ }
+ break;
+
+ case RectifyPoint: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
+ int rectifyPos = r.nextInt(polygon.npoints);
+ int targetPos = (rectifyPos == 0) ? polygon.npoints - 1 : (rectifyPos - 1);
+
+ if (Math.abs(polygon.xpoints[rectifyPos] - polygon.xpoints[targetPos]) <
+ Math.abs(polygon.ypoints[rectifyPos] - polygon.ypoints[targetPos])) {
+ polygon.xpoints[rectifyPos] = polygon.xpoints[targetPos];
+ } else {
+ polygon.ypoints[rectifyPos] = polygon.ypoints[targetPos];
+ }
polygon.invalidate();
- changedArea.union(polygon.getBounds());
- polygons.set(idx, pd);
- }
- break;
-
- case ReorderPoly: {
- if (polygons.size() > 2) {
- PolygonData pd = polygons.remove(r.nextInt(polygons.size()));
- changedArea = pd.getPolygon().getBounds();
- polygons.add(r.nextInt(polygons.size()), pd);
- } else {
- randomCompleteChange();
- type = ImprovementType.CompleteChange;
- typeWasSuccessful(ImprovementType.ReorderPoly, false);
- }
- }
- break;
-
- case ShrinkPoly: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
- Polygon polygon = pd.getPolygon();
- changedArea = polygon.getBounds();
- Rectangle bbox = polygon.getBounds();
-
- double midX = bbox.getCenterX();
- double midY = bbox.getCenterY();
-
- int shrinkFactor = r.nextInt(settings.getMaxPtMovement());
- for (int i = 0; i < polygon.npoints; i++) {
- polygon.xpoints[i] += (polygon.xpoints[i] < midX) ? shrinkFactor : -shrinkFactor;
- polygon.ypoints[i] += (polygon.ypoints[i] < midY) ? shrinkFactor : -shrinkFactor;
- }
+ changedArea.union(polygon.getBounds());
+ polygons.set(idx, pd);
+ }
+ break;
+
+ case ReorderPoly: {
+ if (polygons.size() > 2) {
+ PolygonData pd = polygons.remove(r.nextInt(polygons.size()));
+ changedArea = pd.getPolygon().getBounds();
+ polygons.add(r.nextInt(polygons.size()), pd);
+ } else {
+ randomCompleteChange();
+ type = ImprovementType.CompleteChange;
+ typeWasSuccessful(ImprovementType.ReorderPoly, false);
+ }
+ }
+ break;
+
+ case ShrinkPoly: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
+ Rectangle bbox = polygon.getBounds();
+
+ double midX = bbox.getCenterX();
+ double midY = bbox.getCenterY();
+
+ int shrinkFactor = r.nextInt(settings.getMaxPtMovement());
+ for (int i = 0; i < polygon.npoints; i++) {
+ polygon.xpoints[i] += (polygon.xpoints[i] < midX) ? shrinkFactor : -shrinkFactor;
+ polygon.ypoints[i] += (polygon.ypoints[i] < midY) ? shrinkFactor : -shrinkFactor;
+ }
polygon.invalidate();
- changedArea.union(polygon.getBounds());
- polygons.set(idx, pd);
- }
- break;
-
- case EnlargePoly: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
- Polygon polygon = pd.getPolygon();
- changedArea = polygon.getBounds();
- Rectangle bbox = polygon.getBounds();
- double midX = bbox.getCenterX();
- double midY = bbox.getCenterY();
-
- int expandFactor = r.nextInt(settings.getMaxPtMovement());
- for (int i = 0; i < polygon.npoints; i++) {
- polygon.xpoints[i] += (polygon.xpoints[i] < midX) ? -expandFactor : expandFactor;
- polygon.ypoints[i] += (polygon.ypoints[i] < midY) ? -expandFactor : expandFactor;
- polygon.xpoints[i] = clipToRange(0, imageSize.width, polygon.xpoints[i]);
- polygon.ypoints[i] = clipToRange(0, imageSize.height, polygon.ypoints[i]);
- }
+ changedArea.union(polygon.getBounds());
+ polygons.set(idx, pd);
+ }
+ break;
+
+ case EnlargePoly: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
+ Rectangle bbox = polygon.getBounds();
+ double midX = bbox.getCenterX();
+ double midY = bbox.getCenterY();
+
+ int expandFactor = r.nextInt(settings.getMaxPtMovement());
+ for (int i = 0; i < polygon.npoints; i++) {
+ polygon.xpoints[i] += (polygon.xpoints[i] < midX) ? -expandFactor : expandFactor;
+ polygon.ypoints[i] += (polygon.ypoints[i] < midY) ? -expandFactor : expandFactor;
+ polygon.xpoints[i] = clipToRange(0, imageSize.width, polygon.xpoints[i]);
+ polygon.ypoints[i] = clipToRange(0, imageSize.height, polygon.ypoints[i]);
+ }
polygon.invalidate();
- changedArea.union(polygon.getBounds());
- polygons.set(idx, pd);
- }
- break;
-
- case ShiftPoly: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
- Polygon polygon = pd.getPolygon();
- changedArea = polygon.getBounds();
- int maxMovement = settings.getMaxPtMovement();
- int dblMax = maxMovement << 1;
- int shiftX = r.nextInt(dblMax) + maxMovement;
- int shiftY = r.nextInt(dblMax) + maxMovement;
- for (int i = 0; i < polygon.npoints; i++) {
- polygon.xpoints[i] += shiftX;
- polygon.ypoints[i] += shiftY;
- polygon.xpoints[i] = clipToRange(0, imageSize.width, polygon.xpoints[i]);
- polygon.ypoints[i] = clipToRange(0, imageSize.height, polygon.ypoints[i]);
- }
+ changedArea.union(polygon.getBounds());
+ polygons.set(idx, pd);
+ }
+ break;
+
+ case ShiftPoly: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
+ int maxMovement = settings.getMaxPtMovement();
+ int dblMax = maxMovement << 1;
+ int shiftX = r.nextInt(dblMax) + maxMovement;
+ int shiftY = r.nextInt(dblMax) + maxMovement;
+ for (int i = 0; i < polygon.npoints; i++) {
+ polygon.xpoints[i] += shiftX;
+ polygon.ypoints[i] += shiftY;
+ polygon.xpoints[i] = clipToRange(0, imageSize.width, polygon.xpoints[i]);
+ polygon.ypoints[i] = clipToRange(0, imageSize.height, polygon.ypoints[i]);
+ }
polygon.invalidate();
- changedArea.union(polygon.getBounds());
- polygons.set(idx, pd);
- }
- break;
-
- case ChangeColor: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
- changedArea = pd.getPolygon().getBounds();
- Color color = pd.getColor();
- int comp = r.nextInt(3);
- int maxChange = settings.getMaxColorChange();
- int dblChange = maxChange << 1;
- switch (comp) {
- case 0: {
- int newColor = color.getRed() + (r.nextInt(dblChange) - maxChange);
- newColor = clipToRange(0, 255, newColor);
- pd.setColor(new Color(newColor, color.getGreen(), color.getBlue()));
- }
- break;
-
- case 1: {
- int newColor = color.getGreen() + (r.nextInt(dblChange) - maxChange);
- newColor = clipToRange(0, 255, newColor);
- pd.setColor(new Color(color.getRed(), newColor, color.getBlue()));
- }
- break;
-
- case 2: {
- int newColor = color.getBlue() + (r.nextInt(dblChange) - maxChange);
- newColor = clipToRange(0, 255, newColor);
- pd.setColor(new Color(color.getRed(), color.getGreen(), newColor));
- }
- break;
- }
- polygons.set(idx, pd);
- }
- break;
-
- case White: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
- changedArea = pd.getPolygon().getBounds();
- pd.setColor(Color.WHITE);
- pd.setAlpha(1);
- polygons.set(idx, pd);
- }
- break;
-
- case Black: {
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ changedArea.union(polygon.getBounds());
+ polygons.set(idx, pd);
+ }
+ break;
+
+ case ChangeColor: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
changedArea = pd.getPolygon().getBounds();
- pd.setColor(Color.BLACK);
- pd.setAlpha(1);
- polygons.set(idx, pd);
- }
- break;
-
- case ChangeAlpha:
- int idx = r.nextInt(polygons.size());
- PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ Color color = pd.getColor();
+ int comp = r.nextInt(3);
+ int maxChange = settings.getMaxColorChange();
+ int dblChange = maxChange << 1;
+ switch (comp) {
+ case 0: {
+ int newColor = color.getRed() + (r.nextInt(dblChange) - maxChange);
+ newColor = clipToRange(0, 255, newColor);
+ pd.setColor(new Color(newColor, color.getGreen(), color.getBlue()));
+ }
+ break;
+
+ case 1: {
+ int newColor = color.getGreen() + (r.nextInt(dblChange) - maxChange);
+ newColor = clipToRange(0, 255, newColor);
+ pd.setColor(new Color(color.getRed(), newColor, color.getBlue()));
+ }
+ break;
+
+ case 2: {
+ int newColor = color.getBlue() + (r.nextInt(dblChange) - maxChange);
+ newColor = clipToRange(0, 255, newColor);
+ pd.setColor(new Color(color.getRed(), color.getGreen(), newColor));
+ }
+ break;
+ }
+ polygons.set(idx, pd);
+ }
+ break;
+
+ case White: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
changedArea = pd.getPolygon().getBounds();
- pd.setAlpha(r.nextFloat());
- polygons.set(idx, pd);
- break;
-
- case Breed: {
- GenerationMember copyMember = generationHandler.getRandomMember(false);
- if ((copyMember == null) || (copyMember.getData().length == 0)) {
- randomCompleteChange();
- } else {
- PolygonData[] copyData = copyMember.getData();
- idx = r.nextInt(copyData.length);
- if (idx >= polygons.size()) {
- polygons.add(copyData[idx]);
- changedArea = copyData[idx].getPolygon().getBounds();
- } else {
- changedArea = polygons.get(idx).getPolygon().getBounds();
- polygons.set(idx, copyData[idx]);
- changedArea.union(polygons.get(idx).getPolygon().getBounds());
- }
- }
- }
- break;
-
- case BreedElite: {
- GenerationMember copyMember = generationHandler.getRandomMember(true);
- if ((copyMember == null) || (copyMember.getData().length == 0)) {
- randomCompleteChange();
- } else {
+ pd.setColor(Color.WHITE);
+ pd.setAlpha(1);
+ polygons.set(idx, pd);
+ }
+ break;
+
+ case Black: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ changedArea = pd.getPolygon().getBounds();
+ pd.setColor(Color.BLACK);
+ pd.setAlpha(1);
+ polygons.set(idx, pd);
+ }
+ break;
+
+ case ChangeAlpha:
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ changedArea = pd.getPolygon().getBounds();
+ pd.setAlpha(r.nextFloat());
+ polygons.set(idx, pd);
+ break;
+
+ case Breed: {
+ GenerationMember copyMember = generationHandler.getRandomMember(false);
+ if ((copyMember == null) || (copyMember.getData().length == 0)) {
+ randomCompleteChange();
+ } else {
PolygonData[] copyData = copyMember.getData();
- idx = r.nextInt(copyData.length);
- if (idx >= polygons.size()) {
- polygons.add(copyData[idx]);
- changedArea = copyData[idx].getPolygon().getBounds();
- } else {
- changedArea = polygons.get(idx).getPolygon().getBounds();
- polygons.set(idx, copyData[idx]);
- changedArea.union(polygons.get(idx).getPolygon().getBounds());
- }
- }
- }
- break;
-
- case CompleteChange: {
- randomCompleteChange();
- }
- break;
- }
-
- return type;
- }
-
- /**
- * returns the member image from which this generated image was created
- *
- * @return the parent generated image member
- */
- public GenerationMember getParentGenerationMember() {
- return changedMember;
- }
-
- /**
- * returns the area that was changed in this image
- *
- * @return the rectangular bounds that was changed, or null for a complete change
- */
- public Rectangle getChangedArea() {
- return changedArea;
- }
-
- /**
- * generates a random polygon change (all values)
- */
- private void randomCompleteChange() {
- int idx = r.nextInt(polygons.size());
- polygons.set(idx, PolygonData.randomPoly(imageSize, settings.getMaxPoints()));
- changedArea = null;
- }
-
- /**
- * clip a value between a min and max value
- *
- * @param min the min value
- * @param max the max value
- * @param value the value to clip
- *
- * @return the clipped value
- */
- private static int clipToRange(int min, int max, int value) {
- if (value < min)
- return min;
- else if (value > max)
- return max;
- return value;
- }
+ idx = r.nextInt(copyData.length);
+ if (idx >= polygons.size()) {
+ polygons.add(copyData[idx]);
+ changedArea = copyData[idx].getPolygon().getBounds();
+ } else {
+ changedArea = polygons.get(idx).getPolygon().getBounds();
+ polygons.set(idx, copyData[idx]);
+ changedArea.union(polygons.get(idx).getPolygon().getBounds());
+ }
+ }
+ }
+ break;
+ case BreedElite: {
+ GenerationMember copyMember = generationHandler.getRandomMember(true);
+ if ((copyMember == null) || (copyMember.getData().length == 0)) {
+ randomCompleteChange();
+ } else {
+ PolygonData[] copyData = copyMember.getData();
+ idx = r.nextInt(copyData.length);
+ if (idx >= polygons.size()) {
+ polygons.add(copyData[idx]);
+ changedArea = copyData[idx].getPolygon().getBounds();
+ } else {
+ changedArea = polygons.get(idx).getPolygon().getBounds();
+ polygons.set(idx, copyData[idx]);
+ changedArea.union(polygons.get(idx).getPolygon().getBounds());
+ }
+ }
+ }
+ break;
+
+ case CompleteChange: {
+ randomCompleteChange();
+ }
+ break;
+ }
+
+ return type;
+ }
+
+ /**
+ * returns the member image from which this generated image was created
+ *
+ * @return the parent generated image member
+ */
+ public GenerationMember getParentGenerationMember() {
+ return changedMember;
+ }
+
+ /**
+ * returns the area that was changed in this image
+ *
+ * @return the rectangular bounds that was changed, or null for a complete change
+ */
+ public Rectangle getChangedArea() {
+ return changedArea;
+ }
+
+ /**
+ * generates a random polygon change (all values)
+ */
+ private void randomCompleteChange() {
+ int idx = r.nextInt(polygons.size());
+ changedArea = polygons.get(idx).getPolygon().getBounds();
+ PolygonData randomPoly = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
+ changedArea.union(randomPoly.getPolygon().getBounds());
+ polygons.set(idx, randomPoly);
+ }
+
+ /**
+ * clip a value between a min and max value
+ *
+ * @param min the min value
+ * @param max the max value
+ * @param value the value to clip
+ *
+ * @return the clipped value
+ */
+ private static int clipToRange(int min, int max, int value) {
+ if (value < min) {
+ return min;
+ } else if (value > max) {
+ ...
[truncated message content] |
|
From: <dbr...@us...> - 2011-08-03 06:00:45
|
Revision: 243
http://polycasso.svn.sourceforge.net/polycasso/?rev=243&view=rev
Author: dbrosius
Date: 2011-08-03 06:00:34 +0000 (Wed, 03 Aug 2011)
Log Message:
-----------
add support for proxies
Modified Paths:
--------------
trunk/polycasso/.classpath
trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Added Paths:
-----------
trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java
trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultScore.java
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ProxyDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Score.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SwingUtils.java
Modified: trunk/polycasso/.classpath
===================================================================
--- trunk/polycasso/.classpath 2011-07-29 03:36:02 UTC (rev 242)
+++ trunk/polycasso/.classpath 2011-08-03 06:00:34 UTC (rev 243)
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/commons-io-1.4.jar"/>
<classpathentry kind="lib" path="lib/forms-1.2.1.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="classes"/>
</classpath>
Copied: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java (from rev 238, trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java)
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -0,0 +1,140 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
+ * Inspired by work by Roger Alsing
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.mebigfatguy.polycasso;
+
+import java.awt.Rectangle;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBufferByte;
+import java.awt.image.WritableRaster;
+
+/**
+ * an immutable class for processing a test image against target image for closeness.
+ */
+public class DefaultFeedback implements Feedback {
+
+ private byte[] targetBuffer;
+ private int width, height;
+
+ /**
+ * creates a feedback object with a given targetImage. Caches the image bytes in
+ * member variables.
+ */
+ public DefaultFeedback() {
+ }
+
+ /**
+ * caches information about the target image
+ *
+ * @param targetImage the target image that will be the judge of test images
+ */
+ @Override
+ public void setTargetImage(BufferedImage targetImage) {
+ WritableRaster raster = targetImage.getRaster();
+ width = targetImage.getWidth();
+ height = targetImage.getHeight();
+ DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
+ targetBuffer = dbb.getData();
+ }
+
+ /**
+ * returns a score of how close the test image is to the target
+ * which is the square of the error to the target image
+ *
+ * @param testImage the image to score
+ * @param previousScore the score of the generated image from which this image was created
+ * @param changedArea the area of changed between the parent generated image and this one
+ *
+ * @return a score that represents its closeness to ideal
+ */
+ @Override
+ public Score calculateScore(BufferedImage testImage, Score previousScore, Rectangle changedArea) {
+
+ DefaultScore score = (previousScore != null) ? (DefaultScore)previousScore.clone() : new DefaultScore();
+
+ WritableRaster raster = testImage.getRaster();
+ DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
+ byte[] testBuffer = dbb.getData();
+
+ boolean needAutoRecalc = (previousScore == null) || (changedArea == null);
+ score.overallScore = 0L;
+
+ for (int y = 0; y < DefaultScore.NUM_DIVISIONS; y++) {
+ int gridHeight = (height / DefaultScore.NUM_DIVISIONS);
+ int gridTop = y * gridHeight;
+ int gridBottom;
+ if (y < (DefaultScore.NUM_DIVISIONS - 1)) {
+ gridBottom = gridTop + gridHeight;
+ } else {
+ gridBottom = height;
+ }
+
+ if (needAutoRecalc || ((changedArea.y <= gridBottom) && ((changedArea.y + changedArea.height) >= gridTop))) {
+ for (int x = 0; x < DefaultScore.NUM_DIVISIONS; x++) {
+ int gridWidth = (width / DefaultScore.NUM_DIVISIONS);
+ int gridLeft = x * gridWidth;
+ int gridRight;
+ if (x < (DefaultScore.NUM_DIVISIONS - 1)) {
+ gridRight = gridLeft + gridWidth;
+ } else {
+ gridRight = width;
+ }
+
+ if (needAutoRecalc || ((changedArea.x <= gridRight) && ((changedArea.x + changedArea.width) >= gridLeft))) {
+
+ long gridError = 0L;
+ for (int gy = gridTop; gy < gridBottom; gy++) {
+ int pixelStart = (gy * width * 4) + (gridLeft * 4);
+ int pixelEnd = pixelStart + (gridRight - gridLeft) * 4;
+
+ //index 0 is alpha, start at 1 (blue)
+ for (int i = pixelStart + 1; i < pixelEnd; i++) {
+ int blue1 = targetBuffer[i] & 0x0FF;
+ int blue2 = testBuffer[i++] & 0x0FF;
+ long blueError = blue1 - blue2;
+ blueError *= blueError;
+
+ int green1 = targetBuffer[i] & 0x0FF;
+ int green2 = testBuffer[i++] & 0x0FF;
+ long greenError = green1 - green2;
+ greenError *= greenError;
+
+ int red1 = targetBuffer[i] & 0x0FF;
+ int red2 = testBuffer[i++] & 0x0FF;
+ long redError = red1 - red2;
+ redError *= redError;
+
+ gridError += redError + greenError + blueError;
+ }
+ }
+ score.gridScores[x][y] = gridError;
+ score.overallScore += gridError;
+ } else {
+ score.overallScore += score.gridScores[x][y];
+ }
+ }
+ } else {
+ for (int x = 0; x < DefaultScore.NUM_DIVISIONS; x++) {
+ score.overallScore += score.gridScores[x][y];
+ }
+ }
+ }
+
+ return score;
+ }
+}
\ No newline at end of file
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultFeedback.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mimetype
+ text/plain
Added: svn:eol-style
+ native
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java 2011-07-29 03:36:02 UTC (rev 242)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -4,17 +4,17 @@
* Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and limitations
- * under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
*/
package com.mebigfatguy.polycasso;
@@ -33,240 +33,253 @@
/**
* class that generates test images iteratively looking for the best image that matches a target.
- * The images are generated from semi-transparent polygons that are improved upon over time.
+ * The images are generated from semi-transparent polygons that are improved upon over time.
* This class generates multiple images in parallel to keep multicore processors busy.
*/
public class DefaultImageGenerator implements ImageGenerator, Runnable {
- private Set<ImageGeneratedListener> listeners = new HashSet<ImageGeneratedListener>();
- private Settings settings;
- private BufferedImage targetImage;
- private GenerationHandler generationHandler;
- private Dimension imageSize;
- private Feedback feedback;
- private Thread[] t = null;
- private Object startStopLock = new Object();
-
- /**
- * creates an ImageGenerator for the given target image, and size
- * @param confSettings the configuration settings
- * @param image the target image
- * @param size the dimension of the image
- */
- public DefaultImageGenerator(Settings confSettings, Image image, Dimension size) {
- settings = confSettings;
- imageSize = trimSize(size, settings.getMaxImageSize());
- targetImage = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
-
- Graphics g = targetImage.getGraphics();
- try {
- g.drawImage(image, 0, 0, imageSize.width, imageSize.height, Color.WHITE, null);
- generationHandler = new GenerationHandler(settings, imageSize);
- feedback = new Feedback(targetImage);
- } finally {
- g.dispose();
- }
- }
-
- /**
- * retrieves the scaled target iamge
- *
- * @return the target image
- */
- public BufferedImage getTargetImage() {
- return targetImage;
- }
-
- /**
- * returns the image size that is being generated. This size might be different the original image
- * if the size is bigger then the max setting.
- *
- * @return the image size
- */
- public Dimension getImageSize() {
- return imageSize;
- }
-
- /**
- * allows interested parties to register to receive events when a new best image has been
- * found.
- *
- * @param listener the listener that is interested in events
- */
- public void addImageGeneratedListener(ImageGeneratedListener listener) {
- listeners.add(listener);
- }
-
- /**
- * allows uninterested parties to unregister to receive events when a new best image is
- * found
- *
- * @param listener the listener that is no longer needed
- */
- public void removeImageGeneratedListener(ImageGeneratedListener listener) {
- listeners.remove(listener);
- }
-
- /**
- * informs all listeners that a new best image has been found
- *
- * @param image the new best image
- */
- public void fireImageGenerated(Image image) {
- ImageGeneratedEvent event = new ImageGeneratedEvent(this, image);
- for (ImageGeneratedListener listener : listeners) {
- listener.imageGenerated(event);
- }
- }
-
- /**
- * starts up threads to start looking for images that are closest to the target
- */
- public void startGenerating() {
- synchronized(startStopLock) {
- if (t == null) {
-
- populateGenerationZeroElite();
- t = new Thread[Runtime.getRuntime().availableProcessors() + 1];
- for (int i = 0; i < t.length; i++) {
- t[i] = new Thread(this);
- t[i].setName("Improver : " + i);
- t[i].start();
- }
- }
- }
- }
-
- /**
- * shuts down threads that were looking for images
- */
- public void stopGenerating() {
- synchronized(startStopLock) {
- if (t != null) {
- try {
- for (int i = 0; i < t.length; i++) {
- t[i].interrupt();
- }
- for (int i = 0; i < t.length; i++) {
- t[i].join();
- }
- } catch (InterruptedException ie) {
- } finally {
- t = null;
- }
- }
- }
- }
-
- /**
- * completes the image by transforming the polygon image to the real image
- */
- public void complete() {
- synchronized(startStopLock) {
- if (t != null) {
- stopGenerating();
- t = new Thread[1];
- t[0] = new Thread(new ImageCompleter(this, targetImage, generationHandler.getBestMember().data, imageSize));
- t[0].start();
- }
- }
- }
-
- /**
- * retrieves the best set of polygons for drawing the image so far
- *
- * @return the best set of polygons
- */
- public PolygonData[] getBestData() {
- return generationHandler.getBestMember().data;
- }
- /**
- * the runnable interface implementation to repeatedly improve upon the image and check to
- * see if it is closer to the target image. Images are created in batches of settings.numCompetingImages
- * and the best one (if better than the parent) is selected as the new best.
- */
- public void run() {
- try {
- BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
- Graphics2D g2d = (Graphics2D)image.getGraphics();
- try {
- Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
- Improver improver = new Improver(settings, generationHandler, imageSize);
-
- while (!Thread.interrupted()) {
- ImprovementType type = improver.improveRandomly();
-
- List<PolygonData> data = improver.getData();
- imagePolygonData(g2d, data, srcOpaque);
-
- long delta = feedback.calculateDelta(image);
-
- boolean wasSuccessful;
-
- ImprovementResult result = generationHandler.addPolygonData(delta, data.toArray(new PolygonData[data.size()]));
- switch (result) {
- case BEST:
- fireImageGenerated(image);
- wasSuccessful = true;
- image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
- g2d.dispose();
- g2d = (Graphics2D)image.getGraphics();
- break;
-
- case ELITE:
- wasSuccessful = true;
- break;
-
- default:
- wasSuccessful = false;
- }
-
- improver.typeWasSuccessful(type, wasSuccessful);
- }
- } finally {
- g2d.dispose();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void imagePolygonData(Graphics2D g2d, List<PolygonData> polygonData, Composite srcOpaque) {
- g2d.setColor(Color.BLACK);
+ private final Set<ImageGeneratedListener> listeners = new HashSet<ImageGeneratedListener>();
+ private final Settings settings;
+ private final BufferedImage targetImage;
+ private GenerationHandler generationHandler;
+ private final Dimension imageSize;
+ private Feedback feedback;
+ private Thread[] t = null;
+ private final Object startStopLock = new Object();
+
+ /**
+ * creates an ImageGenerator for the given target image, and size
+ * @param confSettings the configuration settings
+ * @param image the target image
+ * @param size the dimension of the image
+ */
+ public DefaultImageGenerator(Settings confSettings, Image image, Dimension size) {
+ settings = confSettings;
+ imageSize = trimSize(size, settings.getMaxImageSize());
+ targetImage = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+
+ Graphics g = targetImage.getGraphics();
+ try {
+ g.drawImage(image, 0, 0, imageSize.width, imageSize.height, Color.WHITE, null);
+ generationHandler = new GenerationHandler(settings, imageSize);
+ feedback = new DefaultFeedback();
+ feedback.setTargetImage(targetImage);
+ } finally {
+ g.dispose();
+ }
+ }
+
+ /**
+ * retrieves the scaled target iamge
+ *
+ * @return the target image
+ */
+ @Override
+ public BufferedImage getTargetImage() {
+ return targetImage;
+ }
+
+ /**
+ * returns the image size that is being generated. This size might be different the original image
+ * if the size is bigger then the max setting.
+ *
+ * @return the image size
+ */
+ @Override
+ public Dimension getImageSize() {
+ return imageSize;
+ }
+
+ /**
+ * allows interested parties to register to receive events when a new best image has been
+ * found.
+ *
+ * @param listener the listener that is interested in events
+ */
+ @Override
+ public void addImageGeneratedListener(ImageGeneratedListener listener) {
+ listeners.add(listener);
+ }
+
+ /**
+ * allows uninterested parties to unregister to receive events when a new best image is
+ * found
+ *
+ * @param listener the listener that is no longer needed
+ */
+ @Override
+ public void removeImageGeneratedListener(ImageGeneratedListener listener) {
+ listeners.remove(listener);
+ }
+
+ /**
+ * informs all listeners that a new best image has been found
+ *
+ * @param image the new best image
+ */
+ @Override
+ public void fireImageGenerated(Image image) {
+ ImageGeneratedEvent event = new ImageGeneratedEvent(this, image);
+ for (ImageGeneratedListener listener : listeners) {
+ listener.imageGenerated(event);
+ }
+ }
+
+ /**
+ * starts up threads to start looking for images that are closest to the target
+ */
+ @Override
+ public void startGenerating() {
+ synchronized(startStopLock) {
+ if (t == null) {
+
+ populateGenerationZeroElite();
+ t = new Thread[Runtime.getRuntime().availableProcessors() + 1];
+ for (int i = 0; i < t.length; i++) {
+ t[i] = new Thread(this);
+ t[i].setName("Improver : " + i);
+ t[i].start();
+ }
+ }
+ }
+ }
+
+ /**
+ * shuts down threads that were looking for images
+ */
+ @Override
+ public void stopGenerating() {
+ synchronized(startStopLock) {
+ if (t != null) {
+ try {
+ for (Thread element : t) {
+ element.interrupt();
+ }
+ for (Thread element : t) {
+ element.join();
+ }
+ } catch (InterruptedException ie) {
+ } finally {
+ t = null;
+ }
+ }
+ }
+ }
+
+ /**
+ * completes the image by transforming the polygon image to the real image
+ */
+ @Override
+ public void complete() {
+ synchronized(startStopLock) {
+ if (t != null) {
+ stopGenerating();
+ t = new Thread[1];
+ t[0] = new Thread(new ImageCompleter(this, targetImage, generationHandler.getBestMember().getData(), imageSize));
+ t[0].start();
+ }
+ }
+ }
+
+ /**
+ * retrieves the best set of polygons for drawing the image so far
+ *
+ * @return the best set of polygons
+ */
+ @Override
+ public PolygonData[] getBestData() {
+ return generationHandler.getBestMember().getData();
+ }
+ /**
+ * the runnable interface implementation to repeatedly improve upon the image and check to
+ * see if it is closer to the target image. Images are created in batches of settings.numCompetingImages
+ * and the best one (if better than the parent) is selected as the new best.
+ */
+ @Override
+ public void run() {
+ try {
+ BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+ Graphics2D g2d = (Graphics2D)image.getGraphics();
+ try {
+ Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
+ Improver improver = new Improver(settings, generationHandler, imageSize);
+
+ while (!Thread.interrupted()) {
+ ImprovementType type = improver.improveRandomly();
+
+ List<PolygonData> data = improver.getData();
+ imagePolygonData(g2d, data, srcOpaque);
+
+ GenerationMember parentMember = improver.getParentGenerationMember();
+ Score delta = feedback.calculateScore(image, (parentMember != null) ? parentMember.getScore() : null, improver.getChangedArea());
+
+ boolean wasSuccessful;
+
+ ImprovementResult result = generationHandler.addPolygonData(delta, data.toArray(new PolygonData[data.size()]));
+ switch (result) {
+ case BEST:
+ fireImageGenerated(image);
+ wasSuccessful = true;
+ image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+ g2d.dispose();
+ g2d = (Graphics2D)image.getGraphics();
+ break;
+
+ case ELITE:
+ wasSuccessful = true;
+ break;
+
+ default:
+ wasSuccessful = false;
+ }
+
+ improver.typeWasSuccessful(type, wasSuccessful);
+ }
+ } finally {
+ g2d.dispose();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void imagePolygonData(Graphics2D g2d, List<PolygonData> polygonData, Composite srcOpaque) {
+ g2d.setColor(Color.BLACK);
g2d.setComposite(srcOpaque);
g2d.fillRect(0, 0, imageSize.width, imageSize.height);
-
+
for (PolygonData pd : polygonData) {
pd.draw(g2d);
}
- }
-
- private void populateGenerationZeroElite() {
+ }
+
+ private void populateGenerationZeroElite() {
Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
- for (int i = 0; i < settings.getEliteSize(); i++) {
- BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
- List<PolygonData> polygons = new ArrayList<PolygonData>();
- PolygonData pd = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
- polygons.add(pd);
- Graphics2D g2d = (Graphics2D)image.getGraphics();
- try {
+ for (int i = 0; i < settings.getEliteSize(); i++) {
+ BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+ List<PolygonData> polygons = new ArrayList<PolygonData>();
+ PolygonData pd = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
+ polygons.add(pd);
+ Graphics2D g2d = (Graphics2D)image.getGraphics();
+ try {
imagePolygonData(g2d, polygons, srcOpaque);
- long delta = feedback.calculateDelta(image);
+ Score delta = feedback.calculateScore(image, null, null);
generationHandler.addPolygonData(delta, polygons.toArray(new PolygonData[polygons.size()]));
- } finally {
- g2d.dispose();
- }
- }
- }
-
- private Dimension trimSize(Dimension origSize, Dimension maxSize) {
- if ((origSize.width < maxSize.width) && (origSize.height < maxSize.height))
- return origSize;
-
- double hFrac = (double)maxSize.width / (double)origSize.width;
- double vFrac = (double)maxSize.height/ (double)origSize.height;
-
- double frac = (hFrac < vFrac) ? hFrac : vFrac;
-
- return new Dimension((int)(frac * origSize.width), (int)(frac * origSize.height));
- }
+ } finally {
+ g2d.dispose();
+ }
+ }
+ }
+
+ private Dimension trimSize(Dimension origSize, Dimension maxSize) {
+ if ((origSize.width < maxSize.width) && (origSize.height < maxSize.height)) {
+ return origSize;
+ }
+
+ double hFrac = (double)maxSize.width / (double)origSize.width;
+ double vFrac = (double)maxSize.height/ (double)origSize.height;
+
+ double frac = (hFrac < vFrac) ? hFrac : vFrac;
+
+ return new Dimension((int)(frac * origSize.width), (int)(frac * origSize.height));
+ }
}
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultScore.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultScore.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultScore.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -0,0 +1,112 @@
+package com.mebigfatguy.polycasso;
+
+/**
+ * a default implementation of a score for the error in a image against a target image
+ * this score maintains a grid of scores representing scores in sections of the image, and
+ * then rolls up these scores to an overall score
+ */
+public class DefaultScore implements Score {
+
+ static final int NUM_DIVISIONS = 4;
+
+ /**
+ * a worst case score
+ */
+ public static final DefaultScore MAX_SCORE = new DefaultScore(Long.MAX_VALUE);
+
+ long gridScores[][] = new long[NUM_DIVISIONS][NUM_DIVISIONS];
+ long overallScore;
+
+ /**
+ * constructs an empty score
+ */
+ public DefaultScore() {
+ overallScore = 0;
+ }
+
+ /**
+ * constructs a score with the specified delta, spreads the score across all grids
+ *
+ * @param delta the delta score
+ */
+ public DefaultScore(long delta) {
+ overallScore = delta;
+
+ long divider = NUM_DIVISIONS * NUM_DIVISIONS;
+ long gridScore = overallScore / divider;
+
+ for (int y = 0; y < NUM_DIVISIONS; y++) {
+ for (int x = 0; x < NUM_DIVISIONS; x++) {
+ gridScores[x][y] = gridScore;
+ }
+ }
+ }
+
+ /**
+ * returns the sum of the square of pixel errors
+ * @return the delta between a generate image and the target
+ */
+ @Override
+ public long getDelta() {
+ return overallScore;
+ }
+
+ /**
+ * compares this core to another
+ *
+ * @param o the score to compare to
+ * @return whether the two scores have the same delta
+ */
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof DefaultScore)) {
+ return false;
+ }
+
+ return getDelta() == ((DefaultScore) o).getDelta();
+ }
+
+ /**
+ * clones this object
+ *
+ * @return a clone
+ */
+ @Override
+ public Object clone() {
+ DefaultScore clonedScore;
+
+ try {
+ clonedScore = (DefaultScore) super.clone();
+ } catch (CloneNotSupportedException cnse) {
+ clonedScore = new DefaultScore();
+ clonedScore.overallScore = overallScore;
+ }
+
+ clonedScore.gridScores = new long[NUM_DIVISIONS][NUM_DIVISIONS];
+ for (int i = 0; i < NUM_DIVISIONS; i++) {
+ System.arraycopy(gridScores[i], 0, clonedScore.gridScores[i], 0, NUM_DIVISIONS);
+ }
+
+ return clonedScore;
+ }
+
+ /**
+ * generates a hash code for this score
+ *
+ * @return the hash code of this score
+ */
+ @Override
+ public int hashCode() {
+ return (int) overallScore;
+ }
+
+ /**
+ * returns a string representation of the score
+ *
+ * @return the score as a string
+ */
+ @Override
+ public String toString() {
+ return String.valueOf(overallScore);
+ }
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultScore.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mimetype
+ text/plain
Added: svn:eol-style
+ native
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java 2011-07-29 03:36:02 UTC (rev 242)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -18,65 +18,29 @@
*/
package com.mebigfatguy.polycasso;
+import java.awt.Rectangle;
import java.awt.image.BufferedImage;
-import java.awt.image.DataBufferByte;
-import java.awt.image.WritableRaster;
/**
- * an immutable class for processing a test image against target image for closeness.
+ * an immutable calculater of a generated images score compared to a target image
*/
-public class Feedback {
+public interface Feedback {
- private byte[] targetBuffer;
- private int size;
-
- /**
- * creates a feedback object with a given targetImage. Caches the image bytes in
- * member variables.
- *
- * @param targetImage the target image that will be the judge of test images
- */
- public Feedback(BufferedImage targetImage) {
- WritableRaster raster = targetImage.getRaster();
- DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
- targetBuffer = dbb.getData();
- size = dbb.getSize();
- }
-
- /**
- * returns a score of how close the test image is to the target
- * which is the square of the error to the target image
- *
- * @param testImage the image to score
- * @return a value that represents its closeness to ideal
- */
- public long calculateDelta(BufferedImage testImage) {
- WritableRaster raster = testImage.getRaster();
- DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
- byte[] testBuffer = dbb.getData();
-
- long error = 0L;
-
- //index 0 is alpha, start at 1 (blue)
- for (int i = 1; i < size; i++) {
- int blue1 = targetBuffer[i] & 0x0FF;
- int blue2 = testBuffer[i++] & 0x0FF;
- long blueError = blue1 - blue2;
- blueError *= blueError;
-
- int green1 = targetBuffer[i] & 0x0FF;
- int green2 = testBuffer[i++] & 0x0FF;
- long greenError = green1 - green2;
- greenError *= greenError;
-
- int red1 = targetBuffer[i] & 0x0FF;
- int red2 = testBuffer[i++] & 0x0FF;
- long redError = red1 - red2;
- redError *= redError;
-
- error += redError + greenError + blueError;
- }
-
- return error;
- }
+ /**
+ * sets the target image to compare against
+ * @param targetImage the real target image
+ */
+ void setTargetImage(BufferedImage targetImage);
+
+ /**
+ * calculates the score of a generated image against a target image, as
+ * the sum of the square of the pixel error
+ *
+ * @param testImage the generated image to test
+ * @param sourceScore the score of the parent test image from which this test image was generated
+ * @param changedArea the area of changed between the parent generated image and this one
+ *
+ * @return the score of this generated image
+ */
+ Score calculateScore(BufferedImage testImage, Score sourceScore, Rectangle changedArea);
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-07-29 03:36:02 UTC (rev 242)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -19,8 +19,8 @@
package com.mebigfatguy.polycasso;
import java.awt.Dimension;
+import java.io.Serializable;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
@@ -28,56 +28,16 @@
/**
* class that maintains the set of polygon data for this generation of images
*/
-public class GenerationHandler {
+public class GenerationHandler implements Serializable {
- /**
- * class that holds a sample set of polygons and it's score
- */
- public static class Member implements Comparable<Member> {
-
- long score;
- PolygonData[] data;
-
- Member(long polyScore, PolygonData[] polyData) {
- score = polyScore;
- data = polyData;
- }
+ private static final long serialVersionUID = 2375492293685052783L;
- @Override
- public int compareTo(Member o) {
- if (score > o.score)
- return 1;
- else if (score < o.score)
- return -1;
-
- return data.length - o.data.length;
- }
-
- @Override
- public int hashCode() {
- return (int)score * 1000;
- }
-
- @Override
- public boolean equals(Object o) {
- if (o instanceof Member) {
- return score == ((Member)o).score;
- }
- return false;
- }
-
- @Override
- public String toString() {
- return "(" + score + ": " + Arrays.toString(data) + ")";
- }
- }
-
- private List<Member> generation;
+ private List<GenerationMember> generation;
private Random random;
private Settings settings;
private int generationNumber;
private double annealingValue;
- private Member bestMember;
+ private GenerationMember bestMember;
private double eliteCutOff;
private int generationBests;
private int generationElites;
@@ -92,9 +52,9 @@
random = new Random();
generationNumber = 0;
settings = confSettings;
- bestMember = new Member(Long.MAX_VALUE, new PolygonData[0]);
+ bestMember = new GenerationMember(DefaultScore.MAX_SCORE, new PolygonData[0]);
eliteCutOff = Long.MAX_VALUE;
- generation = new ArrayList<Member>(settings.getGenerationSize() + 10);
+ generation = new ArrayList<GenerationMember>(settings.getGenerationSize() + 10);
annealingValue = settings.getStartTemperature() * settings.getStartTemperature() * imageSize.height * imageSize.width;
generationBests = 0;
generationElites = 0;
@@ -109,20 +69,20 @@
*
* @return whether this is the best polygon set so far
*/
- public ImprovementResult addPolygonData(long score, PolygonData[] polygonData) {
+ public ImprovementResult addPolygonData(Score score, PolygonData[] polygonData) {
synchronized(generation) {
- Member newMember = new Member(score, polygonData);
+ GenerationMember newMember = new GenerationMember(score, polygonData);
generation.add(newMember);
if (generation.size() >= settings.getGenerationSize()) {
processGeneration();
} else {
Collections.sort(generation);
}
- if (score < bestMember.score) {
+ if (score.getDelta() < bestMember.getScore().getDelta()) {
bestMember = newMember;
generationBests++;
return ImprovementResult.BEST;
- } else if (score < eliteCutOff) {
+ } else if (score.getDelta() < eliteCutOff) {
generationElites++;
return ImprovementResult.ELITE;
}
@@ -132,25 +92,25 @@
}
/**
- * pick a random polygon sample either from the general pool or elite pool
- * skew the results towards the elite
- *
- * @param elite whether to pick from the elite pool or not
- * @return a random polygon set
- */
- public PolygonData[] getRandomPolygonData(boolean elite) {
- synchronized(generation) {
- int size = elite ? (settings.getEliteSize() % generation.size()) : generation.size();
+ * pick a random member either from the general pool or elite pool
+ * skew the results towards the elite
+ *
+ * @param elite whether to pick from the elite pool or not
+ * @return a random member
+ */
+ public GenerationMember getRandomMember(boolean elite) {
+ synchronized(generation) {
+ int size = elite ? (settings.getEliteSize() % generation.size()) : generation.size();
- if (size == 0)
- return null;
-
- int r = random.nextInt(size);
-
- int idx = (int)(r * ((double) r / (double) size));
-
- return generation.get(idx).data;
- }
+ if (size == 0)
+ return null;
+
+ int r = random.nextInt(size);
+
+ int idx = (int)(r * ((double) r / (double) size));
+
+ return generation.get(idx);
+ }
}
/**
@@ -158,7 +118,7 @@
*
* @return the best polygon set
*/
- public Member getBestMember() {
+ public GenerationMember getBestMember() {
synchronized(generation) {
return bestMember;
}
@@ -167,25 +127,28 @@
private void processGeneration() {
int eliteSize = settings.getEliteSize();
- Collections.<GenerationHandler.Member>sort(generation);
+ Collections.<GenerationMember>sort(generation);
int sz = generation.size();
- List<Member> nextGeneration = new ArrayList<Member>(settings.getGenerationSize() + 10);
+ List<GenerationMember> nextGeneration = new ArrayList<GenerationMember>(settings.getGenerationSize() + 10);
for (int i = 0; i < eliteSize; i++) {
nextGeneration.add(generation.get(i));
}
if (settings.isUseAnnealing() && (annealingValue > 0.01)) {
- int annealingReplacements = 0;
+ int annealingReplacements = 0;
+
/* always keep the best, so start at 1 */
for (int i = 1; i < eliteSize; i++) {
int candidateIndex = random.nextInt(sz - eliteSize) + eliteSize;
- Member candidate = generation.get(candidateIndex);
- Member elite = generation.get(i);
- long delta = candidate.score - elite.score;
+ GenerationMember candidate = generation.get(candidateIndex);
+ GenerationMember elite = generation.get(i);
+ long delta = candidate.getScore().getDelta() - elite.getScore().getDelta();
if (delta < annealingValue) {
nextGeneration.set(i, candidate);
- annealingReplacements++;
+ if (Polycasso.DEBUG) {
+ annealingReplacements++;
+ }
}
}
@@ -196,10 +159,10 @@
generation = nextGeneration;
- eliteCutOff = generation.get(eliteSize-1).score;
+ eliteCutOff = generation.get(eliteSize-1).getScore().getDelta();
if (Polycasso.DEBUG) {
- System.out.println("Generation " + generationNumber + " had " + generationBests + " bests and " + generationElites + " elites. Best Score: " + generation.get(0).score);
+ System.out.println("Generation " + generationNumber + " had " + generationBests + " bests and " + generationElites + " elites. Best Score: " + generation.get(0).getScore());
}
generationBests = 0;
generationElites = 0;
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -0,0 +1,81 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
+ * Inspired by work by Roger Alsing
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.mebigfatguy.polycasso;
+
+import java.util.Arrays;
+
+/**
+ * class that holds a sample set of polygons and it's score
+ */
+public class GenerationMember implements Comparable<GenerationMember> {
+
+ private Score score;
+ private PolygonData[] data;
+
+ GenerationMember(Score polyScore, PolygonData[] polyData) {
+ score = polyScore;
+ data = polyData;
+ }
+
+ /**
+ * returns the score for this member
+ * @return the score
+ */
+ public Score getScore() {
+ return score;
+ }
+
+ /**
+ * returns the polygon data for this member
+ *
+ * @return the polygon data
+ */
+ public PolygonData[] getData() {
+ return data;
+ }
+
+ @Override
+ public int compareTo(GenerationMember o) {
+ long delta = score.getDelta() - o.score.getDelta();
+ if (delta > 0)
+ return 1;
+ else if (delta < 0)
+ return -1;
+
+ return data.length - o.data.length;
+ }
+
+ @Override
+ public int hashCode() {
+ return score.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof GenerationMember) {
+ return score.getDelta() == ((GenerationMember)o).score.getDelta();
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "(" + score + ": " + Arrays.toString(data) + ")";
+ }
+}
\ No newline at end of file
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationMember.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mimetype
+ text/plain
Added: svn:eol-style
+ native
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2011-07-29 03:36:02 UTC (rev 242)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -28,21 +28,63 @@
public interface ImageGenerator {
+ /**
+ * starts up threads to start looking for images that are closest to the target
+ */
void startGenerating();
+ /**
+ * shuts down threads that were looking for images
+ */
void stopGenerating();
+ /**
+ * retrieves the scaled target iamge
+ *
+ * @return the target image
+ */
BufferedImage getTargetImage();
+ /**
+ * returns the image size that is being generated. This size might be different the original image
+ * if the size is bigger then the max setting.
+ *
+ * @return the image size
+ */
Dimension getImageSize();
+ /**
+ * retrieves the best set of polygons for drawing the image so far
+ *
+ * @return the best set of polygons
+ */
PolygonData[] getBestData();
+ /**
+ * completes the image by transforming the polygon image to the real image
+ */
void complete();
+ /**
+ * allows interested parties to register to receive events when a new best image has been
+ * found.
+ *
+ * @param listener the listener that is interested in events
+ */
void addImageGeneratedListener(ImageGeneratedListener listener);
+ /**
+ * allows uninterested parties to unregister to receive events when a new best image is
+ * found
+ *
+ * @param listener the listener that is no longer needed
+ */
void removeImageGeneratedListener(ImageGeneratedListener listener);
+ /**
+ * informs all listeners that a new best image has been found
+ *
+ * @param image the new best image
+ */
void fireImageGenerated(Image image);
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java 2011-07-29 03:36:02 UTC (rev 242)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -18,8 +18,20 @@
*/
package com.mebigfatguy.polycasso;
+/**
+ * an enum that describes the result of an attempted improvement on an image
+ */
public enum ImprovementResult {
+ /**
+ * this improvement is better than last generations best image
+ */
BEST,
+ /**
+ * this improvement is better than the worst elite image from last generation
+ */
ELITE,
+ /**
+ * this improvement didn't improve any on the elite set from last generation
+ */
FAIL;
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java 2011-07-29 03:36:02 UTC (rev 242)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -74,11 +74,11 @@
* adjust the transparency of a random existing polygon
*/
ChangeAlpha,
- /*
+ /**
* change the color to white
*/
White,
- /*
+ /**
* change the color to black
*/
Black,
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2011-07-29 03:36:02 UTC (rev 242)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -29,7 +29,7 @@
*/
public class ImprovementTypeStats {
- private static final int MAX_FAILURE_RUN = 25;
+ private static final int MAX_FAILURE_RUN = 50;
private static class Stats {
public int successes = 1;
public int totals = 1;
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2011-07-29 03:36:02 UTC (rev 242)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2011-08-03 06:00:34 UTC (rev 243)
@@ -36,9 +36,11 @@
private Settings settings;
private GenerationHandler generationHandler;
private Dimension imageSize;
+ private Random r;
private List<PolygonData> polygons = null;
+ private Rectangle changedArea;
+ private GenerationMember changedMember;
private ImprovementTypeStats stats;
- private Random r;
/**
* create an improver using a specified image size
@@ -80,14 +82,11 @@
* @return the improvement type used to alter the data
*/
public ImprovementType improveRandomly() {
-
- {
- PolygonData[] randomData = generationHandler.getRandomPolygonData(false);
- if (randomData != null)
- polygons = new ArrayList<PolygonData>(Arrays.asList(randomData.clone()));
- else
- polygons = new ArrayList<PolygonData>();
- }
+ changedMember = generationHandler.getRandomMember(false);
+ if (changedMember != null)
+ polygons = new ArrayList<PolygonData>(Arrays.asList(changedMember.getData().clone()));
+ else
+ polygons = new ArrayList<PolygonData>();
ImprovementType type = (polygons.isEmpty()) ? ImprovementType.AddPolygon : stats.getRandomImprovementType();
@@ -96,6 +95,7 @@
if (polygons.size() < settings.getMaxPolygons()) {
PolygonData pd = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
polygons.add(pd);
+ changedArea = pd.getPolygon().getBounds();
} else {
randomCompleteChange();
type = ImprovementType.CompleteChange;
@@ -106,6 +106,7 @@
case RemovePolygon: {
int idx = r.nextInt(polygons.size());
+ changedArea = polygons.get(idx).getPolygon().getBounds();
polygons.remove(idx);
}
break;
@@ -114,7 +115,8 @@
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
Polygon polygon = pd.getPolygon();
- if (polygon.npoints <= settings.getMaxPoints()) {
+ changedArea = polygon.getBounds();
+ if (polygon.npoints < settings.getMaxPoints()) {
polygon.addPoint(0, 0);
int insPos = r.nextInt(polygon.npoints);
int lastPt = (insPos + polygon.npoints - 1) % polygon.npoints;
@@ -125,10 +127,13 @@
int x = r.nextInt(maxX) + Math.min(polygon.xpoints[lastPt], polygon.xpoints[insPos]);
int y = r.nextInt(maxY) + Math.min(polygon.ypoints[lastPt], polygon.ypoints[insPos]);
- System.arraycopy(polygon.xpoints, insPos, polygon.xpoints, insPos + 1, polygon.npoints - insPos - 1);
+ int numCopyPts = polygon.npoints - insPos - 1;
+ System.arraycopy(polygon.xpoints, insPos, polygon.xpoints, insPos + 1, numCopyPts);
polygon.xpoints[insPos] = x;
- System.arraycopy(polygon.ypoints, insPos, polygon.ypoints, insPos + 1, polygon.npoints - insPos - 1);
+ System.arraycopy(polygon.ypoints, insPos, polygon.ypoints, insPos + 1, numCopyPts);
polygon.ypoints[insPos] = y;
+ polygon.invalidate();
+ changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
} else {
@@ -143,12 +148,16 @@
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
if (polygon.npoints > 3) {
int delPos = r.nextInt(polygon.npoints);
- System.arraycopy(polygon.xpoints, delPos+1, polygon.xpoints, delPos, polygon.npoints - delPos - 1);
- System.arraycopy(polygon.ypoints, delPos+1, polygon.ypoints, delPos, polygon.npoints - delPos - 1);
+ int numPtCopy = polygon.npoints - delPos - 1;
+ System.arraycopy(polygon.xpoints, delPos+1, polygon.xpoints, delPos, numPtCopy);
+ System.arraycopy(polygon.ypoints, delPos+1, polygon.ypoints, delPos, numPtCopy);
polygon.npoints--;
+ polygon.invalidate();
+ changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
} else {
randomCompleteChange();
@@ -162,14 +171,18 @@
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
int movePos = r.nextInt(polygon.npoints);
int maxMovement = settings.getMaxPtMovement();
- int moveX = r.nextInt(maxMovement * 2) - maxMovement;
- int moveY = r.nextInt(maxMovement * 2) - maxMovement;
+ int dblMax = maxMovement << 1;
+ int moveX = r.nextInt(dblMax) - maxMovement;
+ int moveY = r.nextInt(dblMax) - maxMovement;
polygon.xpoints[movePos] += moveX;
polygon.ypoints[movePos] += moveY;
clipToRange(0, imageSize.width, polygon.xpoints[movePos]);
clipToRange(0, imageSize.height, polygon.ypoints[movePos]);
+ polygon.invalidate();
+ changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -178,6 +191,7 @@
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
int rectifyPos = r.nextInt(polygon.npoints);
int targetPos = (rectifyPos == 0) ? polygon.npoints - 1 : (rectifyPos - 1);
@@ -187,6 +201,8 @@
} else {
polygon.ypoints[rectifyPos] = polygon.ypoints[targetPos];
}
+ polygon.invalidate();
+ changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -194,6 +210,7 @@
case ReorderPoly: {
if (polygons.size() > 2) {
PolygonData pd = polygons.remove(r.nextInt(polygons.size()));
+ changedArea = pd.getPolygon().getBounds();
polygons.add(r.nextInt(polygons.size()), pd);
} else {
randomCompleteChange();
@@ -207,6 +224,7 @@
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
Rectangle bbox = polygon.getBounds();
double midX = bbox.getCenterX();
@@ -217,6 +235,8 @@
polygon.xpoints[i] += (polygon.xpoints[i] < midX) ? shrinkFactor : -shrinkFactor;
polygon.ypoints[i] += (polygon.ypoints[i] < midY) ? shrinkFactor : -shrinkFactor;
}
+ polygon.invalidate();
+ changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -225,8 +245,8 @@
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
Rectangle bbox = polygon.getBounds();
-
double midX = bbox.getCenterX();
double midY = bbox.getCenterY();
@@ -237,6 +257,8 @@
polygon.xpoints[i] = clipToRange(0, imageSize.width, polygon.xpoints[i]);
polygon.ypoints[i] = clipToRange(0, imageSize.height, polygon.ypoints[i]);
}
+ polygon.invalidate();
+ changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -245,15 +267,19 @@
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
Polygon polygon = pd.getPolygon();
+ changedArea = polygon.getBounds();
int maxMovement = settings.getMaxPtMovement();
- int shiftX = r.nextInt(2 * maxMovement) + maxMovement;
- int shiftY = r.nextInt(2 * maxMovement) + maxMovement;
+ int dblMax = maxMovement << 1;
+ int shiftX = r.nextInt(dblMax) + maxMovement;
+ int shiftY = r.nextInt(dblMax) + maxMovement;
for (int i = 0; i < polygon.npoints; i++) {
polygon.xpoints[i] += shiftX;
polygon.ypoints[i] += shiftY;
polygon.xpoints[i] = clipToRange(0, imageSize.width, polygon.xpoints[i]);
polygon.ypoints[i] = clipToRange(0, imageSize.height, polygon.ypoints[i]);
- }
+ }
+ polygon.invalidate();
+ changedArea.union(polygon.getBounds());
polygons.set(idx, pd);
}
break;
@@ -261,26 +287,28 @@
case ChangeColor: {
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ changedArea = pd.getPolygon().getBounds();
Color color = pd.getColor();
int comp = r.nextInt(3);
int maxChange = settings.getMaxColorChange();
+ int dblChange = maxChange << 1;
switch (comp) {
case 0: {
- int newColor = color.getRed() + (r.nextInt(2 * maxChange) - maxChange);
+ int newColor = color.getRed() + (r.nextInt(dblChange) - maxChange);
newColor = clipToRange(0, 255, newColor);
pd.setColor(new Color(newColor, color.getGreen(), color.getBlue()));
}
break;
case 1: {
- int newColor = color.getGreen() + (r.nextInt(2 * maxChange) - maxChange);
+ int newColor = color.getGreen() + (r.nextInt(dblChange) - maxChange);
newColor = clipToRange(0, 255, newColor);
pd.setColor(new Color(color.getRed(), newColor, color.getBlue()));
}
break;
case 2: {
- int newColor = color.getBlue() + (r.nextInt(2 * maxChange) - maxChange);
+ int newColor = color.getBlue() + (r.nextInt(dblChange) - maxChange);
newColor = clipToRange(0, 255, newColor);
pd.setColor(new Color(color.getRed(), color.getGreen(), newColor));
}
@@ -293,6 +321,7 @@
case White: {
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ changedArea = pd.getPolygon().getBounds();
pd.setColor(Color.WHITE);
pd.setAlpha(1);
polygons.set(idx, pd);
@@ -302,6 +331,7 @@
case Black: {
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ changedArea = pd.getPolygon().getBounds();
pd.setColor(Color.BLACK);
pd.setAlpha(1);
polygons.set(idx, pd);
@@ -311,35 +341,44 @@
case ChangeAlpha:
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ changedArea = pd.getPolygon().getBounds();
pd.setAlpha(r.nextFloat());
polygons.set(idx, pd);
break;
case Breed: {
- PolygonData[] copyData = generationHandler.getRandomPolygonData(false);
- if ((copyData == null) || (copyData.length == 0)) {
+ GenerationMember copyMember = generationHandler.getRandomMember(false);
+ if ((copyMember == null) || (copyMember.getData().length == 0)) {
randomCompleteChange();
} else {
+ PolygonData[] copyData = copyMember.getData();
idx = r.nextInt(copyData.length);
if (idx >= polygons.size()) {
polygons.add(copyData[idx]);
+ changedArea = copyData[idx].getPolygon().getBounds();
} else {
+ changedArea = polygons.get(idx).getPolygon().getBounds();
polygons.set(idx, copyData[idx]);
+ changedArea.union(polygons.get(idx).getPolygon().getBounds());
}
}
}
break;
case BreedElite: {
- PolygonData[] copyData = generationHandler.getRandomPolygonData(true);
- if ((copyData == null) || (copyData.length == 0)) {
+ GenerationMember copyMember = generationHandler.getRandomMember(true);
+ if ((copyMember == null) || (copyMember.getData().length == 0)) {
randomCompleteChange();
} else {
+ PolygonData[] copyData = copyMember.getData();
idx = r.nextInt(copyData.length);
if (idx >= polygons.size()) {
polygons.add(copyData[idx]);
+ changedArea = copyData[idx].getPolygon().getBounds();
} else {
+ changedArea = polygons.get(idx).getPolygon().getBounds();
polygons.set(idx, copyData[idx]);
+ changedArea.union(polygons.get(idx).getPolygon().getBounds());
}
}
}
@@ -355,11 +394,30 @@
}
/**
+ * returns the member image from which this generated image was created
+ *
+ * @return the parent generated image member
+ */
+ public GenerationMember getParentGenerationMember() {
+ return changedMember;
+ }
+
+ /**
+ * returns the area that was changed in this image
+ *
+ * @return the rectangular bounds that was changed, or null for a complete change
+ */
+ public Rectangle getChangedArea() {
+ return changedArea;
+ }
+
+ /**
* generates a random polygon change (all values)
*/
private void randomCompleteChange() {
int idx = r.nextInt(polygons.size());
polygons.set(idx, PolygonData.randomPoly(imageSize, settings.getMaxPoints()));
+ changedArea = null;
}
/**
Modified: trunk/polyca...
[truncated message content] |
|
From: <dbr...@us...> - 2011-07-29 03:36:09
|
Revision: 242
http://polycasso.svn.sourceforge.net/polycasso/?rev=242&view=rev
Author: dbrosius
Date: 2011-07-29 03:36:02 +0000 (Fri, 29 Jul 2011)
Log Message:
-----------
turn off debugging
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2011-07-29 03:26:39 UTC (rev 241)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2011-07-29 03:36:02 UTC (rev 242)
@@ -28,7 +28,7 @@
/**
* enable some console debugging, and show the target image
*/
- public static final boolean DEBUG = true;
+ public static final boolean DEBUG = false;
/**
* the main entry point to the web start app
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-29 03:26:45
|
Revision: 241
http://polycasso.svn.sourceforge.net/polycasso/?rev=241&view=rev
Author: dbrosius
Date: 2011-07-29 03:26:39 +0000 (Fri, 29 Jul 2011)
Log Message:
-----------
create tag 1.6
Added Paths:
-----------
tags/v1_6_0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-29 03:14:34
|
Revision: 240
http://polycasso.svn.sourceforge.net/polycasso/?rev=240&view=rev
Author: dbrosius
Date: 2011-07-29 03:14:27 +0000 (Fri, 29 Jul 2011)
Log Message:
-----------
update store
Modified Paths:
--------------
trunk/polycasso/polycasso.store
Modified: trunk/polycasso/polycasso.store
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-29 03:10:31
|
Revision: 239
http://polycasso.svn.sourceforge.net/polycasso/?rev=239&view=rev
Author: dbrosius
Date: 2011-07-29 03:10:25 +0000 (Fri, 29 Jul 2011)
Log Message:
-----------
get ready for 1.6.0
Modified Paths:
--------------
trunk/polycasso/build.xml
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2011-07-28 00:07:42 UTC (rev 238)
+++ trunk/polycasso/build.xml 2011-07-29 03:10:25 UTC (rev 239)
@@ -38,7 +38,7 @@
<property name="forms.version" value="1.2.1"/>
<property name="commons-io.version" value="1.4"/>
- <property name="polycasso.version" value="1.5.0"/>
+ <property name="polycasso.version" value="1.6.0"/>
<target name="clean" description="removes all generated collateral">
<delete dir="${classes.dir}"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-28 00:07:50
|
Revision: 238
http://polycasso.svn.sourceforge.net/polycasso/?rev=238&view=rev
Author: dbrosius
Date: 2011-07-28 00:07:42 +0000 (Thu, 28 Jul 2011)
Log Message:
-----------
update from git
Modified Paths:
--------------
trunk/polycasso/build.xml
trunk/polycasso/lib/forms-1.2.1.jar
trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/DoubleDocument.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java
trunk/polycasso/src/com/mebigfatguy/polycasso/FileSelector.java
trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedEvent.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedListener.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java
trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PainterPanel.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java
Added Paths:
-----------
trunk/polycasso/htdocs/girl.svg
trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/build.xml 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,8 +1,8 @@
<!--
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,6 +35,9 @@
<property name="javac.deprecation" value="on"/>
<property name="javac.debug" value="on"/>
+ <property name="forms.version" value="1.2.1"/>
+ <property name="commons-io.version" value="1.4"/>
+
<property name="polycasso.version" value="1.5.0"/>
<target name="clean" description="removes all generated collateral">
@@ -55,12 +58,35 @@
<mkdir dir="${classes.dir}"/>
<mkdir dir="${javadoc.dir}"/>
<path id="polycasso.classpath">
- <pathelement location="${lib.dir}/commons-io-1.4.jar"/>
- <pathelement location="${lib.dir}/forms-1.2.1.jar"/>
+ <pathelement location="${lib.dir}/commons-io-${commons-io.version}.jar"/>
+ <pathelement location="${lib.dir}/forms-${forms.version}.jar"/>
</path>
</target>
+
+
+ <property name="forms_url" value="http://repo1.maven.org/maven2/com/jgoodies/forms/${forms.version}/forms-${forms.version}.jar"/>
+ <property name="commonsio_url" value="http://repo1.maven.org/maven2/commons-io/commons-io/${commons-io.version}/commons-io-${commons-io.version}.jar"/>
+
+ <target name="forms_check">
+ <available file="${basedir}/lib/forms-${forms.version}.jar" property="forms_exists"/>
+ </target>
+
+ <target name="commonsio_check">
+ <available file="${basedir}/lib/commons-io-${commons-io.version}.jar" property="commonsio.exists"/>
+ </target>
+
+ <target name="install_forms" depends="forms_check" unless="forms_exists" description="installs forms.jar into lib">
+ <get src="${forms_url}" dest="${basedir}/lib/forms-${forms.version}.jar" verbose="true" ignoreerrors="true"/>
+ </target>
+
+ <target name="install_commonsio" depends="commonsio_check" unless="commonsio.exists" description="installs commons-io.jar into lib">
+ <get src="${commonsio_url}" dest="${basedir}/lib/commons-io-${commons-io.version}.jar" verbose="true" ignoreerrors="true"/>
+ </target>
+
+ <target name="pull" depends="install_forms, install_commonsio" description="pulls in the 3rd party jars">
+ </target>
- <target name="compile" depends="-init" description="compiles java files">
+ <target name="compile" depends="-init, pull" description="compiles java files">
<javac srcdir="${src.dir}"
destdir="${classes.dir}"
source="${javac.source}"
@@ -107,7 +133,7 @@
<manifest>
<attribute name="polycasso-version" value="${polycasso.version}"/>
<attribute name="Main-Class" value="com.mebigfatguy.polycasso.Polycasso"/>
- <attribute name="Class-Path" value="commons-io-1.4.jar forms-1.2.1.jar"/>
+ <attribute name="Class-Path" value="commons-io-${commons-io.version}.jar forms-${forms.version}.jar"/>
</manifest>
</jar>
</target>
@@ -174,7 +200,7 @@
<target name="binzip" depends="build" description="zips up all jars">
<zip destfile="${basedir}/polycasso-bin-${polycasso.version}.zip"
basedir="${jnlp.dir}"
- includes="polycasso-${polycasso.version}.jar commons-io-1.4.jar forms-1.2.1.jar"/>
+ includes="polycasso-${polycasso.version}.jar commons-io-${commons-io.version}.jar forms-${forms.version}.jar"/>
</target>
<target name="release" depends="build, jnlp, binzip, srczip, javadoc" description="prepares everything for a release"/>
Added: trunk/polycasso/htdocs/girl.svg
===================================================================
(Binary files differ)
Property changes on: trunk/polycasso/htdocs/girl.svg
___________________________________________________________________
Added: svn:mime-type
+ image/svg
Added: svn:eol-style
+ native
Modified: trunk/polycasso/lib/forms-1.2.1.jar
===================================================================
(Binary files differ)
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/AboutDialog.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -0,0 +1,272 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
+ * Inspired by work by Roger Alsing
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.mebigfatguy.polycasso;
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * class that generates test images iteratively looking for the best image that matches a target.
+ * The images are generated from semi-transparent polygons that are improved upon over time.
+ * This class generates multiple images in parallel to keep multicore processors busy.
+ */
+public class DefaultImageGenerator implements ImageGenerator, Runnable {
+ private Set<ImageGeneratedListener> listeners = new HashSet<ImageGeneratedListener>();
+ private Settings settings;
+ private BufferedImage targetImage;
+ private GenerationHandler generationHandler;
+ private Dimension imageSize;
+ private Feedback feedback;
+ private Thread[] t = null;
+ private Object startStopLock = new Object();
+
+ /**
+ * creates an ImageGenerator for the given target image, and size
+ * @param confSettings the configuration settings
+ * @param image the target image
+ * @param size the dimension of the image
+ */
+ public DefaultImageGenerator(Settings confSettings, Image image, Dimension size) {
+ settings = confSettings;
+ imageSize = trimSize(size, settings.getMaxImageSize());
+ targetImage = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+
+ Graphics g = targetImage.getGraphics();
+ try {
+ g.drawImage(image, 0, 0, imageSize.width, imageSize.height, Color.WHITE, null);
+ generationHandler = new GenerationHandler(settings, imageSize);
+ feedback = new Feedback(targetImage);
+ } finally {
+ g.dispose();
+ }
+ }
+
+ /**
+ * retrieves the scaled target iamge
+ *
+ * @return the target image
+ */
+ public BufferedImage getTargetImage() {
+ return targetImage;
+ }
+
+ /**
+ * returns the image size that is being generated. This size might be different the original image
+ * if the size is bigger then the max setting.
+ *
+ * @return the image size
+ */
+ public Dimension getImageSize() {
+ return imageSize;
+ }
+
+ /**
+ * allows interested parties to register to receive events when a new best image has been
+ * found.
+ *
+ * @param listener the listener that is interested in events
+ */
+ public void addImageGeneratedListener(ImageGeneratedListener listener) {
+ listeners.add(listener);
+ }
+
+ /**
+ * allows uninterested parties to unregister to receive events when a new best image is
+ * found
+ *
+ * @param listener the listener that is no longer needed
+ */
+ public void removeImageGeneratedListener(ImageGeneratedListener listener) {
+ listeners.remove(listener);
+ }
+
+ /**
+ * informs all listeners that a new best image has been found
+ *
+ * @param image the new best image
+ */
+ public void fireImageGenerated(Image image) {
+ ImageGeneratedEvent event = new ImageGeneratedEvent(this, image);
+ for (ImageGeneratedListener listener : listeners) {
+ listener.imageGenerated(event);
+ }
+ }
+
+ /**
+ * starts up threads to start looking for images that are closest to the target
+ */
+ public void startGenerating() {
+ synchronized(startStopLock) {
+ if (t == null) {
+
+ populateGenerationZeroElite();
+ t = new Thread[Runtime.getRuntime().availableProcessors() + 1];
+ for (int i = 0; i < t.length; i++) {
+ t[i] = new Thread(this);
+ t[i].setName("Improver : " + i);
+ t[i].start();
+ }
+ }
+ }
+ }
+
+ /**
+ * shuts down threads that were looking for images
+ */
+ public void stopGenerating() {
+ synchronized(startStopLock) {
+ if (t != null) {
+ try {
+ for (int i = 0; i < t.length; i++) {
+ t[i].interrupt();
+ }
+ for (int i = 0; i < t.length; i++) {
+ t[i].join();
+ }
+ } catch (InterruptedException ie) {
+ } finally {
+ t = null;
+ }
+ }
+ }
+ }
+
+ /**
+ * completes the image by transforming the polygon image to the real image
+ */
+ public void complete() {
+ synchronized(startStopLock) {
+ if (t != null) {
+ stopGenerating();
+ t = new Thread[1];
+ t[0] = new Thread(new ImageCompleter(this, targetImage, generationHandler.getBestMember().data, imageSize));
+ t[0].start();
+ }
+ }
+ }
+
+ /**
+ * retrieves the best set of polygons for drawing the image so far
+ *
+ * @return the best set of polygons
+ */
+ public PolygonData[] getBestData() {
+ return generationHandler.getBestMember().data;
+ }
+ /**
+ * the runnable interface implementation to repeatedly improve upon the image and check to
+ * see if it is closer to the target image. Images are created in batches of settings.numCompetingImages
+ * and the best one (if better than the parent) is selected as the new best.
+ */
+ public void run() {
+ try {
+ BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+ Graphics2D g2d = (Graphics2D)image.getGraphics();
+ try {
+ Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
+ Improver improver = new Improver(settings, generationHandler, imageSize);
+
+ while (!Thread.interrupted()) {
+ ImprovementType type = improver.improveRandomly();
+
+ List<PolygonData> data = improver.getData();
+ imagePolygonData(g2d, data, srcOpaque);
+
+ long delta = feedback.calculateDelta(image);
+
+ boolean wasSuccessful;
+
+ ImprovementResult result = generationHandler.addPolygonData(delta, data.toArray(new PolygonData[data.size()]));
+ switch (result) {
+ case BEST:
+ fireImageGenerated(image);
+ wasSuccessful = true;
+ image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+ g2d.dispose();
+ g2d = (Graphics2D)image.getGraphics();
+ break;
+
+ case ELITE:
+ wasSuccessful = true;
+ break;
+
+ default:
+ wasSuccessful = false;
+ }
+
+ improver.typeWasSuccessful(type, wasSuccessful);
+ }
+ } finally {
+ g2d.dispose();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void imagePolygonData(Graphics2D g2d, List<PolygonData> polygonData, Composite srcOpaque) {
+ g2d.setColor(Color.BLACK);
+ g2d.setComposite(srcOpaque);
+ g2d.fillRect(0, 0, imageSize.width, imageSize.height);
+
+ for (PolygonData pd : polygonData) {
+ pd.draw(g2d);
+ }
+ }
+
+ private void populateGenerationZeroElite() {
+ Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
+ for (int i = 0; i < settings.getEliteSize(); i++) {
+ BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+ List<PolygonData> polygons = new ArrayList<PolygonData>();
+ PolygonData pd = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
+ polygons.add(pd);
+ Graphics2D g2d = (Graphics2D)image.getGraphics();
+ try {
+ imagePolygonData(g2d, polygons, srcOpaque);
+ long delta = feedback.calculateDelta(image);
+ generationHandler.addPolygonData(delta, polygons.toArray(new PolygonData[polygons.size()]));
+ } finally {
+ g2d.dispose();
+ }
+ }
+ }
+
+ private Dimension trimSize(Dimension origSize, Dimension maxSize) {
+ if ((origSize.width < maxSize.width) && (origSize.height < maxSize.height))
+ return origSize;
+
+ double hFrac = (double)maxSize.width / (double)origSize.width;
+ double vFrac = (double)maxSize.height/ (double)origSize.height;
+
+ double frac = (hFrac < vFrac) ? hFrac : vFrac;
+
+ return new Dimension((int)(frac * origSize.width), (int)(frac * origSize.height));
+ }
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/DefaultImageGenerator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/DoubleDocument.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/DoubleDocument.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/DoubleDocument.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -50,28 +50,28 @@
* @param testImage the image to score
* @return a value that represents its closeness to ideal
*/
- public double calculateDelta(BufferedImage testImage) {
+ public long calculateDelta(BufferedImage testImage) {
WritableRaster raster = testImage.getRaster();
DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
byte[] testBuffer = dbb.getData();
- double error = 0.0;
+ long error = 0L;
//index 0 is alpha, start at 1 (blue)
for (int i = 1; i < size; i++) {
int blue1 = targetBuffer[i] & 0x0FF;
int blue2 = testBuffer[i++] & 0x0FF;
- double blueError = blue1 - blue2;
+ long blueError = blue1 - blue2;
blueError *= blueError;
int green1 = targetBuffer[i] & 0x0FF;
int green2 = testBuffer[i++] & 0x0FF;
- double greenError = green1 - green2;
+ long greenError = green1 - green2;
greenError *= greenError;
int red1 = targetBuffer[i] & 0x0FF;
int red2 = testBuffer[i++] & 0x0FF;
- double redError = red1 - red2;
+ long redError = red1 - red2;
redError *= redError;
error += redError + greenError + blueError;
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/FileSelector.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/FileSelector.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/FileSelector.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,10 +35,10 @@
*/
public static class Member implements Comparable<Member> {
- double score;
+ long score;
PolygonData[] data;
- Member(double polyScore, PolygonData[] polyData) {
+ Member(long polyScore, PolygonData[] polyData) {
score = polyScore;
data = polyData;
}
@@ -49,7 +49,8 @@
return 1;
else if (score < o.score)
return -1;
- return 0;
+
+ return data.length - o.data.length;
}
@Override
@@ -91,8 +92,8 @@
random = new Random();
generationNumber = 0;
settings = confSettings;
- bestMember = new Member(Double.MAX_VALUE, new PolygonData[0]);
- eliteCutOff = Double.MAX_VALUE;
+ bestMember = new Member(Long.MAX_VALUE, new PolygonData[0]);
+ eliteCutOff = Long.MAX_VALUE;
generation = new ArrayList<Member>(settings.getGenerationSize() + 10);
annealingValue = settings.getStartTemperature() * settings.getStartTemperature() * imageSize.height * imageSize.width;
generationBests = 0;
@@ -108,7 +109,7 @@
*
* @return whether this is the best polygon set so far
*/
- public ImprovementResult addPolygonData(double score, PolygonData[] polygonData) {
+ public ImprovementResult addPolygonData(long score, PolygonData[] polygonData) {
synchronized(generation) {
Member newMember = new Member(score, polygonData);
generation.add(newMember);
@@ -181,7 +182,7 @@
int candidateIndex = random.nextInt(sz - eliteSize) + eliteSize;
Member candidate = generation.get(candidateIndex);
Member elite = generation.get(i);
- double delta = candidate.score - elite.score;
+ long delta = candidate.score - elite.score;
if (delta < annealingValue) {
nextGeneration.set(i, candidate);
annealingReplacements++;
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageCompleter.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -45,7 +45,7 @@
*
* @param generator the image generator that this completer is working for
* @param image the target image that will eventually be drawn
- * @param bestData the best proximation the program reached
+ * @param bestData the best approximation the program reached
* @param size the image size
*/
@@ -56,13 +56,17 @@
srcImage = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g2d = (Graphics2D)srcImage.getGraphics();
- Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
- g2d.setColor(Color.BLACK);
- g2d.setComposite(srcOpaque);
- g2d.fillRect(0, 0, imageSize.width, imageSize.height);
-
- for (PolygonData pd : bestData) {
- pd.draw(g2d);
+ try {
+ Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
+ g2d.setColor(Color.BLACK);
+ g2d.setComposite(srcOpaque);
+ g2d.fillRect(0, 0, imageSize.width, imageSize.height);
+
+ for (PolygonData pd : bestData) {
+ pd.draw(g2d);
+ }
+ } finally {
+ g2d.dispose();
}
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedEvent.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedEvent.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedEvent.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedListener.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedListener.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGeneratedListener.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,241 +18,31 @@
*/
package com.mebigfatguy.polycasso;
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Composite;
import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
/**
- * class that generates test images iteratively looking for the best image that matches a target.
- * The images are generated from semi-transparent polygons that are improved upon over time.
- * This class generates multiple images in parallel to keep multicore processors busy.
+ * interface that generates test images iteratively looking for the best image that matches a target.
*/
-public class ImageGenerator implements Runnable {
- private Set<ImageGeneratedListener> listeners = new HashSet<ImageGeneratedListener>();
- private Settings settings;
- private BufferedImage targetImage;
- private GenerationHandler generationHandler;
- private Dimension imageSize;
- private Feedback feedback;
- private Thread[] t = null;
- private Object startStopLock = new Object();
-
- /**
- * creates an ImageGenerator for the given target image, and size
- * @param confSettings the configuration settings
- * @param image the target image
- * @param size the dimension of the image
- */
- public ImageGenerator(Settings confSettings, Image image, Dimension size) {
- settings = confSettings;
- imageSize = trimSize(size, settings.getMaxImageSize());
- targetImage = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
- Graphics g = targetImage.getGraphics();
- g.drawImage(image, 0, 0, imageSize.width, imageSize.height, Color.WHITE, null);
- generationHandler = new GenerationHandler(settings, imageSize);
- feedback = new Feedback(targetImage);
- }
-
- /**
- * retrieves the scaled target iamge
- *
- * @return the target image
- */
- public BufferedImage getTargetImage() {
- return targetImage;
- }
-
- /**
- * returns the image size that is being generated. This size might be different the original image
- * if the size is bigger then the max setting.
- *
- * @return the image size
- */
- public Dimension getImageSize() {
- return imageSize;
- }
-
- /**
- * allows interested parties to register to receive events when a new best image has been
- * found.
- *
- * @param listener the listener that is interested in events
- */
- public void addImageGeneratedListener(ImageGeneratedListener listener) {
- listeners.add(listener);
- }
-
- /**
- * allows uninterested parties to unregister to receive events when a new best image is
- * found
- *
- * @param listener the listener that is no longer needed
- */
- public void removeImageGeneratedListener(ImageGeneratedListener listener) {
- listeners.remove(listener);
- }
-
- /**
- * informs all listeners that a new best image has been found
- *
- * @param image the new best image
- */
- public void fireImageGenerated(Image image) {
- ImageGeneratedEvent event = new ImageGeneratedEvent(this, image);
- for (ImageGeneratedListener listener : listeners) {
- listener.imageGenerated(event);
- }
- }
-
- /**
- * starts up threads to start looking for images that are closest to the target
- */
- public void startGenerating() {
- synchronized(startStopLock) {
- if (t == null) {
-
- populateGenerationZeroElite();
- t = new Thread[Runtime.getRuntime().availableProcessors() + 1];
- for (int i = 0; i < t.length; i++) {
- t[i] = new Thread(this);
- t[i].setName("Improver : " + i);
- t[i].start();
- }
- }
- }
- }
-
- /**
- * shuts down threads that were looking for images
- */
- public void stopGenerating() {
- synchronized(startStopLock) {
- if (t != null) {
- try {
- for (int i = 0; i < t.length; i++) {
- t[i].interrupt();
- }
- for (int i = 0; i < t.length; i++) {
- t[i].join();
- }
- } catch (InterruptedException ie) {
- } finally {
- t = null;
- }
- }
- }
- }
-
- /**
- * completes the image by transforming the polygon image to the real image
- */
- public void complete() {
- synchronized(startStopLock) {
- if (t != null) {
- stopGenerating();
- t = new Thread[1];
- t[0] = new Thread(new ImageCompleter(this, targetImage, generationHandler.getBestMember().data, imageSize));
- t[0].start();
- }
- }
- }
-
- /**
- * retrieves the best set of polygons for drawing the image so far
- *
- * @return the best set of polygons
- */
- public PolygonData[] getBestData() {
- return generationHandler.getBestMember().data;
- }
- /**
- * the runnable interface implementation to repeatedly improve upon the image and check to
- * see if it is closer to the target image. Images are created in batches of settings.numCompetingImages
- * and the best one (if better than the parent) is selected as the new best.
- */
- public void run() {
- try {
- BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
- Graphics2D g2d = (Graphics2D)image.getGraphics();
- Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
- Improver improver = new Improver(settings, generationHandler, imageSize);
-
- while (!Thread.interrupted()) {
- ImprovementType type = improver.improveRandomly();
-
- List<PolygonData> data = improver.getData();
- imagePolygonData(g2d, data, srcOpaque);
- double delta = feedback.calculateDelta(image);
-
- boolean wasSuccessful;
-
- ImprovementResult result = generationHandler.addPolygonData(delta, data.toArray(new PolygonData[data.size()]));
- switch (result) {
- case BEST:
- fireImageGenerated(image);
- wasSuccessful = true;
- image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
- g2d = (Graphics2D)image.getGraphics();
- break;
-
- case ELITE:
- wasSuccessful = true;
- break;
-
- default:
- wasSuccessful = false;
- }
-
- improver.typeWasSuccessful(type, wasSuccessful);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void imagePolygonData(Graphics2D g2d, List<PolygonData> polygonData, Composite srcOpaque) {
- g2d.setColor(Color.BLACK);
- g2d.setComposite(srcOpaque);
- g2d.fillRect(0, 0, imageSize.width, imageSize.height);
-
- for (PolygonData pd : polygonData) {
- pd.draw(g2d);
- }
- }
-
- private void populateGenerationZeroElite() {
- Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
- for (int i = 0; i < settings.getEliteSize(); i++) {
- BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
- List<PolygonData> polygons = new ArrayList<PolygonData>();
- PolygonData pd = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
- polygons.add(pd);
- Graphics2D g2d = (Graphics2D)image.getGraphics();
- imagePolygonData(g2d, polygons, srcOpaque);
- double delta = feedback.calculateDelta(image);
- generationHandler.addPolygonData(delta, polygons.toArray(new PolygonData[polygons.size()]));
- }
- }
-
- private Dimension trimSize(Dimension origSize, Dimension maxSize) {
- if ((origSize.width < maxSize.width) && (origSize.height < maxSize.height))
- return origSize;
-
- double hFrac = (double)maxSize.width / (double)origSize.width;
- double vFrac = (double)maxSize.height/ (double)origSize.height;
-
- double frac = (hFrac < vFrac) ? hFrac : vFrac;
-
- return new Dimension((int)(frac * origSize.width), (int)(frac * origSize.height));
- }
+public interface ImageGenerator {
+
+ void startGenerating();
+
+ void stopGenerating();
+
+ BufferedImage getTargetImage();
+
+ Dimension getImageSize();
+
+ PolygonData[] getBestData();
+
+ void complete();
+
+ void addImageGeneratedListener(ImageGeneratedListener listener);
+
+ void removeImageGeneratedListener(ImageGeneratedListener listener);
+
+ void fireImageGenerated(Image image);
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -52,15 +52,18 @@
BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g2d = (Graphics2D)image.getGraphics();
- g2d.setColor(Color.BLACK);
- g2d.fillRect(0, 0, imageSize.width, imageSize.height);
-
- for (PolygonData pd : data) {
- pd.draw(g2d);
- }
-
- ImageIO.write(image, "png", bos);
-
+ try {
+ g2d.setColor(Color.BLACK);
+ g2d.fillRect(0, 0, imageSize.width, imageSize.height);
+
+ for (PolygonData pd : data) {
+ pd.draw(g2d);
+ }
+
+ ImageIO.write(image, "png", bos);
+ } finally {
+ g2d.dispose();
+ }
} finally {
IOUtils.closeQuietly(bos);
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -286,7 +286,7 @@
ImageSizer sizer = new ImageSizer(targetImage);
Dimension size = new Dimension(sizer.getWidth(), sizer.getHeight());
- generator = new ImageGenerator(settings, targetImage, size);
+ generator = new DefaultImageGenerator(settings, targetImage, size);
panel.setTarget(generator.getTargetImage());
size = generator.getImageSize();
@@ -297,7 +297,7 @@
wSize.height *= 2;
}
setSize(wSize);
- generator = new ImageGenerator(settings, targetImage, size);
+ generator = new DefaultImageGenerator(settings, targetImage, size);
generator.addImageGeneratedListener(PainterFrame.this);
generator.startGenerating();
completeImage.setEnabled(true);
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PainterPanel.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PainterPanel.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PainterPanel.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,7 +28,7 @@
/**
* enable some console debugging, and show the target image
*/
- public static final boolean DEBUG = false;
+ public static final boolean DEBUG = true;
/**
* the main entry point to the web start app
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/RandomImageFinder.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java 2011-07-26 02:29:14 UTC (rev 237)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/URLFetcher.java 2011-07-28 00:07:42 UTC (rev 238)
@@ -1,7 +1,7 @@
/*
* polycasso - Cubism Artwork generator
- * Copyright 2009-2010 MeBigFatGuy.com
- * Copyright 2009-2010 Dave Brosius
+ * Copyright 2009-2011 MeBigFatGuy.com
+ * Copyright 2009-2011 Dave Brosius
* Inspired by work by Roger Alsing
*
* Licensed under the Apache License, Version 2.0 (the "License");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-26 02:29:21
|
Revision: 237
http://polycasso.svn.sourceforge.net/polycasso/?rev=237&view=rev
Author: dbrosius
Date: 2011-07-26 02:29:14 +0000 (Tue, 26 Jul 2011)
Log Message:
-----------
populate generation 0 elite set
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2011-07-26 02:08:58 UTC (rev 236)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2011-07-26 02:29:14 UTC (rev 237)
@@ -26,6 +26,7 @@
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -118,6 +119,8 @@
public void startGenerating() {
synchronized(startStopLock) {
if (t == null) {
+
+ populateGenerationZeroElite();
t = new Thread[Runtime.getRuntime().availableProcessors() + 1];
for (int i = 0; i < t.length; i++) {
t[i] = new Thread(this);
@@ -186,14 +189,8 @@
while (!Thread.interrupted()) {
ImprovementType type = improver.improveRandomly();
- g2d.setColor(Color.BLACK);
- g2d.setComposite(srcOpaque);
- g2d.fillRect(0, 0, imageSize.width, imageSize.height);
-
List<PolygonData> data = improver.getData();
- for (PolygonData pd : data) {
- pd.draw(g2d);
- }
+ imagePolygonData(g2d, data, srcOpaque);
double delta = feedback.calculateDelta(image);
@@ -223,6 +220,30 @@
}
}
+ private void imagePolygonData(Graphics2D g2d, List<PolygonData> polygonData, Composite srcOpaque) {
+ g2d.setColor(Color.BLACK);
+ g2d.setComposite(srcOpaque);
+ g2d.fillRect(0, 0, imageSize.width, imageSize.height);
+
+ for (PolygonData pd : polygonData) {
+ pd.draw(g2d);
+ }
+ }
+
+ private void populateGenerationZeroElite() {
+ Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
+ for (int i = 0; i < settings.getEliteSize(); i++) {
+ BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+ List<PolygonData> polygons = new ArrayList<PolygonData>();
+ PolygonData pd = PolygonData.randomPoly(imageSize, settings.getMaxPoints());
+ polygons.add(pd);
+ Graphics2D g2d = (Graphics2D)image.getGraphics();
+ imagePolygonData(g2d, polygons, srcOpaque);
+ double delta = feedback.calculateDelta(image);
+ generationHandler.addPolygonData(delta, polygons.toArray(new PolygonData[polygons.size()]));
+ }
+ }
+
private Dimension trimSize(Dimension origSize, Dimension maxSize) {
if ((origSize.width < maxSize.width) && (origSize.height < maxSize.height))
return origSize;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-26 02:09:04
|
Revision: 236
http://polycasso.svn.sourceforge.net/polycasso/?rev=236&view=rev
Author: dbrosius
Date: 2011-07-26 02:08:58 +0000 (Tue, 26 Jul 2011)
Log Message:
-----------
turn DEBUG off
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
Added Paths:
-----------
trunk/polycasso/etc/polycasso.png
Added: trunk/polycasso/etc/polycasso.png
===================================================================
(Binary files differ)
Property changes on: trunk/polycasso/etc/polycasso.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2011-07-25 07:08:03 UTC (rev 235)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2011-07-26 02:08:58 UTC (rev 236)
@@ -28,7 +28,7 @@
/**
* enable some console debugging, and show the target image
*/
- public static final boolean DEBUG = true;
+ public static final boolean DEBUG = false;
/**
* the main entry point to the web start app
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-25 07:08:10
|
Revision: 235
http://polycasso.svn.sourceforge.net/polycasso/?rev=235&view=rev
Author: dbrosius
Date: 2011-07-25 07:08:03 +0000 (Mon, 25 Jul 2011)
Log Message:
-----------
hook up annealing
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-07-25 05:45:14 UTC (rev 234)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-07-25 07:08:03 UTC (rev 235)
@@ -146,7 +146,7 @@
int r = random.nextInt(size);
- int idx = (r * r) / (size * size);
+ int idx = (int)(r * ((double) r / (double) size));
return generation.get(idx).data;
}
@@ -174,6 +174,25 @@
nextGeneration.add(generation.get(i));
}
+ if (settings.isUseAnnealing() && (annealingValue > 0.01)) {
+ int annealingReplacements = 0;
+ /* always keep the best, so start at 1 */
+ for (int i = 1; i < eliteSize; i++) {
+ int candidateIndex = random.nextInt(sz - eliteSize) + eliteSize;
+ Member candidate = generation.get(candidateIndex);
+ Member elite = generation.get(i);
+ double delta = candidate.score - elite.score;
+ if (delta < annealingValue) {
+ nextGeneration.set(i, candidate);
+ annealingReplacements++;
+ }
+ }
+
+ if (Polycasso.DEBUG) {
+ System.out.println("Generation " + generationNumber + " had " + annealingReplacements + " annealing replacements with annealing value: " + annealingValue);
+ }
+ }
+
generation = nextGeneration;
eliteCutOff = generation.get(eliteSize-1).score;
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2011-07-25 05:45:14 UTC (rev 234)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2011-07-25 07:08:03 UTC (rev 235)
@@ -28,7 +28,7 @@
/**
* enable some console debugging, and show the target image
*/
- public static final boolean DEBUG = false;
+ public static final boolean DEBUG = true;
/**
* the main entry point to the web start app
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2011-07-25 05:45:14 UTC (rev 234)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2011-07-25 07:08:03 UTC (rev 235)
@@ -47,7 +47,7 @@
generationSize = 40;
eliteSize = 10;
useAnnealing = true;
- startTemperature = 1;
+ startTemperature = 10;
coolingRate = 0.01;
maxImageSize = new Dimension(800, 600);
maxPolygons = 100;
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2011-07-25 05:45:14 UTC (rev 234)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2011-07-25 07:08:03 UTC (rev 235)
@@ -47,7 +47,7 @@
pc.starttemperature = Annealing Starting Temperature
pc.starttemperature.tt = The average pixel error (color difference) that an inferior image can have to be accepted
pc.coolingrate = Annealing cooling rate
-pc.coolingrate.tt = How the average error is decreased on each generation
+pc.coolingrate.tt = How the average pixel error is decreased by multiplication on each generation
pc.imageoptions = Image Options
pc.maximagesize = Maximum Image Size
pc.width = Width
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-25 05:45:21
|
Revision: 234
http://polycasso.svn.sourceforge.net/polycasso/?rev=234&view=rev
Author: dbrosius
Date: 2011-07-25 05:45:14 +0000 (Mon, 25 Jul 2011)
Log Message:
-----------
add tooltips
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2011-07-25 05:32:52 UTC (rev 233)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2011-07-25 05:45:14 UTC (rev 234)
@@ -52,10 +52,15 @@
AboutPolycasso("pc.aboutpolycasso"),
GeneticsOptions("pc.geneticsoptions"),
GenerationSize("pc.generationsize"),
+ GenerationSizeToolTip("pc.generationsize.tt"),
EliteSize("pc.elitesize"),
+ EliteSizeToolTip("pc.elitesize.tt"),
UseAnnealing("pc.useannealing"),
+ UseAnnealingToolTip("pc.useannealing.tt"),
StartTemperature("pc.starttemperature"),
+ StartTemperatureToolTip("pc.starttemperature.tt"),
CoolingRate("pc.coolingrate"),
+ CoolingRateToolTip("pc.coolingrate.tt"),
ImageOptions("pc.imageoptions"),
MaxImageSize("pc.maximagesize"),
Width("pc.width"),
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2011-07-25 05:32:52 UTC (rev 233)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2011-07-25 05:45:14 UTC (rev 234)
@@ -201,6 +201,7 @@
geneticsPanel.add(generationSizeLabel, cc.xyw(1, 1, 2));
generationSizeField = new JTextField(4);
+ generationSizeField.setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.GenerationSizeToolTip));
generationSizeField.setDocument(new IntegerDocument());
generationSizeLabel.setLabelFor(generationSizeField);
geneticsPanel.add(generationSizeField, cc.xy(4, 1));
@@ -210,18 +211,21 @@
geneticsPanel.add(eliteSizeLabel, cc.xyw(1, 3, 2));
eliteSizeField = new JTextField(4);
+ eliteSizeField.setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.EliteSizeToolTip));
eliteSizeField.setDocument(new IntegerDocument());
eliteSizeLabel.setLabelFor(eliteSizeField);
geneticsPanel.add(eliteSizeField, cc.xy(4, 3));
eliteSizeField.addFocusListener(focuser);
useAnnealingButton = new JCheckBox(PolycassoBundle.getString(PolycassoBundle.Key.UseAnnealing));
+ useAnnealingButton.setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.UseAnnealingToolTip));
geneticsPanel.add(useAnnealingButton, cc.xyw(1, 5, 5));
JLabel startTemperatureLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.StartTemperature));
geneticsPanel.add(startTemperatureLabel, cc.xy(2, 7));
startTemperatureField = new JTextField(4);
+ startTemperatureField.setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.StartTemperatureToolTip));
startTemperatureField.setDocument(new DoubleDocument());
startTemperatureLabel.setLabelFor(startTemperatureField);
geneticsPanel.add(startTemperatureField, cc.xy(4, 7));
@@ -231,6 +235,7 @@
geneticsPanel.add(coolingRateLabel, cc.xy(2, 9));
coolingRateField = new JTextField(4);
+ coolingRateField.setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.CoolingRateToolTip));
coolingRateField.setDocument(new DoubleDocument());
coolingRateLabel.setLabelFor(coolingRateField);
geneticsPanel.add(coolingRateField, cc.xy(4, 9));
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2011-07-25 05:32:52 UTC (rev 233)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2011-07-25 05:45:14 UTC (rev 234)
@@ -39,10 +39,15 @@
pc.aboutpolycasso = About Polycasso
pc.geneticsoptions = Genetics Options
pc.generationsize = Generation Size
+pc.generationsize.tt = The number of images to generate in one generation
pc.elitesize = Elite Size
+pc.elitesize.tt = The number of images that are copied from one generation to another
pc.useannealing = Use Annealing
+pc.useannealing.tt = Accept images that are not as good as the elite images to encourage variations
pc.starttemperature = Annealing Starting Temperature
+pc.starttemperature.tt = The average pixel error (color difference) that an inferior image can have to be accepted
pc.coolingrate = Annealing cooling rate
+pc.coolingrate.tt = How the average error is decreased on each generation
pc.imageoptions = Image Options
pc.maximagesize = Maximum Image Size
pc.width = Width
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-25 05:32:58
|
Revision: 233
http://polycasso.svn.sourceforge.net/polycasso/?rev=233&view=rev
Author: dbrosius
Date: 2011-07-25 05:32:52 +0000 (Mon, 25 Jul 2011)
Log Message:
-----------
spilleng
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-07-25 05:10:23 UTC (rev 232)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2011-07-25 05:32:52 UTC (rev 233)
@@ -132,7 +132,7 @@
/**
* pick a random polygon sample either from the general pool or elite pool
- * scew the results towards the elite
+ * skew the results towards the elite
*
* @param elite whether to pick from the elite pool or not
* @return a random polygon set
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-25 05:10:30
|
Revision: 232
http://polycasso.svn.sourceforge.net/polycasso/?rev=232&view=rev
Author: dbrosius
Date: 2011-07-25 05:10:23 +0000 (Mon, 25 Jul 2011)
Log Message:
-----------
copy the template file to the jar
Modified Paths:
--------------
trunk/polycasso/build.xml
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2011-07-06 00:53:29 UTC (rev 231)
+++ trunk/polycasso/build.xml 2011-07-25 05:10:23 UTC (rev 232)
@@ -75,6 +75,7 @@
<copy todir="${classes.dir}">
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
+ <include name="**/*.template"/>
</fileset>
</copy>
<echo message="${polycasso.version}" file="${classes.dir}/com/mebigfatguy/polycasso/Version.txt"/>
@@ -98,6 +99,7 @@
<include name="**/*.class"/>
<include name="**/*.properties"/>
<include name="**/*.txt"/>
+ <include name="**/*.template"/>
</fileset>
<fileset dir="${basedir}">
<include name="license.txt"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-06 00:53:36
|
Revision: 231
http://polycasso.svn.sourceforge.net/polycasso/?rev=231&view=rev
Author: dbrosius
Date: 2011-07-06 00:53:29 +0000 (Wed, 06 Jul 2011)
Log Message:
-----------
better svg
Modified Paths:
--------------
trunk/polycasso/htdocs/oia.svg
Modified: trunk/polycasso/htdocs/oia.svg
===================================================================
--- trunk/polycasso/htdocs/oia.svg 2011-07-05 13:11:09 UTC (rev 230)
+++ trunk/polycasso/htdocs/oia.svg 2011-07-06 00:53:29 UTC (rev 231)
@@ -2,105 +2,105 @@
<!-- generated by Polycasso (http://polycasso.sourceforge.net) -->
<rect x="0" y="0" width="636px" height="474px" fill="black"/>
<g comp-op="src-over">
- <polygon fill="#527eb6" fill-opacity="0.8821569" points="0,466 0,0 636,0 636,443 626,465 636,438 636,387"/>
- <polygon fill="#fffeae" fill-opacity="0.34326494" points="143,265 251,263 249,279 241,305 269,195 289,229 125,226"/>
- <polygon fill="#f3d39d" fill-opacity="0.1245355" points="5,91 -46,91 -45,275 -35,319 47,319 47,296 82,293 544,346"/>
- <polygon fill="#00498a" fill-opacity="0.47304904" points="250,160 324,166 360,181 647,191 647,364 548,383 418,342 412,322"/>
- <polygon fill="#fbf2e1" fill-opacity="0.8955908" points="124,477 636,474 604,474 279,474 66,474 651,496 676,392 304,210"/>
- <polygon fill="#002147" fill-opacity="0.8219358" points="601,322 551,325 518,323 532,337 573,376 616,371"/>
- <polygon fill="#fff8e8" fill-opacity="0.7516805" points="297,389 292,415 334,413 418,399 440,371 373,344"/>
- <polygon fill="#07305c" fill-opacity="0.85675585" points="355,313 374,330 357,316 433,316 488,330 488,335 472,349 401,357"/>
- <polygon fill="#211105" fill-opacity="0.2271384" points="323,523 333,499 372,522 356,465 361,459 373,449 252,467"/>
- <polygon fill="#40372b" fill-opacity="0.37279248" points="656,380 340,460 410,504 461,484 636,474 636,318 605,318 614,339"/>
- <polygon fill="#bfa98b" fill-opacity="0.96050984" points="384,210 357,239 270,246 278,257 278,238 270,213 321,209 350,203"/>
- <polygon fill="#240800" fill-opacity="0.84314954" points="305,265 305,341 314,337 304,347 325,347 351,347 337,347 337,284"/>
- <polygon fill="#dd7100" fill-opacity="0.14035374" points="92,506 108,472 36,460 95,380 194,412 215,293 203,269 433,171"/>
- <polygon fill="#ffebdb" fill-opacity="0.23841059" points="379,63 -62,419 -17,457 348,461 336,460 369,477 439,476 364,461"/>
- <polygon fill="#002e4d" fill-opacity="0.6878403" points="157,281 160,377 210,365 270,365 184,396 259,400 87,136 67,167"/>
- <polygon fill="#ffffff" fill-opacity="0.25110412" points="204,63 331,68 370,327 450,402 271,421 333,266 357,221 78,257"/>
- <polygon fill="#fffef8" fill-opacity="0.88262403" points="536,323 537,350 584,378 571,392 448,425 439,424 433,384 409,360"/>
- <polygon fill="#4d150f" fill-opacity="0.07270974" points="319,355 298,381 317,349 323,347 356,327 368,240 380,225 285,225"/>
- <polygon fill="#030000" fill-opacity="0.32339317" points="346,319 272,327 308,341 294,295 270,274 201,294 168,238 141,424"/>
- <polygon fill="#15406f" fill-opacity="0.9594174" points="54,187 81,152 119,226 22,211 26,280 26,321 -3,350 -64,180"/>
- <polygon fill="#66523f" fill-opacity="0.18851942" points="468,389 409,414 421,414 402,442 434,438 461,468 482,433 536,405"/>
- <polygon fill="#000003" fill-opacity="0.1656084" points="173,136 299,160 177,368 163,268 145,239 153,402 48,374 58,183"/>
- <polygon fill="#c7a688" fill-opacity="0.90780896" points="206,177 206,272 265,272 306,337 255,382 189,362 209,399 206,349"/>
- <polygon fill="#f2b568" fill-opacity="0.42614853" points="177,411 30,352 24,258 186,173 181,180 182,248 151,290"/>
- <polygon fill="#e7e5e0" fill-opacity="0.7942253" points="237,215 239,215 289,214 268,209 244,214 253,212 253,213 244,209"/>
- <polygon fill="#a9e0ff" fill-opacity="0.13803494" points="203,60 252,93 204,13 238,-44 640,-3 656,50 371,221 208,484"/>
- <polygon fill="#b9a8a3" fill-opacity="0.9234007" points="25,250 26,279 26,292 56,292 38,284 118,212 32,211"/>
- <polygon fill="#0a0500" fill-opacity="0.043604553" points="567,335 586,288 519,253 479,253 545,319 569,362 502,341 195,10"/>
- <polygon fill="#000000" fill-opacity="0.44773823" points="317,257 335,267 338,286 309,317 317,318 337,298 307,350 307,264"/>
- <polygon fill="#0a2439" fill-opacity="0.6208018" points="-67,286 -73,398 71,377 105,379 62,298 51,333 60,334 86,307"/>
- <polygon fill="#bbb1a0" fill-opacity="0.63494784" points="17,220 158,357 176,271 214,186 209,187 128,210 70,218 30,208"/>
- <polygon fill="#003d77" fill-opacity="0.9643223" points="233,159 188,130 158,122 88,133 74,212 222,213 233,194 209,182"/>
- <polygon fill="#f3e5d1" fill-opacity="0.6649984" points="316,279 316,285 270,272 365,321 303,309 303,320 331,317"/>
- <polygon fill="#2d76bf" fill-opacity="0.45693696" points="217,214 68,-66 336,207"/>
- <polygon fill="#eddbb8" fill-opacity="0.4335037" points="72,305 26,297 26,356 -10,358 61,372 66,378 50,378 -5,384"/>
- <polygon fill="#f7ffe3" fill-opacity="0.44648564" points="305,342 342,346 342,350 346,385 346,380 337,361 381,303"/>
- <polygon fill="#ffffff" fill-opacity="0.0990324" points="26,76 57,147 59,178 78,151 518,200 635,200 665,110 395,85"/>
- <polygon fill="#1f4f84" fill-opacity="0.99493414" points="371,336 370,309 370,294 370,229 488,284 544,335 402,344"/>
- <polygon fill="#a89cb8" fill-opacity="0.12710965" points="463,200 436,193 430,166 391,125 393,131 511,118 617,118 599,197"/>
- <polygon fill="#981427" fill-opacity="0.0065020323" points="-6,28 -14,-2 -14,-14 94,-14 130,186 130,327 117,300 98,219"/>
- <polygon fill="#99b0c8" fill-opacity="0.51232594" points="382,34 373,185 365,188 624,182 644,193 644,63 569,66 382,66"/>
- <polygon fill="#031703" fill-opacity="0.058624685" points="443,324 343,339 336,345 315,345 307,247"/>
- <polygon fill="#006bff" fill-opacity="0.080927074" points="19,156 -21,81 0,0 636,0 636,157 641,100 476,81 269,205"/>
- <polygon fill="#8aed8c" fill-opacity="0.013245642" points="76,73 405,36 351,237 305,294 366,317 404,289 404,270"/>
- <polygon fill="#1c4584" fill-opacity="0.5685098" points="357,197 353,191 352,184 384,183 432,186 392,218 410,242"/>
- <polygon fill="#89b9f6" fill-opacity="0.23950595" points="274,68 642,64 335,18 175,22 120,106 145,134 292,189 418,291"/>
- <polygon fill="#e1ccb3" fill-opacity="0.5660151" points="155,237 335,262 372,268 319,266 319,297 317,311 352,271"/>
- <polygon fill="#8c7a70" fill-opacity="0.35514504" points="117,393 69,248 56,238 33,231 29,235 26,264 32,342 -22,370"/>
- <polygon fill="#c4982d" fill-opacity="0.024424434" points="200,45 200,20 332,42 350,26 392,28 429,186 143,39 95,-2"/>
- <polygon fill="#f1ebdf" fill-opacity="0.7863264" points="263,234 278,253 274,274 300,295 306,310 306,334 347,378 261,378"/>
- <polygon fill="#fff4e7" fill-opacity="0.8184294" points="25,367 43,367 123,389 154,471 112,475 0,474 -19,341"/>
- <polygon fill="#005cbb" fill-opacity="0.15973163" points="0,29 364,95 380,89 415,20 461,0 64,0 0,0"/>
- <polygon fill="#2abbff" fill-opacity="0.063178" points="536,247 423,212 436,207 401,198 369,204 322,305 393,311 543,291"/>
- <polygon fill="#5bffda" fill-opacity="0.033240438" points="172,62 195,83 56,112 76,123 143,150 143,163 190,176 188,171"/>
- <polygon fill="#280003" fill-opacity="0.11466557" points="270,228 226,214 203,219 290,231 284,237 264,250 235,277 212,277"/>
- <polygon fill="#103c6d" fill-opacity="0.56149167" points="411,358 419,358 430,346 445,350 500,330 437,313 404,324 363,329"/>
- <polygon fill="#e5f3ff" fill-opacity="0.25179726" points="150,86 168,86 168,79 230,79 280,100 286,105 311,119 332,152"/>
- <polygon fill="#101811" fill-opacity="0.31911975" points="73,261 74,286 65,309 68,272 77,314 75,339 52,344 52,311"/>
- <polygon fill="#ffffff" fill-opacity="0.21660334" points="76,315 76,280 155,349 162,367 168,356 168,350 297,400 214,455"/>
- <polygon fill="#010000" fill-opacity="0.06297612" points="293,474 239,429 160,430 159,472 121,378 235,364 119,474"/>
- <polygon fill="#2b0e00" fill-opacity="0.07788789" points="473,422 457,434 472,442 492,422 610,451 595,464 573,383 558,372"/>
- <polygon fill="#2964ae" fill-opacity="0.23514736" points="368,0 212,68 288,104 342,156 342,117 342,114 349,102 119,0"/>
- <polygon fill="#7da4d1" fill-opacity="0.10051185" points="91,153 101,145 86,145 70,108 95,89 46,63 140,33 167,33"/>
- <polygon fill="#f7e4c8" fill-opacity="0.5224825" points="318,313 334,317 315,317 328,341 369,375 370,346 370,200"/>
- <polygon fill="#abb4cc" fill-opacity="0.08784026" points="378,226 424,293 570,263 606,267 616,267 636,267 636,239 618,237"/>
- <polygon fill="#afa193" fill-opacity="0.9906069" points="229,362 171,365 168,365 145,365 168,407 243,401 264,398 262,371"/>
- <polygon fill="#682403" fill-opacity="0.13734454" points="371,216 339,240 362,240"/>
- <polygon fill="#ffe859" fill-opacity="0.028483272" points="166,82 150,90 84,95 -13,51 -13,80 11,98 2,124 9,233"/>
- <polygon fill="#668fc0" fill-opacity="0.72673917" points="226,82 387,109 410,83 442,71 608,81 625,48 608,48 543,28"/>
- <polygon fill="#42422c" fill-opacity="0.14709407" points="369,233 369,240 257,246 172,281 245,229 236,227 207,227 168,218"/>
- <polygon fill="#71c5ff" fill-opacity="0.07877964" points="129,44 407,225 505,227 474,237 482,264 414,283 375,226 274,159"/>
- <polygon fill="#e7d8c3" fill-opacity="0.3083914" points="274,364 267,400 224,391 224,414 129,432 192,464 303,472 180,364"/>
- <polygon fill="#0d1715" fill-opacity="0.28411108" points="167,408 167,399 167,392 231,397 237,397 250,398 253,400"/>
- <polygon fill="#184879" fill-opacity="0.9692565" points="489,330 596,371 644,364 636,307 636,288 402,322"/>
- <polygon fill="#efb685" fill-opacity="0.3468396" points="279,214 276,276 199,268 199,280 171,269 179,264 188,220 179,212"/>
- <polygon fill="#000d1c" fill-opacity="0.73232055" points="205,274 206,308 194,364 163,364 160,353 160,301 160,273 186,259"/>
- <polygon fill="#1c0000" fill-opacity="0.035016418" points="648,402 648,434 618,495 566,474 575,472 544,478 617,381"/>
- <polygon fill="#0881ff" fill-opacity="0.08625221" points="5,14 27,22 271,135 254,152 254,204 271,216 355,206 313,135"/>
- <polygon fill="#7d5e64" fill-opacity="0.11712104" points="141,92 138,60 139,65 127,46 127,29 177,50 207,72"/>
- <polygon fill="#d4d6c1" fill-opacity="0.516291" points="358,312 330,328 316,344 307,332 319,351 319,307"/>
- <polygon fill="#82622d" fill-opacity="0.10050529" points="107,305 65,310 98,337 108,356 146,451 179,441 176,425 140,338"/>
- <polygon fill="#9ea1ab" fill-opacity="0.086396575" points="588,319 476,253 476,229 636,235 659,286 628,312 588,312 588,273"/>
- <polygon fill="#ffdf94" fill-opacity="0.2467069" points="180,79 216,79 213,52 213,40 218,44 204,16 199,37 199,86"/>
- <polygon fill="#4089c0" fill-opacity="0.13470078" points="4,67 102,120 244,173 156,279 195,271 173,126 204,139 195,5"/>
- <polygon fill="#0069bb" fill-opacity="0.31018734" points="193,211 269,212 299,210 300,193 183,104 117,116 97,129 157,202"/>
- <polygon fill="#889ebc" fill-opacity="0.078986585" points="567,219 39,374 372,250"/>
- <polygon fill="#ffffef" fill-opacity="0.6970286" points="223,407 149,409 107,385 61,371 -57,353 -65,412 2,445 35,461"/>
- <polygon fill="#402c1b" fill-opacity="0.19630206" points="332,291 337,319 322,322 322,347 337,347 332,330 303,300 303,291"/>
- <polygon fill="#ff4e43" fill-opacity="0.020634592" points="121,-9 204,68 260,187 206,187 212,194 217,163 1,211 -15,206"/>
- <polygon fill="#31241b" fill-opacity="0.1992935" points="209,36 198,40 187,36 210,63 156,85 187,79 172,79 197,79"/>
- <polygon fill="#716868" fill-opacity="0.7120346" points="84,342 113,369 141,387 164,391 165,379 168,410 85,378 22,363"/>
- <polygon fill="#f07200" fill-opacity="0.14301288" points="198,23 203,24 219,40 199,51 195,56"/>
- <polygon fill="#70e860" fill-opacity="0.01626867" points="127,36 282,152 197,201 197,190 210,171 112,55"/>
- <polygon fill="#020023" fill-opacity="0.035071433" points="308,417 424,401 420,409 419,420 360,488 348,474 276,476 256,417"/>
- <polygon fill="#9a0219" fill-opacity="0.016957939" points="81,289 446,301 544,302 544,255 449,223 449,236 435,236 405,214"/>
- <polygon fill="#4e6228" fill-opacity="0.01084125" points="338,253 45,237 350,379 356,374 322,297"/>
- <polygon fill="#143e6d" fill-opacity="0.9261544" points="546,353 599,325 659,340 640,346 688,349 620,370 602,372 584,372"/>
- <polygon fill="#1365e7" fill-opacity="0.064062" points="551,0 582,0 598,17 601,78 522,131 407,95 407,0"/>
- <polygon fill="#a4257f" fill-opacity="0.021203816" points="51,-3 108,23 110,-14 174,34 190,21 346,21 360,137"/>
- <polygon fill="#b2a290" fill-opacity="0.9806012" points="255,270 178,261 128,284 128,233 234,233 234,268 197,261 210,288"/>
+ <polygon fill="#527eb6" fill-opacity="0.8821569" points="-6,464 0,0 636,0 636,443 632,467 636,427 636,388"/>
+ <polygon fill="#bcb9ac" fill-opacity="0.1245355" points="29,103 2,103 -22,247 23,262 23,328 81,321 51,290 504,346"/>
+ <polygon fill="#004686" fill-opacity="0.48589903" points="159,110 254,164 329,164 353,204 376,179 636,190 636,365 532,385"/>
+ <polygon fill="#fbf0e1" fill-opacity="0.8955908" points="124,477 636,474 604,474 279,474 66,474 651,496 695,397 304,210"/>
+ <polygon fill="#fff8ee" fill-opacity="0.6362228" points="117,276 251,265 268,198 299,238 358,238 288,288 296,229 125,226"/>
+ <polygon fill="#0a2747" fill-opacity="0.8110532" points="641,324 538,323 507,323 497,341 520,339 532,337 573,376 616,371"/>
+ <polygon fill="#fff8ea" fill-opacity="0.7516805" points="222,436 187,370 275,379 264,424 418,399 431,428 439,373 376,336"/>
+ <polygon fill="#0a2e58" fill-opacity="0.82357013" points="355,313 365,321 382,325 377,332 377,296 508,315 472,349 401,357"/>
+ <polygon fill="#1c0400" fill-opacity="0.22464263" points="323,523 333,499 368,499 355,461 354,469 361,459 373,449 252,467"/>
+ <polygon fill="#47392e" fill-opacity="0.367074" points="656,380 340,460 410,504 461,484 636,474 636,320 625,320 585,324"/>
+ <polygon fill="#c3a997" fill-opacity="0.99686825" points="384,210 357,239 270,246 278,257 278,238 270,213 315,210 350,203"/>
+ <polygon fill="#1f0900" fill-opacity="0.84314954" points="305,265 305,341 322,335 304,347 325,347 351,347 337,347 337,284"/>
+ <polygon fill="#d17122" fill-opacity="0.14035374" points="91,508 119,486 26,456 26,435 194,412 218,290 218,253 433,171"/>
+ <polygon fill="#dda6b6" fill-opacity="0.11300081" points="457,200 435,194 436,158 403,155 407,135 494,111 643,118 626,192"/>
+ <polygon fill="#fff7db" fill-opacity="0.23841059" points="379,63 -62,419 -17,457 363,462 336,460 359,473 439,476 364,461"/>
+ <polygon fill="#002e57" fill-opacity="0.6878403" points="157,272 160,377 213,361 270,365 187,400 259,400 87,136 67,167"/>
+ <polygon fill="#ffffff" fill-opacity="0.25110412" points="204,63 331,68 370,327 450,402 270,422 333,266 357,221 68,268"/>
+ <polygon fill="#fffef7" fill-opacity="0.8868028" points="525,326 537,350 584,378 571,392 442,426 429,426 437,372 412,359"/>
+ <polygon fill="#153e6f" fill-opacity="0.9594174" points="54,187 92,135 116,228 22,211 25,244 27,349 0,352 -48,181"/>
+ <polygon fill="#000000" fill-opacity="0.32339317" points="346,319 257,327 308,341 291,282 269,272 203,310 174,234 134,432"/>
+ <polygon fill="#000003" fill-opacity="0.1656084" points="101,120 298,161 176,367 159,234 145,226 149,406 49,401 55,195"/>
+ <polygon fill="#c3a688" fill-opacity="0.9544353" points="206,177 206,272 260,272 306,337 255,382 189,362 209,399 206,349"/>
+ <polygon fill="#f3b36b" fill-opacity="0.40605885" points="167,421 27,410 25,222 39,229 103,221 182,173 180,244 153,292"/>
+ <polygon fill="#060500" fill-opacity="0.043604553" points="585,352 606,293 502,258 492,267 547,319 581,367 497,338 191,-3"/>
+ <polygon fill="#eae3e0" fill-opacity="0.9955769" points="222,213 231,215 239,215 289,214 277,211 253,211 245,211 245,212"/>
+ <polygon fill="#afe0ff" fill-opacity="0.13803494" points="203,60 259,106 183,-6 253,-33 640,-3 664,56 371,221 208,484"/>
+ <polygon fill="#b3aba4" fill-opacity="0.9380974" points="24,232 26,292 53,332 47,272 118,212 32,211"/>
+ <polygon fill="#070000" fill-opacity="0.5065603" points="317,257 334,264 338,286 298,324 303,325 337,298 307,350 307,264"/>
+ <polygon fill="#0a2341" fill-opacity="0.5703724" points="-44,286 -81,481 48,456 100,371 62,298 51,333 60,334 86,307"/>
+ <polygon fill="#beb19e" fill-opacity="0.6769769" points="16,219 158,362 180,259 223,208 154,200 61,227 38,223 29,207"/>
+ <polygon fill="#003970" fill-opacity="0.93151104" points="233,159 188,130 148,123 88,133 74,212 222,213 241,193 210,183"/>
+ <polygon fill="#eaddd0" fill-opacity="0.77400035" points="319,278 316,285 274,276 374,325 378,326 303,309 293,321 331,317"/>
+ <polygon fill="#2d7bbe" fill-opacity="0.45693696" points="217,214 66,-65 338,208"/>
+ <polygon fill="#e8d9b2" fill-opacity="0.42931044" points="72,305 26,297 26,356 -10,358 61,372 107,385 121,428 -5,384"/>
+ <polygon fill="#eeede6" fill-opacity="0.49585837" points="305,342 350,346 369,337 369,372 337,370 333,366 351,353 381,303"/>
+ <polygon fill="#d5e5ff" fill-opacity="0.0990324" points="11,74 31,75 56,179 78,155 519,201 636,201 636,107 396,84"/>
+ <polygon fill="#1f5285" fill-opacity="0.99493414" points="373,335 370,321 370,309 370,294 370,229 468,275 544,335 404,343"/>
+ <polygon fill="#99b0c8" fill-opacity="0.5263347" points="382,34 373,185 365,188 624,182 644,193 652,69 568,64 382,65"/>
+ <polygon fill="#60483a" fill-opacity="0.18851942" points="467,391 418,404 426,420 402,442 438,446 461,468 480,426 554,406"/>
+ <polygon fill="#3c2103" fill-opacity="0.07270974" points="318,349 327,344 349,308 380,225 285,225"/>
+ <polygon fill="#030403" fill-opacity="0.058624685" points="443,324 340,339 336,345 315,345 319,306 315,304 309,293 309,247"/>
+ <polygon fill="#006bff" fill-opacity="0.080927074" points="0,144 0,64 0,0 636,0 636,161 636,92 472,80 250,212"/>
+ <polygon fill="#e1d3bb" fill-opacity="0.5594906" points="155,236 319,248 372,268 319,266 319,297 319,298 317,311 352,271"/>
+ <polygon fill="#8aed8c" fill-opacity="0.013245642" points="83,71 403,34 439,152 351,237 305,294 352,314 414,293 412,272"/>
+ <polygon fill="#92c0fb" fill-opacity="0.2188108" points="277,67 634,63 319,17 176,23 121,107 146,135 308,197 413,282"/>
+ <polygon fill="#225086" fill-opacity="0.7066666" points="374,212 358,202 353,191 353,181 392,183 432,186 385,223 385,257"/>
+ <polygon fill="#8c7b6a" fill-opacity="0.35514504" points="127,408 58,232 39,231 33,231 32,206 25,250 32,342 -23,366"/>
+ <polygon fill="#f2e8dc" fill-opacity="0.8287191" points="263,234 278,257 274,274 301,288 306,310 306,334 348,376 261,397"/>
+ <polygon fill="#fff6e5" fill-opacity="0.8184294" points="25,367 43,368 123,389 154,471 112,475 0,474 -19,341"/>
+ <polygon fill="#79fff5" fill-opacity="0.03758371" points="163,70 195,83 64,113 81,134 151,154 154,159 141,170 190,176"/>
+ <polygon fill="#0b0000" fill-opacity="0.08006579" points="493,450 483,530 520,523 520,442 467,458 517,424 542,403 485,415"/>
+ <polygon fill="#2d0000" fill-opacity="0.15968978" points="276,213 225,216 203,219 284,231 277,237 264,250 240,283 229,255"/>
+ <polygon fill="#114171" fill-opacity="0.6863817" points="411,358 438,350 430,350 445,350 520,327 427,307 404,324 363,329"/>
+ <polygon fill="#e5feff" fill-opacity="0.23847443" points="156,88 168,79 230,79 280,100 305,119 316,126 334,158"/>
+ <polygon fill="#04030b" fill-opacity="0.0773803" points="278,485 223,416 160,429 159,472 119,361 178,389 235,364 119,474"/>
+ <polygon fill="#087dff" fill-opacity="0.09701681" points="4,13 26,21 272,136 229,199 256,207 273,218 356,207 317,133"/>
+ <polygon fill="#fff9f0" fill-opacity="0.74856037" points="223,407 149,409 107,385 61,371 -57,352 -65,412 -11,469 35,461"/>
+ <polygon fill="#030700" fill-opacity="0.32000005" points="73,261 74,286 50,320 68,272 77,314 75,352 52,344 52,311"/>
+ <polygon fill="#7e5858" fill-opacity="0.120135486" points="139,92 138,61 115,29 116,31 117,27 166,39 202,70 207,72"/>
+ <polygon fill="#0057b0" fill-opacity="0.15973163" points="0,55 130,53 364,95 394,70 411,10 493,0 64,0 0,0"/>
+ <polygon fill="#ffffff" fill-opacity="0.23961169" points="76,315 76,280 149,350 180,392 163,386 163,350 291,392 207,454"/>
+ <polygon fill="#311e05" fill-opacity="0.07788789" points="491,410 457,434 472,442 492,422 593,446 576,448 576,383 533,382"/>
+ <polygon fill="#2969ae" fill-opacity="0.23514736" points="383,-27 307,27 196,61 288,104 343,156 341,114 332,93 78,-6"/>
+ <polygon fill="#ea9871" fill-opacity="0.024424434" points="128,31 324,40 383,40 373,74 388,103 439,173 412,215 173,28"/>
+ <polygon fill="#21ccff" fill-opacity="0.063178" points="558,228 459,228 459,204 397,200 369,204 322,305 393,305 543,291"/>
+ <polygon fill="#f6e4c9" fill-opacity="0.5392759" points="318,313 323,301 315,317 328,341 360,364 369,367 370,346 370,200"/>
+ <polygon fill="#afa18d" fill-opacity="0.9906069" points="220,363 171,365 147,364 147,337 168,407 243,401 264,398 262,371"/>
+ <polygon fill="#648fbd" fill-opacity="0.65933967" points="226,82 249,87 369,111 410,83 467,64 623,85 651,53 515,20"/>
+ <polygon fill="#e3dbc9" fill-opacity="0.519605" points="366,308 330,328 335,335 321,337 316,344 307,332 319,351 319,308"/>
+ <polygon fill="#b4adcc" fill-opacity="0.08784026" points="378,226 424,293 550,279 550,269 606,267 634,275 660,237 618,237"/>
+ <polygon fill="#ecddc9" fill-opacity="0.3083914" points="274,364 267,400 224,391 224,414 129,432 129,473 303,467 180,364"/>
+ <polygon fill="#0e1218" fill-opacity="0.28411108" points="167,408 167,392 181,394 234,398 250,398 255,398 253,400"/>
+ <polygon fill="#3e290a" fill-opacity="0.15588593" points="369,233 369,240 257,246 167,297 179,233 254,228 198,228 168,218"/>
+ <polygon fill="#623209" fill-opacity="0.12871855" points="375,227 369,220 358,225 339,240 362,240"/>
+ <polygon fill="#9a0219" fill-opacity="0.016957939" points="30,309 282,306 550,300 552,254 433,216 456,240 438,233 202,193"/>
+ <polygon fill="#194979" fill-opacity="0.97955346" points="482,329 549,352 604,370 636,367 651,387 651,290 573,299 413,313"/>
+ <polygon fill="#e6c394" fill-opacity="0.37039268" points="279,214 276,276 207,270 199,268 199,280 172,271 188,220 179,212"/>
+ <polygon fill="#000916" fill-opacity="0.71751827" points="205,274 206,308 194,364 163,364 160,353 160,301 160,273 182,253"/>
+ <polygon fill="#0c0000" fill-opacity="0.038740396" points="663,395 618,495 591,482 571,467 582,479 575,472 544,478 587,383"/>
+ <polygon fill="#774606" fill-opacity="0.11659342" points="109,308 70,315 90,329 142,384 139,442 163,440 178,440 138,337"/>
+ <polygon fill="#94a1af" fill-opacity="0.086396575" points="588,319 476,253 476,230 636,235 661,295 628,312 588,312 588,273"/>
+ <polygon fill="#7da6c7" fill-opacity="0.10051185" points="106,133 88,144 77,147 90,112 90,86 36,69 141,32 168,32"/>
+ <polygon fill="#ffffba" fill-opacity="0.2467069" points="199,71 216,79 206,33 214,39 218,44 204,16 199,37 199,86"/>
+ <polygon fill="#3d2308" fill-opacity="0.19085747" points="332,291 337,319 322,322 322,347 337,347 332,330 303,301 303,291"/>
+ <polygon fill="#120800" fill-opacity="0.22908896" points="209,36 198,40 208,64 187,75 138,89 187,79 172,79 197,79"/>
+ <polygon fill="#4e8fc0" fill-opacity="0.13470078" points="7,56 103,76 110,136 261,173 155,278 201,276 171,126 193,4"/>
+ <polygon fill="#0069bb" fill-opacity="0.30127662" points="187,211 269,212 299,210 300,192 183,104 117,116 97,129 154,203"/>
+ <polygon fill="#9da4bc" fill-opacity="0.078986585" points="567,219 58,369 376,244"/>
+ <polygon fill="#ff4e67" fill-opacity="0.020634592" points="122,4 230,50 258,188 226,188 195,139 193,123 19,216 -21,189"/>
+ <polygon fill="#7c107f" fill-opacity="0.021203816" points="41,-10 107,19 101,-32 170,37 201,37 201,20 279,19 359,136"/>
+ <polygon fill="#ffee61" fill-opacity="0.05163181" points="145,95 65,95 -34,56 -11,119 -15,162 -76,178 18,203 18,232"/>
+ <polygon fill="#6d6b65" fill-opacity="0.68804014" points="84,342 113,369 152,393 164,391 171,399 168,410 85,378 44,368"/>
+ <polygon fill="#d37200" fill-opacity="0.20887613" points="196,25 210,21 207,25 218,44 217,42 205,49 212,50 196,51"/>
+ <polygon fill="#184a18" fill-opacity="0.020394385" points="335,256 165,243 46,239 282,364 361,376 366,371 344,350 319,300"/>
+ <polygon fill="#a8c085" fill-opacity="0.026920855" points="131,55 264,119 308,177 197,201 200,169 215,197 215,159 98,73"/>
+ <polygon fill="#020d2f" fill-opacity="0.04288435" points="304,417 424,401 424,421 352,499 348,474 280,494 256,481 248,426"/>
+ <polygon fill="#17406b" fill-opacity="0.990161" points="535,347 599,325 698,347 641,365 635,367 616,371 579,372"/>
+ <polygon fill="#81b5ff" fill-opacity="0.08510113" points="407,225 505,225 500,227 474,231 482,264 414,283 373,220 254,153"/>
+ <polygon fill="#004af1" fill-opacity="0.064062" points="555,0 586,0 642,-39 642,-7 605,92 525,130 400,90 404,0"/>
+ <polygon fill="#b09f90" fill-opacity="0.98513603" points="255,270 178,261 115,300 111,233 245,235 258,272 197,261 210,288"/>
</g>
</svg>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-05 13:11:17
|
Revision: 230
http://polycasso.svn.sourceforge.net/polycasso/?rev=230&view=rev
Author: dbrosius
Date: 2011-07-05 13:11:09 +0000 (Tue, 05 Jul 2011)
Log Message:
-----------
add another image
Modified Paths:
--------------
trunk/polycasso/htdocs/index.shtml
Added Paths:
-----------
trunk/polycasso/htdocs/images/polyplane.png
trunk/polycasso/htdocs/oia.svg
Removed Paths:
-------------
trunk/polycasso/htdocs/images/polyplane.png
Deleted: trunk/polycasso/htdocs/images/polyplane.png
===================================================================
(Binary files differ)
Copied: trunk/polycasso/htdocs/images/polyplane.png (from rev 54, trunk/polycasso/htdocs/images/polyplane.png)
===================================================================
(Binary files differ)
Modified: trunk/polycasso/htdocs/index.shtml
===================================================================
--- trunk/polycasso/htdocs/index.shtml 2010-10-03 06:26:26 UTC (rev 229)
+++ trunk/polycasso/htdocs/index.shtml 2011-07-05 13:11:09 UTC (rev 230)
@@ -30,6 +30,10 @@
width: 400,
height: 358
};
+ svgs[6] = { url: 'oia.svg',
+ width: 636,
+ height: 474
+ };
function setSample()
{
Added: trunk/polycasso/htdocs/oia.svg
===================================================================
--- trunk/polycasso/htdocs/oia.svg (rev 0)
+++ trunk/polycasso/htdocs/oia.svg 2011-07-05 13:11:09 UTC (rev 230)
@@ -0,0 +1,106 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="636px" height="474px" version="1.2">
+ <!-- generated by Polycasso (http://polycasso.sourceforge.net) -->
+ <rect x="0" y="0" width="636px" height="474px" fill="black"/>
+ <g comp-op="src-over">
+ <polygon fill="#527eb6" fill-opacity="0.8821569" points="0,466 0,0 636,0 636,443 626,465 636,438 636,387"/>
+ <polygon fill="#fffeae" fill-opacity="0.34326494" points="143,265 251,263 249,279 241,305 269,195 289,229 125,226"/>
+ <polygon fill="#f3d39d" fill-opacity="0.1245355" points="5,91 -46,91 -45,275 -35,319 47,319 47,296 82,293 544,346"/>
+ <polygon fill="#00498a" fill-opacity="0.47304904" points="250,160 324,166 360,181 647,191 647,364 548,383 418,342 412,322"/>
+ <polygon fill="#fbf2e1" fill-opacity="0.8955908" points="124,477 636,474 604,474 279,474 66,474 651,496 676,392 304,210"/>
+ <polygon fill="#002147" fill-opacity="0.8219358" points="601,322 551,325 518,323 532,337 573,376 616,371"/>
+ <polygon fill="#fff8e8" fill-opacity="0.7516805" points="297,389 292,415 334,413 418,399 440,371 373,344"/>
+ <polygon fill="#07305c" fill-opacity="0.85675585" points="355,313 374,330 357,316 433,316 488,330 488,335 472,349 401,357"/>
+ <polygon fill="#211105" fill-opacity="0.2271384" points="323,523 333,499 372,522 356,465 361,459 373,449 252,467"/>
+ <polygon fill="#40372b" fill-opacity="0.37279248" points="656,380 340,460 410,504 461,484 636,474 636,318 605,318 614,339"/>
+ <polygon fill="#bfa98b" fill-opacity="0.96050984" points="384,210 357,239 270,246 278,257 278,238 270,213 321,209 350,203"/>
+ <polygon fill="#240800" fill-opacity="0.84314954" points="305,265 305,341 314,337 304,347 325,347 351,347 337,347 337,284"/>
+ <polygon fill="#dd7100" fill-opacity="0.14035374" points="92,506 108,472 36,460 95,380 194,412 215,293 203,269 433,171"/>
+ <polygon fill="#ffebdb" fill-opacity="0.23841059" points="379,63 -62,419 -17,457 348,461 336,460 369,477 439,476 364,461"/>
+ <polygon fill="#002e4d" fill-opacity="0.6878403" points="157,281 160,377 210,365 270,365 184,396 259,400 87,136 67,167"/>
+ <polygon fill="#ffffff" fill-opacity="0.25110412" points="204,63 331,68 370,327 450,402 271,421 333,266 357,221 78,257"/>
+ <polygon fill="#fffef8" fill-opacity="0.88262403" points="536,323 537,350 584,378 571,392 448,425 439,424 433,384 409,360"/>
+ <polygon fill="#4d150f" fill-opacity="0.07270974" points="319,355 298,381 317,349 323,347 356,327 368,240 380,225 285,225"/>
+ <polygon fill="#030000" fill-opacity="0.32339317" points="346,319 272,327 308,341 294,295 270,274 201,294 168,238 141,424"/>
+ <polygon fill="#15406f" fill-opacity="0.9594174" points="54,187 81,152 119,226 22,211 26,280 26,321 -3,350 -64,180"/>
+ <polygon fill="#66523f" fill-opacity="0.18851942" points="468,389 409,414 421,414 402,442 434,438 461,468 482,433 536,405"/>
+ <polygon fill="#000003" fill-opacity="0.1656084" points="173,136 299,160 177,368 163,268 145,239 153,402 48,374 58,183"/>
+ <polygon fill="#c7a688" fill-opacity="0.90780896" points="206,177 206,272 265,272 306,337 255,382 189,362 209,399 206,349"/>
+ <polygon fill="#f2b568" fill-opacity="0.42614853" points="177,411 30,352 24,258 186,173 181,180 182,248 151,290"/>
+ <polygon fill="#e7e5e0" fill-opacity="0.7942253" points="237,215 239,215 289,214 268,209 244,214 253,212 253,213 244,209"/>
+ <polygon fill="#a9e0ff" fill-opacity="0.13803494" points="203,60 252,93 204,13 238,-44 640,-3 656,50 371,221 208,484"/>
+ <polygon fill="#b9a8a3" fill-opacity="0.9234007" points="25,250 26,279 26,292 56,292 38,284 118,212 32,211"/>
+ <polygon fill="#0a0500" fill-opacity="0.043604553" points="567,335 586,288 519,253 479,253 545,319 569,362 502,341 195,10"/>
+ <polygon fill="#000000" fill-opacity="0.44773823" points="317,257 335,267 338,286 309,317 317,318 337,298 307,350 307,264"/>
+ <polygon fill="#0a2439" fill-opacity="0.6208018" points="-67,286 -73,398 71,377 105,379 62,298 51,333 60,334 86,307"/>
+ <polygon fill="#bbb1a0" fill-opacity="0.63494784" points="17,220 158,357 176,271 214,186 209,187 128,210 70,218 30,208"/>
+ <polygon fill="#003d77" fill-opacity="0.9643223" points="233,159 188,130 158,122 88,133 74,212 222,213 233,194 209,182"/>
+ <polygon fill="#f3e5d1" fill-opacity="0.6649984" points="316,279 316,285 270,272 365,321 303,309 303,320 331,317"/>
+ <polygon fill="#2d76bf" fill-opacity="0.45693696" points="217,214 68,-66 336,207"/>
+ <polygon fill="#eddbb8" fill-opacity="0.4335037" points="72,305 26,297 26,356 -10,358 61,372 66,378 50,378 -5,384"/>
+ <polygon fill="#f7ffe3" fill-opacity="0.44648564" points="305,342 342,346 342,350 346,385 346,380 337,361 381,303"/>
+ <polygon fill="#ffffff" fill-opacity="0.0990324" points="26,76 57,147 59,178 78,151 518,200 635,200 665,110 395,85"/>
+ <polygon fill="#1f4f84" fill-opacity="0.99493414" points="371,336 370,309 370,294 370,229 488,284 544,335 402,344"/>
+ <polygon fill="#a89cb8" fill-opacity="0.12710965" points="463,200 436,193 430,166 391,125 393,131 511,118 617,118 599,197"/>
+ <polygon fill="#981427" fill-opacity="0.0065020323" points="-6,28 -14,-2 -14,-14 94,-14 130,186 130,327 117,300 98,219"/>
+ <polygon fill="#99b0c8" fill-opacity="0.51232594" points="382,34 373,185 365,188 624,182 644,193 644,63 569,66 382,66"/>
+ <polygon fill="#031703" fill-opacity="0.058624685" points="443,324 343,339 336,345 315,345 307,247"/>
+ <polygon fill="#006bff" fill-opacity="0.080927074" points="19,156 -21,81 0,0 636,0 636,157 641,100 476,81 269,205"/>
+ <polygon fill="#8aed8c" fill-opacity="0.013245642" points="76,73 405,36 351,237 305,294 366,317 404,289 404,270"/>
+ <polygon fill="#1c4584" fill-opacity="0.5685098" points="357,197 353,191 352,184 384,183 432,186 392,218 410,242"/>
+ <polygon fill="#89b9f6" fill-opacity="0.23950595" points="274,68 642,64 335,18 175,22 120,106 145,134 292,189 418,291"/>
+ <polygon fill="#e1ccb3" fill-opacity="0.5660151" points="155,237 335,262 372,268 319,266 319,297 317,311 352,271"/>
+ <polygon fill="#8c7a70" fill-opacity="0.35514504" points="117,393 69,248 56,238 33,231 29,235 26,264 32,342 -22,370"/>
+ <polygon fill="#c4982d" fill-opacity="0.024424434" points="200,45 200,20 332,42 350,26 392,28 429,186 143,39 95,-2"/>
+ <polygon fill="#f1ebdf" fill-opacity="0.7863264" points="263,234 278,253 274,274 300,295 306,310 306,334 347,378 261,378"/>
+ <polygon fill="#fff4e7" fill-opacity="0.8184294" points="25,367 43,367 123,389 154,471 112,475 0,474 -19,341"/>
+ <polygon fill="#005cbb" fill-opacity="0.15973163" points="0,29 364,95 380,89 415,20 461,0 64,0 0,0"/>
+ <polygon fill="#2abbff" fill-opacity="0.063178" points="536,247 423,212 436,207 401,198 369,204 322,305 393,311 543,291"/>
+ <polygon fill="#5bffda" fill-opacity="0.033240438" points="172,62 195,83 56,112 76,123 143,150 143,163 190,176 188,171"/>
+ <polygon fill="#280003" fill-opacity="0.11466557" points="270,228 226,214 203,219 290,231 284,237 264,250 235,277 212,277"/>
+ <polygon fill="#103c6d" fill-opacity="0.56149167" points="411,358 419,358 430,346 445,350 500,330 437,313 404,324 363,329"/>
+ <polygon fill="#e5f3ff" fill-opacity="0.25179726" points="150,86 168,86 168,79 230,79 280,100 286,105 311,119 332,152"/>
+ <polygon fill="#101811" fill-opacity="0.31911975" points="73,261 74,286 65,309 68,272 77,314 75,339 52,344 52,311"/>
+ <polygon fill="#ffffff" fill-opacity="0.21660334" points="76,315 76,280 155,349 162,367 168,356 168,350 297,400 214,455"/>
+ <polygon fill="#010000" fill-opacity="0.06297612" points="293,474 239,429 160,430 159,472 121,378 235,364 119,474"/>
+ <polygon fill="#2b0e00" fill-opacity="0.07788789" points="473,422 457,434 472,442 492,422 610,451 595,464 573,383 558,372"/>
+ <polygon fill="#2964ae" fill-opacity="0.23514736" points="368,0 212,68 288,104 342,156 342,117 342,114 349,102 119,0"/>
+ <polygon fill="#7da4d1" fill-opacity="0.10051185" points="91,153 101,145 86,145 70,108 95,89 46,63 140,33 167,33"/>
+ <polygon fill="#f7e4c8" fill-opacity="0.5224825" points="318,313 334,317 315,317 328,341 369,375 370,346 370,200"/>
+ <polygon fill="#abb4cc" fill-opacity="0.08784026" points="378,226 424,293 570,263 606,267 616,267 636,267 636,239 618,237"/>
+ <polygon fill="#afa193" fill-opacity="0.9906069" points="229,362 171,365 168,365 145,365 168,407 243,401 264,398 262,371"/>
+ <polygon fill="#682403" fill-opacity="0.13734454" points="371,216 339,240 362,240"/>
+ <polygon fill="#ffe859" fill-opacity="0.028483272" points="166,82 150,90 84,95 -13,51 -13,80 11,98 2,124 9,233"/>
+ <polygon fill="#668fc0" fill-opacity="0.72673917" points="226,82 387,109 410,83 442,71 608,81 625,48 608,48 543,28"/>
+ <polygon fill="#42422c" fill-opacity="0.14709407" points="369,233 369,240 257,246 172,281 245,229 236,227 207,227 168,218"/>
+ <polygon fill="#71c5ff" fill-opacity="0.07877964" points="129,44 407,225 505,227 474,237 482,264 414,283 375,226 274,159"/>
+ <polygon fill="#e7d8c3" fill-opacity="0.3083914" points="274,364 267,400 224,391 224,414 129,432 192,464 303,472 180,364"/>
+ <polygon fill="#0d1715" fill-opacity="0.28411108" points="167,408 167,399 167,392 231,397 237,397 250,398 253,400"/>
+ <polygon fill="#184879" fill-opacity="0.9692565" points="489,330 596,371 644,364 636,307 636,288 402,322"/>
+ <polygon fill="#efb685" fill-opacity="0.3468396" points="279,214 276,276 199,268 199,280 171,269 179,264 188,220 179,212"/>
+ <polygon fill="#000d1c" fill-opacity="0.73232055" points="205,274 206,308 194,364 163,364 160,353 160,301 160,273 186,259"/>
+ <polygon fill="#1c0000" fill-opacity="0.035016418" points="648,402 648,434 618,495 566,474 575,472 544,478 617,381"/>
+ <polygon fill="#0881ff" fill-opacity="0.08625221" points="5,14 27,22 271,135 254,152 254,204 271,216 355,206 313,135"/>
+ <polygon fill="#7d5e64" fill-opacity="0.11712104" points="141,92 138,60 139,65 127,46 127,29 177,50 207,72"/>
+ <polygon fill="#d4d6c1" fill-opacity="0.516291" points="358,312 330,328 316,344 307,332 319,351 319,307"/>
+ <polygon fill="#82622d" fill-opacity="0.10050529" points="107,305 65,310 98,337 108,356 146,451 179,441 176,425 140,338"/>
+ <polygon fill="#9ea1ab" fill-opacity="0.086396575" points="588,319 476,253 476,229 636,235 659,286 628,312 588,312 588,273"/>
+ <polygon fill="#ffdf94" fill-opacity="0.2467069" points="180,79 216,79 213,52 213,40 218,44 204,16 199,37 199,86"/>
+ <polygon fill="#4089c0" fill-opacity="0.13470078" points="4,67 102,120 244,173 156,279 195,271 173,126 204,139 195,5"/>
+ <polygon fill="#0069bb" fill-opacity="0.31018734" points="193,211 269,212 299,210 300,193 183,104 117,116 97,129 157,202"/>
+ <polygon fill="#889ebc" fill-opacity="0.078986585" points="567,219 39,374 372,250"/>
+ <polygon fill="#ffffef" fill-opacity="0.6970286" points="223,407 149,409 107,385 61,371 -57,353 -65,412 2,445 35,461"/>
+ <polygon fill="#402c1b" fill-opacity="0.19630206" points="332,291 337,319 322,322 322,347 337,347 332,330 303,300 303,291"/>
+ <polygon fill="#ff4e43" fill-opacity="0.020634592" points="121,-9 204,68 260,187 206,187 212,194 217,163 1,211 -15,206"/>
+ <polygon fill="#31241b" fill-opacity="0.1992935" points="209,36 198,40 187,36 210,63 156,85 187,79 172,79 197,79"/>
+ <polygon fill="#716868" fill-opacity="0.7120346" points="84,342 113,369 141,387 164,391 165,379 168,410 85,378 22,363"/>
+ <polygon fill="#f07200" fill-opacity="0.14301288" points="198,23 203,24 219,40 199,51 195,56"/>
+ <polygon fill="#70e860" fill-opacity="0.01626867" points="127,36 282,152 197,201 197,190 210,171 112,55"/>
+ <polygon fill="#020023" fill-opacity="0.035071433" points="308,417 424,401 420,409 419,420 360,488 348,474 276,476 256,417"/>
+ <polygon fill="#9a0219" fill-opacity="0.016957939" points="81,289 446,301 544,302 544,255 449,223 449,236 435,236 405,214"/>
+ <polygon fill="#4e6228" fill-opacity="0.01084125" points="338,253 45,237 350,379 356,374 322,297"/>
+ <polygon fill="#143e6d" fill-opacity="0.9261544" points="546,353 599,325 659,340 640,346 688,349 620,370 602,372 584,372"/>
+ <polygon fill="#1365e7" fill-opacity="0.064062" points="551,0 582,0 598,17 601,78 522,131 407,95 407,0"/>
+ <polygon fill="#a4257f" fill-opacity="0.021203816" points="51,-3 108,23 110,-14 174,34 190,21 346,21 360,137"/>
+ <polygon fill="#b2a290" fill-opacity="0.9806012" points="255,270 178,261 128,284 128,233 234,233 234,268 197,261 210,288"/>
+ </g>
+</svg>
Property changes on: trunk/polycasso/htdocs/oia.svg
___________________________________________________________________
Added: svn:mime-type
+ text/svg
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-10-03 06:26:33
|
Revision: 229
http://polycasso.svn.sourceforge.net/polycasso/?rev=229&view=rev
Author: dbrosius
Date: 2010-10-03 06:26:26 +0000 (Sun, 03 Oct 2010)
Log Message:
-----------
check in DEBUG is false
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2010-10-03 05:59:39 UTC (rev 228)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2010-10-03 06:26:26 UTC (rev 229)
@@ -28,7 +28,7 @@
/**
* enable some console debugging, and show the target image
*/
- public static final boolean DEBUG = true;
+ public static final boolean DEBUG = false;
/**
* the main entry point to the web start app
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-10-03 05:59:46
|
Revision: 228
http://polycasso.svn.sourceforge.net/polycasso/?rev=228&view=rev
Author: dbrosius
Date: 2010-10-03 05:59:39 +0000 (Sun, 03 Oct 2010)
Log Message:
-----------
Add Generation/Elite handling, along with breeding and some more improver types. Also mark a change successful if it is something that creates an elite member. Stub in annealing, not used yet.
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
Added Paths:
-----------
trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -0,0 +1,189 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009-2010 MeBigFatGuy.com
+ * Copyright 2009-2010 Dave Brosius
+ * Inspired by work by Roger Alsing
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.mebigfatguy.polycasso;
+
+import java.awt.Dimension;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+
+/**
+ * class that maintains the set of polygon data for this generation of images
+ */
+public class GenerationHandler {
+
+ /**
+ * class that holds a sample set of polygons and it's score
+ */
+ public static class Member implements Comparable<Member> {
+
+ double score;
+ PolygonData[] data;
+
+ Member(double polyScore, PolygonData[] polyData) {
+ score = polyScore;
+ data = polyData;
+ }
+
+ @Override
+ public int compareTo(Member o) {
+ if (score > o.score)
+ return 1;
+ else if (score < o.score)
+ return -1;
+ return 0;
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)score * 1000;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof Member) {
+ return score == ((Member)o).score;
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "(" + score + ": " + Arrays.toString(data) + ")";
+ }
+ }
+
+ private List<Member> generation;
+ private Random random;
+ private Settings settings;
+ private int generationNumber;
+ private double annealingValue;
+ private Member bestMember;
+ private double eliteCutOff;
+ private int generationBests;
+ private int generationElites;
+
+ /**
+ * constructs a handler for managing successive generations of image samples
+ *
+ * @param confSettings settings to use for generation and elite size
+ * @param imageSize the size of the target image
+ */
+ public GenerationHandler(Settings confSettings, Dimension imageSize) {
+ random = new Random();
+ generationNumber = 0;
+ settings = confSettings;
+ bestMember = new Member(Double.MAX_VALUE, new PolygonData[0]);
+ eliteCutOff = Double.MAX_VALUE;
+ generation = new ArrayList<Member>(settings.getGenerationSize() + 10);
+ annealingValue = settings.getStartTemperature() * settings.getStartTemperature() * imageSize.height * imageSize.width;
+ generationBests = 0;
+ generationElites = 0;
+ }
+
+ /**
+ * add a sample polygon set to this generation with a given score
+ *
+ * @param score the deviation from perfection this set calculates
+ *
+ * @param polygonData the polygons that draw the image
+ *
+ * @return whether this is the best polygon set so far
+ */
+ public ImprovementResult addPolygonData(double score, PolygonData[] polygonData) {
+ synchronized(generation) {
+ Member newMember = new Member(score, polygonData);
+ generation.add(newMember);
+ if (generation.size() >= settings.getGenerationSize()) {
+ processGeneration();
+ } else {
+ Collections.sort(generation);
+ }
+ if (score < bestMember.score) {
+ bestMember = newMember;
+ generationBests++;
+ return ImprovementResult.BEST;
+ } else if (score < eliteCutOff) {
+ generationElites++;
+ return ImprovementResult.ELITE;
+ }
+
+ return ImprovementResult.FAIL;
+ }
+ }
+
+ /**
+ * pick a random polygon sample either from the general pool or elite pool
+ * scew the results towards the elite
+ *
+ * @param elite whether to pick from the elite pool or not
+ * @return a random polygon set
+ */
+ public PolygonData[] getRandomPolygonData(boolean elite) {
+ synchronized(generation) {
+ int size = elite ? (settings.getEliteSize() % generation.size()) : generation.size();
+
+ if (size == 0)
+ return null;
+
+ int r = random.nextInt(size);
+
+ int idx = (r * r) / (size * size);
+
+ return generation.get(idx).data;
+ }
+ }
+
+ /**
+ * returns the best polygon set to draw the picture
+ *
+ * @return the best polygon set
+ */
+ public Member getBestMember() {
+ synchronized(generation) {
+ return bestMember;
+ }
+ }
+
+ private void processGeneration() {
+ int eliteSize = settings.getEliteSize();
+
+ Collections.<GenerationHandler.Member>sort(generation);
+ int sz = generation.size();
+
+ List<Member> nextGeneration = new ArrayList<Member>(settings.getGenerationSize() + 10);
+ for (int i = 0; i < eliteSize; i++) {
+ nextGeneration.add(generation.get(i));
+ }
+
+ generation = nextGeneration;
+
+ eliteCutOff = generation.get(eliteSize-1).score;
+
+ if (Polycasso.DEBUG) {
+ System.out.println("Generation " + generationNumber + " had " + generationBests + " bests and " + generationElites + " elites. Best Score: " + generation.get(0).score);
+ }
+ generationBests = 0;
+ generationElites = 0;
+ generationNumber++;
+ annealingValue *= (1.0 - settings.getCoolingRate());
+ }
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/GenerationHandler.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2010-10-03 05:47:22 UTC (rev 227)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -36,20 +36,13 @@
* This class generates multiple images in parallel to keep multicore processors busy.
*/
public class ImageGenerator implements Runnable {
- private static int attempt = 0;
private Set<ImageGeneratedListener> listeners = new HashSet<ImageGeneratedListener>();
private Settings settings;
private BufferedImage targetImage;
- private PolygonData[] bestData;
- private double bestScore = Double.MAX_VALUE;
- private BufferedImage candidateImage;
- private PolygonData[] candidateData;
- private double candidateScore = Double.MAX_VALUE;
- private int candidateStart = 0;
+ private GenerationHandler generationHandler;
private Dimension imageSize;
private Feedback feedback;
private Thread[] t = null;
- private Object lock = new Object();
private Object startStopLock = new Object();
/**
@@ -64,8 +57,8 @@
targetImage = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
Graphics g = targetImage.getGraphics();
g.drawImage(image, 0, 0, imageSize.width, imageSize.height, Color.WHITE, null);
+ generationHandler = new GenerationHandler(settings, imageSize);
feedback = new Feedback(targetImage);
- bestData = new PolygonData[0];
}
/**
@@ -88,16 +81,6 @@
}
/**
- * returns the best polygon data that has been generated thus far
- *
- * @return the array of polygons that are to be rendered
- */
- public PolygonData[] getBestData() {
- synchronized(lock) {
- return bestData.clone();
- }
- }
- /**
* allows interested parties to register to receive events when a new best image has been
* found.
*
@@ -134,11 +117,11 @@
*/
public void startGenerating() {
synchronized(startStopLock) {
- attempt = 0;
if (t == null) {
t = new Thread[Runtime.getRuntime().availableProcessors() + 1];
for (int i = 0; i < t.length; i++) {
t[i] = new Thread(this);
+ t[i].setName("Improver : " + i);
t[i].start();
}
}
@@ -174,13 +157,21 @@
if (t != null) {
stopGenerating();
t = new Thread[1];
- t[0] = new Thread(new ImageCompleter(this, targetImage, bestData, imageSize));
+ t[0] = new Thread(new ImageCompleter(this, targetImage, generationHandler.getBestMember().data, imageSize));
t[0].start();
}
}
}
/**
+ * retrieves the best set of polygons for drawing the image so far
+ *
+ * @return the best set of polygons
+ */
+ public PolygonData[] getBestData() {
+ return generationHandler.getBestMember().data;
+ }
+ /**
* the runnable interface implementation to repeatedly improve upon the image and check to
* see if it is closer to the target image. Images are created in batches of settings.numCompetingImages
* and the best one (if better than the parent) is selected as the new best.
@@ -190,14 +181,9 @@
BufferedImage image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g2d = (Graphics2D)image.getGraphics();
Composite srcOpaque = AlphaComposite.getInstance(AlphaComposite.SRC, 1.0f);
- Improver improver = new Improver(settings, imageSize);
+ Improver improver = new Improver(settings, generationHandler, imageSize);
while (!Thread.interrupted()) {
-
- synchronized(lock) {
- improver.setData(bestData);
- }
-
ImprovementType type = improver.improveRandomly();
g2d.setColor(Color.BLACK);
@@ -211,39 +197,25 @@
double delta = feedback.calculateDelta(image);
- String message = null;
- boolean wasSuccessful = false;
- synchronized(lock) {
- attempt++;
- if (delta < candidateScore) {
+ boolean wasSuccessful;
+
+ ImprovementResult result = generationHandler.addPolygonData(delta, data.toArray(new PolygonData[data.size()]));
+ switch (result) {
+ case BEST:
+ fireImageGenerated(image);
+ wasSuccessful = true;
+ image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
+ g2d = (Graphics2D)image.getGraphics();
+ break;
+
+ case ELITE:
wasSuccessful = true;
- candidateData = data.toArray(new PolygonData[data.size()]);
- candidateScore = delta;
- candidateImage = image;
-
- if (Polycasso.DEBUG)
- message = "Attempt: " + attempt + " CandidateScore: " + candidateScore + " BestScore: " + bestScore + " type: " + type.name();
- }
+ break;
- if ((candidateStart + settings.getNumCompetingImages()) <= attempt) {
- if (candidateScore < bestScore) {
- bestData = candidateData;
- bestScore = candidateScore;
- fireImageGenerated(candidateImage);
- }
- candidateStart = attempt;
- }
+ default:
+ wasSuccessful = false;
}
-
- if (Polycasso.DEBUG) {
- if (message != null)
- System.out.println(message);
- }
- if (wasSuccessful) {
- image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
- g2d = (Graphics2D)image.getGraphics();
- }
improver.typeWasSuccessful(type, wasSuccessful);
}
} catch (Exception e) {
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -0,0 +1,25 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009-2010 MeBigFatGuy.com
+ * Copyright 2009-2010 Dave Brosius
+ * Inspired by work by Roger Alsing
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.mebigfatguy.polycasso;
+
+public enum ImprovementResult {
+ BEST,
+ ELITE,
+ FAIL;
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementResult.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java 2010-10-03 05:47:22 UTC (rev 227)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementType.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -74,8 +74,25 @@
* adjust the transparency of a random existing polygon
*/
ChangeAlpha,
+ /*
+ * change the color to white
+ */
+ White,
+ /*
+ * change the color to black
+ */
+ Black,
/**
+ * combine two sets of polygons
+ */
+ Breed,
+ /**
+ * combine two sets of polygons one from an elite
+ */
+ BreedElite,
+ /**
* completely change all attributes of a random existing polygon
*/
CompleteChange;
+
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2010-10-03 05:47:22 UTC (rev 227)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -29,7 +29,7 @@
*/
public class ImprovementTypeStats {
- private static final int MAX_FAILURE_RUN = 100;
+ private static final int MAX_FAILURE_RUN = 25;
private static class Stats {
public int successes = 1;
public int totals = 1;
@@ -66,11 +66,11 @@
stats.totals++;
failureRun = successful ? 0 : failureRun + 1;
if (failureRun > MAX_FAILURE_RUN) {
-// if (Polycasso.DEBUG){
-// System.out.println("** Stats at time of failure run **");
-// System.out.println(this);
-// System.out.println("**********************************");
-// }
+ if (Polycasso.DEBUG){
+ System.out.println("** Stats at time of failure run **");
+ System.out.println(this);
+ System.out.println("**********************************");
+ }
initStats();
} else {
stats.pct = ((double)stats.successes) / ((double) stats.totals);
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2010-10-03 05:47:22 UTC (rev 227)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Improver.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -22,8 +22,8 @@
import java.awt.Dimension;
import java.awt.Polygon;
import java.awt.Rectangle;
+import java.util.ArrayList;
import java.util.Arrays;
-import java.util.LinkedList;
import java.util.List;
import java.util.Random;
@@ -34,6 +34,7 @@
*/
public class Improver {
private Settings settings;
+ private GenerationHandler generationHandler;
private Dimension imageSize;
private List<PolygonData> polygons = null;
private ImprovementTypeStats stats;
@@ -42,25 +43,18 @@
/**
* create an improver using a specified image size
* @param confSettings the settings to be used
+ * @param genHandler the generation handler
* @param size the size of the image
*/
- public Improver(Settings confSettings, Dimension size) {
+ public Improver(Settings confSettings, GenerationHandler genHandler, Dimension size) {
settings = confSettings;
+ generationHandler = genHandler;
imageSize = size;
stats = new ImprovementTypeStats();
r = new Random();
}
/**
- * sets the new set of polygons by copying them
- *
- * @param data the best set of polygon data so far
- */
- public void setData(PolygonData[] data) {
- polygons = new LinkedList<PolygonData>(Arrays.<PolygonData>asList(data));
- }
-
- /**
* get the list of polygons usually after attempted to be improved
*
* @return the list of polygons
@@ -86,12 +80,16 @@
* @return the improvement type used to alter the data
*/
public ImprovementType improveRandomly() {
- if (polygons.isEmpty()) {
- polygons.add(PolygonData.randomPoly(imageSize, settings.getMaxPoints()));
- return ImprovementType.AddPolygon;
+
+ {
+ PolygonData[] randomData = generationHandler.getRandomPolygonData(false);
+ if (randomData != null)
+ polygons = new ArrayList<PolygonData>(Arrays.asList(randomData.clone()));
+ else
+ polygons = new ArrayList<PolygonData>();
}
- ImprovementType type = stats.getRandomImprovementType();
+ ImprovementType type = (polygons.isEmpty()) ? ImprovementType.AddPolygon : stats.getRandomImprovementType();
switch (type) {
case AddPolygon: {
@@ -292,6 +290,24 @@
}
break;
+ case White: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ pd.setColor(Color.WHITE);
+ pd.setAlpha(1);
+ polygons.set(idx, pd);
+ }
+ break;
+
+ case Black: {
+ int idx = r.nextInt(polygons.size());
+ PolygonData pd = (PolygonData)polygons.get(idx).clone();
+ pd.setColor(Color.BLACK);
+ pd.setAlpha(1);
+ polygons.set(idx, pd);
+ }
+ break;
+
case ChangeAlpha:
int idx = r.nextInt(polygons.size());
PolygonData pd = (PolygonData)polygons.get(idx).clone();
@@ -299,6 +315,36 @@
polygons.set(idx, pd);
break;
+ case Breed: {
+ PolygonData[] copyData = generationHandler.getRandomPolygonData(false);
+ if ((copyData == null) || (copyData.length == 0)) {
+ randomCompleteChange();
+ } else {
+ idx = r.nextInt(copyData.length);
+ if (idx >= polygons.size()) {
+ polygons.add(copyData[idx]);
+ } else {
+ polygons.set(idx, copyData[idx]);
+ }
+ }
+ }
+ break;
+
+ case BreedElite: {
+ PolygonData[] copyData = generationHandler.getRandomPolygonData(true);
+ if ((copyData == null) || (copyData.length == 0)) {
+ randomCompleteChange();
+ } else {
+ idx = r.nextInt(copyData.length);
+ if (idx >= polygons.size()) {
+ polygons.add(copyData[idx]);
+ } else {
+ polygons.set(idx, copyData[idx]);
+ }
+ }
+ }
+ break;
+
case CompleteChange: {
randomCompleteChange();
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2010-10-03 05:47:22 UTC (rev 227)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -222,9 +222,13 @@
dialog.setVisible(true);
if (dialog.isOK()) {
Settings dlgSettings = dialog.getSettings();
+ settings.setGenerationSize(dlgSettings.getGenerationSize());
+ settings.setEliteSize(dlgSettings.getEliteSize());
+ settings.setUseAnnealing(dlgSettings.isUseAnnealing());
+ settings.setStartTemperature(dlgSettings.getStartTemperature());
+ settings.setCoolingRate(dlgSettings.getCoolingRate());
settings.setMaxImageSize(dlgSettings.getMaxImageSize());
settings.setMaxPolygons(dlgSettings.getMaxPolygons());
- settings.setNumCompetingImages(dlgSettings.getNumCompetingImages());
settings.setMaxPoints(dlgSettings.getMaxPoints());
settings.setMaxPtMovement(dlgSettings.getMaxPtMovement());
}
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2010-10-03 05:47:22 UTC (rev 227)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Polycasso.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -28,7 +28,7 @@
/**
* enable some console debugging, and show the target image
*/
- public static final boolean DEBUG = false;
+ public static final boolean DEBUG = true;
/**
* the main entry point to the web start app
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2010-10-03 05:47:22 UTC (rev 227)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -175,4 +175,20 @@
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
g.fillPolygon(polygon);
}
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("(");
+ String sep = "";
+ for (int i = 0; i < polygon.npoints; i++) {
+ sb.append(sep);
+ sep = "|";
+ sb.append(polygon.xpoints[i]);
+ sb.append(",");
+ sb.append(polygon.ypoints[i]);
+ }
+ sb.append(")");
+ return sb.toString();
+ }
}
\ No newline at end of file
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2010-10-03 05:47:22 UTC (rev 227)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -35,7 +35,6 @@
private double startTemperature;
private double coolingRate;
private Dimension maxImageSize;
- private int numCompetingImages;
private int maxPolygons;
private int maxPoints;
private int maxPtMovement;
@@ -45,14 +44,13 @@
* constructs a settings object with rational defaults
*/
public Settings() {
- generationSize = 50;
+ generationSize = 40;
eliteSize = 10;
useAnnealing = true;
- startTemperature = 20;
- coolingRate = 0.1;
+ startTemperature = 1;
+ coolingRate = 0.01;
maxImageSize = new Dimension(800, 600);
maxPolygons = 100;
- numCompetingImages = 20;
maxPoints = 7;
maxPtMovement = 20;
maxColorChange = 40;
@@ -72,19 +70,38 @@
}
}
-
+ /**
+ * sets the generation size
+ *
+ * @param generationSz the size of each generation
+ */
public void setGenerationSize(int generationSz) {
generationSize = generationSz;
}
+ /**
+ * gets the generation size
+ *
+ * @return the generation size
+ */
public int getGenerationSize() {
return generationSize;
}
+ /**
+ * sets the elite size, the number of members that are copied from one generation to another
+ *
+ * @param eliteSz the elite size
+ */
public void setEliteSize(int eliteSz) {
eliteSize = eliteSz;
}
+ /**
+ * gets the elite size, the number of members that are copied from one generation to another
+ *
+ * @return the elite size
+ */
public int getEliteSize() {
return eliteSize;
}
@@ -107,18 +124,38 @@
return useAnnealing;
}
+ /**
+ * sets the error below which polygon samples can be included in a generation, even if not the best
+ *
+ * @param startTemp the pixel error cutoff
+ */
public void setStartTemperature(double startTemp) {
startTemperature = startTemp;
}
+ /**
+ * gets the error below wich polygon samples can be included in a generation, even if not the best
+ *
+ * @return the pixel error cutoff
+ */
public double getStartTemperature() {
return startTemperature;
}
+ /**
+ * sets how quickly the error cutoff decrements each generation
+ *
+ * @param coolRate the cutoff decrementor value
+ */
public void setCoolingRate(double coolRate) {
coolingRate = coolRate;
}
+ /**
+ * gets how quickly the error cutoff decrements each generation
+ *
+ * @return the cutoff decrementor value
+ */
public double getCoolingRate() {
return coolingRate;
}
@@ -142,24 +179,6 @@
}
/**
- * set the number of images that are competing in parallel for the best image
- *
- * @param competingImages number of images
- */
- public void setNumCompetingImages(int competingImages) {
- numCompetingImages = competingImages;
- }
-
- /**
- * gets the number of images that are competing in parallel for the best image
- *
- * @return the number of images
- */
- public int getNumCompetingImages() {
- return numCompetingImages;
- }
-
- /**
* sets the maximum polygons that can be used to image the picture
*
* @param maxPolys the maximum number of polygons
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2010-10-03 05:47:22 UTC (rev 227)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2010-10-03 05:59:39 UTC (rev 228)
@@ -61,7 +61,6 @@
private JTextField widthField;
private JTextField heightField;
private JTextField maxPolygonField;
- private JTextField numCompetingImagesField;
private JTextField maxPolygonPointsField;
private JTextField maxPtMoveField;
private JTextField maxColorChangeField;
@@ -130,7 +129,7 @@
JPanel optPanel = new JPanel();
optPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(PolycassoBundle.getString(PolycassoBundle.Key.ImageOptions)),
BorderFactory.createEmptyBorder(10, 10, 10, 10)));
- optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref"));
+ optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref"));
CellConstraints cc = new CellConstraints();
JLabel maxSizeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaxImageSize));
@@ -159,37 +158,29 @@
maxPolyLabel.setLabelFor(maxPolygonField);
optPanel.add(maxPolygonField, cc.xy(7, 5));
maxPolygonField.addFocusListener(focuser);
-
- JLabel numCompetingImagesLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.NumberOfCompetingImages));
- optPanel.add(numCompetingImagesLabel, cc.xyw(1, 7, 5));
- numCompetingImagesField = new JTextField(4);
- numCompetingImagesField.setDocument(new IntegerDocument());
- numCompetingImagesLabel.setLabelFor(numCompetingImagesField);
- optPanel.add(numCompetingImagesField, cc.xy(7, 7));
- numCompetingImagesField.addFocusListener(focuser);
-
+
JLabel maxPolyPointLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPolygonPoints));
- optPanel.add(maxPolyPointLabel, cc.xyw(1, 9, 7));
+ optPanel.add(maxPolyPointLabel, cc.xyw(1, 7, 7));
maxPolygonPointsField = new JTextField(4);
maxPolygonPointsField.setDocument(new IntegerDocument());
maxPolyPointLabel.setLabelFor(maxPolygonPointsField);
- optPanel.add(maxPolygonPointsField, cc.xy(7, 9));
+ optPanel.add(maxPolygonPointsField, cc.xy(7, 7));
maxPolygonPointsField.addFocusListener(focuser);
JLabel maxPtMoveLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPointMovement));
- optPanel.add(maxPtMoveLabel, cc.xyw(1, 11, 5));
+ optPanel.add(maxPtMoveLabel, cc.xyw(1, 9, 5));
maxPtMoveField = new JTextField(4);
maxPtMoveField.setDocument(new IntegerDocument());
maxPtMoveLabel.setLabelFor(maxPtMoveField);
- optPanel.add(maxPtMoveField, cc.xy(7, 11));
+ optPanel.add(maxPtMoveField, cc.xy(7, 9));
maxPtMoveField.addFocusListener(focuser);
JLabel maxColorChangeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumColorChange));
- optPanel.add(maxColorChangeLabel, cc.xyw(1, 13, 5));
+ optPanel.add(maxColorChangeLabel, cc.xyw(1, 11, 5));
maxColorChangeField = new JTextField(4);
maxColorChangeField.setDocument(new IntegerDocument());
maxColorChangeLabel.setLabelFor(maxColorChangeField);
- optPanel.add(maxColorChangeField, cc.xy(7, 13));
+ optPanel.add(maxColorChangeField, cc.xy(7, 11));
maxColorChangeField.addFocusListener(focuser);
populateValues();
@@ -260,7 +251,6 @@
widthField.setText(String.valueOf(dlgSettings.getMaxImageSize().width));
heightField.setText(String.valueOf(dlgSettings.getMaxImageSize().height));
maxPolygonField.setText(String.valueOf(dlgSettings.getMaxPolygons()));
- numCompetingImagesField.setText(String.valueOf(dlgSettings.getNumCompetingImages()));
maxPolygonPointsField.setText(String.valueOf(dlgSettings.getMaxPoints()));
maxPtMoveField.setText(String.valueOf(dlgSettings.getMaxPtMovement()));
maxColorChangeField.setText(String.valueOf(dlgSettings.getMaxColorChange()));
@@ -316,9 +306,13 @@
okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
+ dlgSettings.setGenerationSize(Integer.parseInt(generationSizeField.getText()));
+ dlgSettings.setEliteSize(Integer.parseInt(eliteSizeField.getText()));
+ dlgSettings.setUseAnnealing(useAnnealingButton.isSelected());
+ dlgSettings.setStartTemperature(Double.parseDouble(startTemperatureField.getText()));
+ dlgSettings.setCoolingRate(Double.parseDouble(coolingRateField.getText()));
dlgSettings.setMaxImageSize(new Dimension(Integer.parseInt(widthField.getText()), Integer.parseInt(heightField.getText())));
dlgSettings.setMaxPolygons(Integer.parseInt(maxPolygonField.getText()));
- dlgSettings.setNumCompetingImages(Integer.parseInt(numCompetingImagesField.getText()));
dlgSettings.setMaxPoints(Integer.parseInt(maxPolygonPointsField.getText()));
dlgSettings.setMaxPtMovement(Integer.parseInt(maxPtMoveField.getText()));
dlgSettings.setMaxColorChange(Integer.parseInt(maxColorChangeField.getText()));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-10-03 05:47:29
|
Revision: 227
http://polycasso.svn.sourceforge.net/polycasso/?rev=227&view=rev
Author: dbrosius
Date: 2010-10-03 05:47:22 +0000 (Sun, 03 Oct 2010)
Log Message:
-----------
more samples
Modified Paths:
--------------
trunk/polycasso/htdocs/index.shtml
Added Paths:
-----------
trunk/polycasso/htdocs/polyshepherd.svg
Modified: trunk/polycasso/htdocs/index.shtml
===================================================================
--- trunk/polycasso/htdocs/index.shtml 2010-10-02 15:41:57 UTC (rev 226)
+++ trunk/polycasso/htdocs/index.shtml 2010-10-03 05:47:22 UTC (rev 227)
@@ -26,6 +26,10 @@
width: 470,
height: 324
};
+ svgs[5] = { url: 'polyshepherd.svg',
+ width: 400,
+ height: 358
+ };
function setSample()
{
Added: trunk/polycasso/htdocs/polyshepherd.svg
===================================================================
--- trunk/polycasso/htdocs/polyshepherd.svg (rev 0)
+++ trunk/polycasso/htdocs/polyshepherd.svg 2010-10-03 05:47:22 UTC (rev 227)
@@ -0,0 +1,202 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="358px" version="1.2">
+ <!-- generated by Polycasso (http://polycasso.sourceforge.net) -->
+ <rect x="0" y="0" width="400px" height="358px" fill="black"/>
+ <g comp-op="src-over">
+ <polygon fill="#ffffff" fill-opacity="0.990103" points="0,358 0,0 400,0 400,358"/>
+ <polygon fill="#be560b" fill-opacity="0.39294583" points="321,124 325,122 311,121 311,134 299,102 359,91"/>
+ <polygon fill="#79290b" fill-opacity="0.8157756" points="351,56 269,56 280,93 316,101 317,113 305,143 271,89 263,151"/>
+ <polygon fill="#50392c" fill-opacity="0.74065894" points="86,313 49,344 49,335"/>
+ <polygon fill="#4a1f00" fill-opacity="0.43440276" points="343,336 325,325 263,293 283,293 267,278 279,253 298,346 334,351"/>
+ <polygon fill="#74103e" fill-opacity="0.0053958297" points="288,38 249,5 292,20 87,16"/>
+ <polygon fill="#ffffff" fill-opacity="0.9373846" points="78,287 78,259 208,6 273,42 263,182 289,371 96,371 -16,262"/>
+ <polygon fill="#000014" fill-opacity="0.8919134" points="190,131 192,142 174,131 162,149 222,158 300,253 8,192 39,204"/>
+ <polygon fill="#473002" fill-opacity="0.47766012" points="121,317 118,331 140,331 136,323"/>
+ <polygon fill="#ffffff" fill-opacity="0.47869015" points="27,334 159,323 259,368 259,282 433,321 306,345 38,97 19,13"/>
+ <polygon fill="#5b3e20" fill-opacity="0.67094934" points="47,403 54,354 63,289 89,276"/>
+ <polygon fill="#fffeef" fill-opacity="0.60850406" points="126,264 166,280 400,358 390,371 326,320 298,280 281,309 272,317"/>
+ <polygon fill="#e81300" fill-opacity="0.40968496" points="340,51 324,53 208,185 250,155 203,185 283,170 336,170"/>
+ <polygon fill="#b64100" fill-opacity="0.21429753" points="299,291 291,286 272,267 284,310 292,327 319,318 308,307 319,280"/>
+ <polygon fill="#ffffff" fill-opacity="0.340631" points="95,0 377,0 400,0 424,241 401,228 81,162 54,269 -90,-26"/>
+ <polygon fill="#a84235" fill-opacity="0.33830243" points="284,281 283,267 219,207 264,228 257,237 297,281 297,263"/>
+ <polygon fill="#fffffe" fill-opacity="0.7304298" points="382,340 319,349 321,390 412,460 405,164 227,193 354,340 125,340"/>
+ <polygon fill="#050300" fill-opacity="0.62283915" points="83,145 139,191 218,135 259,127 311,84 291,131 283,135 267,145"/>
+ <polygon fill="#b28f70" fill-opacity="0.47770262" points="114,71 170,34 173,232 113,161 61,161 61,234 83,246 355,230"/>
+ <polygon fill="#564024" fill-opacity="0.3027323" points="312,146 45,272 236,233 283,198 301,244 172,209 172,174 78,143"/>
+ <polygon fill="#ffffde" fill-opacity="0.69590527" points="106,0 15,28 155,222 186,245 95,268 81,315 0,0 16,0"/>
+ <polygon fill="#8f6b29" fill-opacity="0.44395524" points="297,79 280,19 323,44 307,86 279,5 287,3 260,10 262,24"/>
+ <polygon fill="#f29925" fill-opacity="0.21875632" points="115,148 155,189 183,245 164,234 63,281 67,282 67,280 9,300"/>
+ <polygon fill="#ffffff" fill-opacity="0.9986493" points="-10,55 230,-35 251,86 238,123 291,-84 141,142 91,168 23,195"/>
+ <polygon fill="#ffffff" fill-opacity="0.3082978" points="5,74 174,105 254,146 204,146 216,105 278,93 78,7 5,24"/>
+ <polygon fill="#000000" fill-opacity="0.17980224" points="277,244 244,260 238,257 233,257 213,241 138,241 138,274 359,4"/>
+ <polygon fill="#fff9c9" fill-opacity="0.87222415" points="97,235 115,268 131,240 167,223 70,209 121,209 145,218 145,202"/>
+ <polygon fill="#773d1d" fill-opacity="0.38810146" points="272,4 278,11 295,27 300,31 283,64 283,50 317,81 265,55"/>
+ <polygon fill="#c06000" fill-opacity="0.30986822" points="280,281 280,289 310,298 310,306 283,306 291,259 285,174 255,234"/>
+ <polygon fill="#503928" fill-opacity="0.65261894" points="118,148 146,145 99,183 67,177 64,187 55,181 74,164 55,169"/>
+ <polygon fill="#320708" fill-opacity="0.42414135" points="168,147 119,204 116,204 113,190 113,184 109,153 113,147"/>
+ <polygon fill="#f9e9be" fill-opacity="0.32964253" points="-84,167 51,246 11,305 11,342 114,358 134,269 113,169 94,167"/>
+ <polygon fill="#000000" fill-opacity="0.9815297" points="352,96 331,68 308,69 308,77 287,85 289,85 289,126 273,126"/>
+ <polygon fill="#ffffff" fill-opacity="0.6035305" points="176,349 412,-20 425,381 330,331 312,322 312,273 257,247 137,228"/>
+ <polygon fill="#0f4c00" fill-opacity="0.071986854" points="279,291 293,273 316,258 318,242 302,214 290,247 320,211"/>
+ <polygon fill="#d95f00" fill-opacity="0.3049097" points="350,124 330,115 338,136 317,139 343,154"/>
+ <polygon fill="#ffffff" fill-opacity="0.546462" points="370,46 243,208 261,237 262,229 262,208 361,246 424,16 324,-60"/>
+ <polygon fill="#000000" fill-opacity="0.007455468" points="45,232 47,233 115,228 45,228 61,245 133,213 45,213"/>
+ <polygon fill="#bb7200" fill-opacity="0.16395164" points="104,171 128,179 99,298 139,331 72,331 90,331 60,349 49,349"/>
+ <polygon fill="#ffffff" fill-opacity="0.60296935" points="125,195 113,256 100,311 167,348 190,344 179,237 195,246 195,237"/>
+ <polygon fill="#ecafa6" fill-opacity="0.50069124" points="259,171 337,153 309,113 320,113 325,93 275,107 275,101"/>
+ <polygon fill="#ffffdf" fill-opacity="0.37364239" points="367,69 360,54 349,145 305,215 303,145 264,137 350,137 230,36"/>
+ <polygon fill="#ffffff" fill-opacity="0.1916976" points="84,197 108,186 119,175 98,236 124,206 79,101 79,4"/>
+ <polygon fill="#e9a676" fill-opacity="0.25786263" points="321,238 266,180 319,180 329,180 267,126 219,186 224,205 219,245"/>
+ <polygon fill="#ac780e" fill-opacity="0.23308074" points="142,224 144,233 142,240 133,247 106,274 115,274 134,266 155,256"/>
+ <polygon fill="#e14406" fill-opacity="0.008761466" points="60,310 127,346 155,280 182,285 195,268 278,357 71,306"/>
+ <polygon fill="#a25b30" fill-opacity="0.30403596" points="36,258 41,278 43,287 72,278 62,297 84,285 106,285 84,255"/>
+ <polygon fill="#313600" fill-opacity="0.036833286" points="330,211 312,206 299,222 294,222 317,203 316,162 345,193 330,221"/>
+ <polygon fill="#14180a" fill-opacity="0.6050548" points="228,147 160,89 210,154 179,147 143,148 176,167 244,213 247,202"/>
+ <polygon fill="#260002" fill-opacity="0.12975222" points="193,61 242,179 242,216 273,228 268,179 225,232 207,197 152,155"/>
+ <polygon fill="#eca85a" fill-opacity="0.28387296" points="226,136 242,159 242,196 245,223 248,245 310,296 319,228 316,245"/>
+ <polygon fill="#000000" fill-opacity="0.014857888" points="122,116 143,128 322,236 315,268 296,229 347,274 274,214 131,133"/>
+ <polygon fill="#ffe100" fill-opacity="0.10283899" points="239,149 280,285 309,285 311,312 311,325 282,288 330,228 348,119"/>
+ <polygon fill="#000000" fill-opacity="0.34693813" points="238,145 271,177 242,150 238,164 215,187 176,205 123,179 176,141"/>
+ <polygon fill="#000d00" fill-opacity="0.027117372" points="151,304 131,332 104,331 124,324"/>
+ <polygon fill="#1c0000" fill-opacity="0.02904892" points="115,256 185,205 137,273 137,258 102,271 102,245 86,253 120,268"/>
+ <polygon fill="#7c0000" fill-opacity="0.044681728" points="287,284 306,264 269,264 269,223 260,161 261,232 294,217 271,188"/>
+ <polygon fill="#340000" fill-opacity="0.030792296" points="236,115 295,232 310,242 299,271 276,299 286,318 312,318 280,301"/>
+ <polygon fill="#b16424" fill-opacity="0.1918956" points="-5,72 14,56 19,64 32,90 39,138 111,255 111,205 87,183"/>
+ <polygon fill="#9f0000" fill-opacity="0.13860989" points="265,221 284,224 260,257 284,257 264,242 275,189 259,164 249,164"/>
+ <polygon fill="#feffce" fill-opacity="0.48013127" points="108,214 184,240 240,236 249,207 247,178 257,197 263,230 259,249"/>
+ <polygon fill="#fff3b7" fill-opacity="0.24984491" points="328,203 337,226 344,187 338,187 302,160 279,220 269,220 257,126"/>
+ <polygon fill="#473b08" fill-opacity="0.30190325" points="104,172 181,181 170,168 185,190 180,171 177,132"/>
+ <polygon fill="#5e1e00" fill-opacity="0.35018665" points="349,56 349,139 349,78 329,54 349,90 317,108 273,120 273,32"/>
+ <polygon fill="#ffffff" fill-opacity="0.5033279" points="85,289 119,289 186,269 148,326 120,315 93,299 85,317 85,279"/>
+ <polygon fill="#220000" fill-opacity="0.03436458" points="286,135 309,164 304,189 304,170 179,105"/>
+ <polygon fill="#9d5b3a" fill-opacity="0.31248778" points="311,250 174,226 215,248"/>
+ <polygon fill="#ffdb88" fill-opacity="0.50673604" points="326,33 288,44 269,110 332,124 332,136 322,136 308,149 293,88"/>
+ <polygon fill="#720000" fill-opacity="0.06849116" points="144,191 144,218 136,210 122,195 101,188 217,242 76,191"/>
+ <polygon fill="#ffab7d" fill-opacity="0.52365965" points="267,23 276,62 280,26 255,-3"/>
+ <polygon fill="#130000" fill-opacity="0.32569373" points="273,68 266,71 230,131 285,45 279,77"/>
+ <polygon fill="#ffffff" fill-opacity="0.16867352" points="7,166 114,183 114,228 123,250 112,250 42,331 125,311 133,179"/>
+ <polygon fill="#000000" fill-opacity="0.22030598" points="257,143 302,155 225,101 265,99 229,140 258,125 241,105 228,183"/>
+ <polygon fill="#000000" fill-opacity="0.036961436" points="169,42 173,225 152,220 90,295 137,266 141,260 162,224 178,202"/>
+ <polygon fill="#c17e31" fill-opacity="0.50525504" points="291,113 341,115 347,132 353,132 334,130 279,130 274,100"/>
+ <polygon fill="#ffffff" fill-opacity="0.982411" points="23,137 203,143 244,129 272,96 261,22 284,-42 195,-3 -48,44"/>
+ <polygon fill="#521100" fill-opacity="0.22016484" points="165,205 113,153 141,150 129,150 191,147 179,142 193,140 337,125"/>
+ <polygon fill="#b46700" fill-opacity="0.27054304" points="30,237 30,309 23,320 31,326 58,342 15,347 8,190 -24,342"/>
+ <polygon fill="#660900" fill-opacity="0.19432616" points="302,158 292,122 330,126 321,131 299,131 292,131 287,158"/>
+ <polygon fill="#140007" fill-opacity="0.19096178" points="222,241 253,239 250,215 250,202 213,197 149,183 160,212 185,238"/>
+ <polygon fill="#eab965" fill-opacity="0.43870336" points="78,243 69,252 41,262 27,271 85,286"/>
+ <polygon fill="#fcffff" fill-opacity="0.090572596" points="210,188 245,146 262,193 261,228 249,208 235,187 316,140 316,187"/>
+ <polygon fill="#000000" fill-opacity="0.1765452" points="229,134 140,195 188,141 243,135 243,211 234,228 128,214 255,127"/>
+ <polygon fill="#59250a" fill-opacity="0.38594836" points="348,65 295,53 295,144 320,122 325,121 352,126 331,119"/>
+ <polygon fill="#5055f6" fill-opacity="0.083859384" points="62,130 91,158 70,139 70,153 62,145 160,172 193,166 176,224"/>
+ <polygon fill="#ffffb3" fill-opacity="0.123901725" points="-26,147 130,195 121,179 116,225 85,186 163,247 179,182"/>
+ <polygon fill="#000000" fill-opacity="0.057774007" points="248,263 232,261 241,216 232,207 232,160 252,197 252,216 247,192"/>
+ <polygon fill="#ff7200" fill-opacity="0.048859954" points="257,132 273,103 275,36 309,162 289,197 171,229 126,222 55,209"/>
+ <polygon fill="#ffffff" fill-opacity="0.9626867" points="-10,343 157,-9 129,0 0,0 -24,325 179,409 118,331 13,351"/>
+ <polygon fill="#dd9f00" fill-opacity="0.10082805" points="36,212 56,262 91,197 0,291 87,287 137,271 141,230 68,170"/>
+ <polygon fill="#2c0000" fill-opacity="0.27830487" points="266,15 290,49 294,41 305,41 290,22 298,26 256,-6 269,-6"/>
+ <polygon fill="#5d2c00" fill-opacity="0.051377237" points="41,329 18,329 18,348 -16,348 73,348 145,154 153,151 400,92"/>
+ <polygon fill="#603c00" fill-opacity="0.034289777" points="194,248 237,255 240,184 249,229 317,220 310,248 305,270 233,248"/>
+ <polygon fill="#a13b00" fill-opacity="0.28700733" points="48,184 54,184 84,193 64,191 117,191 109,151 109,157 88,155"/>
+ <polygon fill="#d0a65a" fill-opacity="0.4470874" points="350,29 325,62 304,56 360,12 318,72 339,76 347,93"/>
+ <polygon fill="#df841d" fill-opacity="0.1899342" points="102,257 66,272 63,173 80,162 75,166 85,162 166,180"/>
+ <polygon fill="#ffffff" fill-opacity="0.22759604" points="354,120 336,103 424,88 400,146 400,240 378,189 305,163 321,120"/>
+ <polygon fill="#000000" fill-opacity="0.013555348" points="320,172 302,296 300,277 299,268 318,283 320,286 297,266 283,226"/>
+ <polygon fill="#ffa527" fill-opacity="0.072255075" points="41,223 72,167 132,158 148,247 148,274 133,265 103,294 41,276"/>
+ <polygon fill="#ffffff" fill-opacity="0.26599485" points="400,46 317,46 299,38 299,34 412,169 412,150 343,129 405,201"/>
+ <polygon fill="#c96016" fill-opacity="0.18502355" points="256,261 258,251 275,251 275,209 261,223 232,239 225,250"/>
+ <polygon fill="#00001c" fill-opacity="0.4941011" points="310,48 296,60 295,61 307,65 318,65"/>
+ <polygon fill="#ff7500" fill-opacity="0.064855635" points="112,170 151,192 182,229 143,212 127,204 50,196 56,173"/>
+ <polygon fill="#ffffff" fill-opacity="0.12474382" points="229,115 338,36 386,50 400,43 369,85 94,68 39,92 28,65"/>
+ <polygon fill="#000000" fill-opacity="0.1937477" points="329,107 281,107 317,69 338,78 328,69 339,71 329,57 351,30"/>
+ <polygon fill="#3c2310" fill-opacity="0.2693429" points="332,76 332,64 340,64 339,42 341,11 360,12 338,11 356,11"/>
+ <polygon fill="#efce95" fill-opacity="0.63624185" points="312,224 312,246 272,234 272,246 279,303 284,311 293,320 310,320"/>
+ <polygon fill="#583b2d" fill-opacity="0.10228574" points="93,154 232,154 249,181 261,167 261,181 237,181 197,253 163,217"/>
+ <polygon fill="#000000" fill-opacity="0.24563926" points="353,5 347,69 343,29 336,31 336,67 327,64"/>
+ <polygon fill="#d15500" fill-opacity="0.09344149" points="29,291 33,292 31,286 31,262 62,262"/>
+ <polygon fill="#fff5bd" fill-opacity="0.24962038" points="242,234 252,245 254,246 254,250 249,263 194,241 214,235 216,232"/>
+ <polygon fill="#3e3128" fill-opacity="0.2277525" points="199,143 234,157 252,199 243,181 131,144 134,188 138,211 199,222"/>
+ <polygon fill="#110000" fill-opacity="0.079903126" points="34,246 83,153 83,158 152,149 108,149 97,162 59,170"/>
+ <polygon fill="#ffffff" fill-opacity="0.014981031" points="319,239 272,282 290,224 294,253 268,241 310,248 250,264 265,3"/>
+ <polygon fill="#ffffe0" fill-opacity="0.5810029" points="312,24 290,47 393,65 364,62"/>
+ <polygon fill="#000000" fill-opacity="0.08524299" points="188,248 185,305 185,307 192,141 219,137 343,105 334,46"/>
+ <polygon fill="#050000" fill-opacity="0.10776526" points="291,284 297,277 298,253 325,227"/>
+ <polygon fill="#600000" fill-opacity="0.043474555" points="291,221 282,203 244,244 273,253 301,253 307,282 301,273 293,251"/>
+ <polygon fill="#ffffff" fill-opacity="0.04817921" points="63,123 157,192 169,197 169,227 142,242 128,242 86,171 145,204"/>
+ <polygon fill="#190f00" fill-opacity="0.13103253" points="82,157 163,153 105,149 105,180 112,185 116,183"/>
+ <polygon fill="#181a24" fill-opacity="0.26201445" points="187,148 150,203 157,203 161,213 143,203 124,172 124,152 239,134"/>
+ <polygon fill="#000000" fill-opacity="0.21096289" points="46,203 85,161 114,167 120,162 123,167 115,169 113,155 76,157"/>
+ <polygon fill="#ea7600" fill-opacity="0.138565" points="350,32 350,87 267,62 339,55 301,50 274,39 282,45"/>
+ <polygon fill="#f0d9ec" fill-opacity="0.052059233" points="208,222 183,216 205,238 179,211"/>
+ <polygon fill="#705930" fill-opacity="0.3427391" points="287,71 312,54 314,49 307,46"/>
+ <polygon fill="#ea7800" fill-opacity="0.037506163" points="255,148 282,161 351,195 300,195 308,209 341,203 333,176 352,115"/>
+ <polygon fill="#231001" fill-opacity="0.5416639" points="209,140 227,157 185,173 174,173 174,145 145,144 195,140 200,140"/>
+ <polygon fill="#ff9100" fill-opacity="0.073667705" points="288,265 322,327 343,340 343,348 344,348 293,345 288,345 288,116"/>
+ <polygon fill="#fffffd" fill-opacity="0.02388984" points="217,191 269,208 309,281 276,290 279,229 138,160 213,235 279,281"/>
+ <polygon fill="#ddd7aa" fill-opacity="0.15151697" points="53,247 87,247 46,262"/>
+ <polygon fill="#000011" fill-opacity="0.1543178" points="300,58 284,65 305,68 300,75"/>
+ <polygon fill="#a76e07" fill-opacity="0.09399021" points="70,173 42,194 85,192"/>
+ <polygon fill="#ffffe5" fill-opacity="0.23433447" points="355,130 306,161 306,138 294,138 291,139 278,145 332,140 266,135"/>
+ <polygon fill="#c05535" fill-opacity="0.06587607" points="168,145 168,192 143,170"/>
+ <polygon fill="#a833af" fill-opacity="0.057093978" points="290,294 286,275 281,317"/>
+ <polygon fill="#ab3600" fill-opacity="0.110262215" points="317,133 317,185 337,193 343,193 336,212 317,162 308,119"/>
+ <polygon fill="#feffdf" fill-opacity="0.3295129" points="249,222 261,244 257,237 266,239 296,265 296,283 300,247 276,238"/>
+ <polygon fill="#fff0bd" fill-opacity="0.5856847" points="341,344 315,344 296,344 294,309 303,312"/>
+ <polygon fill="#ffffda" fill-opacity="0.20322675" points="280,231 293,324 375,347 289,323 328,345 340,345 315,310 315,288"/>
+ <polygon fill="#ffffff" fill-opacity="0.38573176" points="342,48 358,136 399,79 307,109 342,122 400,158 342,98 342,78"/>
+ <polygon fill="#ffffff" fill-opacity="0.034905612" points="245,181 234,124 228,142 228,96 220,146 230,152 225,152 261,134"/>
+ <polygon fill="#000000" fill-opacity="0.056880236" points="261,128 303,167 284,112 284,99 273,105 252,142 257,184 236,128"/>
+ <polygon fill="#f9ec00" fill-opacity="0.058977067" points="252,151 264,260 298,335 294,247 286,210 317,234 349,202 349,77"/>
+ <polygon fill="#9b1400" fill-opacity="0.23110676" points="326,100 342,125 345,131 328,118 325,105"/>
+ <polygon fill="#eedb57" fill-opacity="0.029683948" points="144,256 103,222 55,236 23,236 61,270 61,226 36,256"/>
+ <polygon fill="#000000" fill-opacity="0.0520432" points="311,135 311,125 314,141 311,130 282,114 234,138 234,151"/>
+ <polygon fill="#ffffff" fill-opacity="0.07386953" points="55,223 101,222 131,224 151,182 44,182 16,227 128,322 73,190"/>
+ <polygon fill="#ffab61" fill-opacity="0.16883802" points="240,276 256,196 252,213 285,170 288,128 288,104 347,116 272,80"/>
+ <polygon fill="#3d9b7a" fill-opacity="0.029148996" points="216,183 212,215 240,219 234,251 270,224 306,191 225,264"/>
+ <polygon fill="#efbb58" fill-opacity="0.48776" points="339,95 339,98 350,107 353,105 358,102 356,108 353,86 353,80"/>
+ <polygon fill="#ffffff" fill-opacity="0.028312981" points="50,-59 125,14 243,233 282,272 232,318 237,247 216,232 212,224"/>
+ <polygon fill="#ffffff" fill-opacity="0.025526643" points="242,143 201,238 155,227 148,238 135,308 176,314 271,254"/>
+ <polygon fill="#ffffff" fill-opacity="0.035080433" points="249,112 200,157 211,136 216,149 215,113 250,162 199,131"/>
+ <polygon fill="#2a1e13" fill-opacity="0.5929773" points="325,116 301,116 319,116 304,83 315,83 324,102 295,83 301,127"/>
+ <polygon fill="#000000" fill-opacity="0.0587641" points="154,253 156,250 157,214 159,215 108,270"/>
+ <polygon fill="#d3c57c" fill-opacity="0.0062652826" points="139,105 102,27 146,2 170,41 170,1 276,89 277,66 269,2"/>
+ <polygon fill="#392a11" fill-opacity="0.17126828" points="137,184 125,201 220,247 225,168 231,143 167,143 102,153 90,155"/>
+ <polygon fill="#ffffff" fill-opacity="0.02954787" points="4,165 4,220 17,269 95,244 51,241 121,169 98,158 96,97"/>
+ <polygon fill="#e6ef27" fill-opacity="0.006528437" points="149,161 140,198 134,235 117,193 67,240 67,201 43,193"/>
+ <polygon fill="#ffffff" fill-opacity="0.15850818" points="296,196 388,136 444,224 416,246 393,249 312,254 284,245"/>
+ <polygon fill="#ffffff" fill-opacity="0.0037348866" points="26,6 122,39 321,277 321,310 255,310 278,228 255,231"/>
+ <polygon fill="#7f1600" fill-opacity="0.109182775" points="63,343 63,304 84,334 76,343 38,339"/>
+ <polygon fill="#ffd76c" fill-opacity="0.2791626" points="162,222 113,181 113,189 113,196 100,204 162,229 147,229 153,254"/>
+ <polygon fill="#110000" fill-opacity="0.1587224" points="144,262 144,236 156,239 157,252 155,234 164,235 167,242 162,234"/>
+ <polygon fill="#ffffff" fill-opacity="0.012227058" points="201,153 213,153 201,174 245,157 269,247 198,145"/>
+ <polygon fill="#992c00" fill-opacity="0.2108553" points="93,280 109,266 132,249 141,246 158,246 149,257 141,265 130,274"/>
+ <polygon fill="#410000" fill-opacity="0.029041708" points="240,95 344,137 322,155 287,99 305,135 296,156 252,150 338,74"/>
+ <polygon fill="#000000" fill-opacity="0.07124436" points="105,208 105,250 102,254 93,230 88,204 82,204"/>
+ <polygon fill="#523930" fill-opacity="0.4052437" points="250,213 243,214 220,233 218,219 202,215 196,216 160,195 186,165"/>
+ <polygon fill="#000000" fill-opacity="0.004742801" points="5,146 5,159 92,168 37,248 82,217 33,228 106,263 6,91"/>
+ <polygon fill="#391d00" fill-opacity="0.2765147" points="101,331 114,332 134,330 107,327 96,323 96,298 96,329"/>
+ <polygon fill="#42ee74" fill-opacity="0.0035951138" points="120,8 163,41 149,52 101,69 63,71 -7,123 17,47 17,-4"/>
+ <polygon fill="#de8054" fill-opacity="0.26028836" points="276,113 304,130 323,130 321,122 280,101"/>
+ <polygon fill="#ffffff" fill-opacity="0.025381327" points="131,221 140,206 111,186 146,211 120,167 135,176 117,164 -8,221"/>
+ <polygon fill="#5c5852" fill-opacity="0.20108712" points="229,198 234,207 225,210 212,206 245,240 248,218 225,215 201,224"/>
+ <polygon fill="#000000" fill-opacity="0.054238915" points="278,278 236,191 254,206 236,186 249,191 243,206 225,206 223,205"/>
+ <polygon fill="#fde3a1" fill-opacity="0.5243618" points="76,209 85,222 88,203 93,215 81,187"/>
+ <polygon fill="#ff6100" fill-opacity="0.04335636" points="199,244 228,230 330,225 301,265 295,295 258,273 281,280 309,266"/>
+ <polygon fill="#ffffff" fill-opacity="0.22067559" points="275,81 184,93 237,136"/>
+ <polygon fill="#a07e4b" fill-opacity="0.06799525" points="110,142 117,171 104,163 128,193 106,202"/>
+ <polygon fill="#ffffff" fill-opacity="0.027910411" points="41,1 63,29 101,114 156,172 230,193 237,228 256,220 252,281"/>
+ <polygon fill="#360c00" fill-opacity="0.12266576" points="261,126 304,133 271,120 271,92 275,113 273,104 273,88 326,69"/>
+ <polygon fill="#c6942c" fill-opacity="0.0091122985" points="336,226 318,226 271,256 221,255 69,184 129,136 151,172 149,119"/>
+ <polygon fill="#c35838" fill-opacity="0.056545556" points="210,201 137,175 104,175 125,207 139,168 134,163"/>
+ <polygon fill="#6e2600" fill-opacity="0.05106926" points="343,190 312,259 298,273 298,279 299,257 299,224"/>
+ <polygon fill="#ffffff" fill-opacity="0.015452385" points="219,209 174,250 203,246 207,231 201,226 167,197 104,211"/>
+ <polygon fill="#000000" fill-opacity="0.0027329922" points="32,249 70,314 79,299 79,180"/>
+ <polygon fill="#ffffff" fill-opacity="0.0375517" points="123,80 129,85 123,156 183,144 164,144 119,144"/>
+ <polygon fill="#a1a1bd" fill-opacity="0.0036011338" points="279,125 329,111 339,193 359,106 330,167 370,182 352,198 192,68"/>
+ <polygon fill="#c31a5d" fill-opacity="0.06132233" points="252,160 252,189 260,161 322,142 312,130 315,116 288,117 269,101"/>
+ <polygon fill="#4e83ef" fill-opacity="0.019196153" points="177,168 134,186 98,176 115,144 115,157 120,144 167,191"/>
+ <polygon fill="#fece82" fill-opacity="0.37982965" points="69,303 92,306 92,305 88,317 92,322 69,332"/>
+ <polygon fill="#e0946e" fill-opacity="0.1995635" points="173,210 170,222 170,217"/>
+ <polygon fill="#000000" fill-opacity="0.004026592" points="-6,291 58,237 52,231"/>
+ <polygon fill="#fffd03" fill-opacity="0.04522127" points="330,75 331,43 309,32"/>
+ <polygon fill="#f9ed18" fill-opacity="0.02752328" points="133,190 113,190 116,172 73,189 148,242"/>
+ </g>
+</svg>
Property changes on: trunk/polycasso/htdocs/polyshepherd.svg
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-10-02 15:42:04
|
Revision: 226
http://polycasso.svn.sourceforge.net/polycasso/?rev=226&view=rev
Author: dbrosius
Date: 2010-10-02 15:41:57 +0000 (Sat, 02 Oct 2010)
Log Message:
-----------
more samples
Modified Paths:
--------------
trunk/polycasso/htdocs/index.shtml
Added Paths:
-----------
trunk/polycasso/htdocs/polypony.svg
Modified: trunk/polycasso/htdocs/index.shtml
===================================================================
--- trunk/polycasso/htdocs/index.shtml 2010-09-29 04:05:19 UTC (rev 225)
+++ trunk/polycasso/htdocs/index.shtml 2010-10-02 15:41:57 UTC (rev 226)
@@ -22,6 +22,10 @@
width: 500,
height: 333
};
+ svgs[4] = { url: 'polypony.svg',
+ width: 470,
+ height: 324
+ };
function setSample()
{
Added: trunk/polycasso/htdocs/polypony.svg
===================================================================
--- trunk/polycasso/htdocs/polypony.svg (rev 0)
+++ trunk/polycasso/htdocs/polypony.svg 2010-10-02 15:41:57 UTC (rev 226)
@@ -0,0 +1,231 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="470px" height="324px" version="1.2">
+ <!-- generated by Polycasso (http://polycasso.sourceforge.net) -->
+ <rect x="0" y="0" width="470px" height="324px" fill="black"/>
+ <g comp-op="src-over">
+ <polygon fill="#d2e1ff" fill-opacity="0.9899649" points="469,0 500,33 470,31 233,-14 343,57 351,57 413,79"/>
+ <polygon fill="#ffffff" fill-opacity="0.44094688" points="398,48 480,48 450,-30 470,0 18,-21 -44,57 407,343"/>
+ <polygon fill="#d6eaff" fill-opacity="0.73932016" points="453,324 470,26 47,29 0,29 0,324 57,335 488,-12 5,-47"/>
+ <polygon fill="#f9ffff" fill-opacity="0.48910147" points="0,324 0,324 429,324 421,0 421,272 0,336 423,307 0,0"/>
+ <polygon fill="#ffffff" fill-opacity="0.9599713" points="138,383 384,419 394,303 421,313 400,283 283,206"/>
+ <polygon fill="#b5af94" fill-opacity="0.85812235" points="470,324 93,324 0,324 45,288 68,309 69,312 470,0 470,0"/>
+ <polygon fill="#dce8ff" fill-opacity="0.919082" points="-98,-31 86,81 206,71 213,33 216,19 275,9 251,-3 191,0"/>
+ <polygon fill="#1f1700" fill-opacity="0.5526571" points="104,221 323,221 380,246 380,231 369,189 281,94 402,71 152,45"/>
+ <polygon fill="#000000" fill-opacity="0.4341923" points="201,137 175,93 150,62 192,68 210,57 227,57 210,91 141,82"/>
+ <polygon fill="#ffd2c1" fill-opacity="0.8988031" points="311,75 260,49 283,49 285,49 287,-2 284,55 301,55 294,75"/>
+ <polygon fill="#aca64d" fill-opacity="0.4678288" points="-8,345 -15,93 174,96"/>
+ <polygon fill="#a24a00" fill-opacity="0.30541533" points="58,240 26,202 8,96 458,55 462,76 447,84 419,128 172,323"/>
+ <polygon fill="#ac9373" fill-opacity="0.99116325" points="344,158 415,163 324,267 340,267 287,226 305,226 342,252 340,244"/>
+ <polygon fill="#080000" fill-opacity="0.7225784" points="245,60 305,60 305,65 288,99 307,88 336,62 336,53 247,17"/>
+ <polygon fill="#f7dff9" fill-opacity="0.1938467" points="4,164 6,149 22,88 31,12 108,164"/>
+ <polygon fill="#10a75e" fill-opacity="0.056181192" points="193,37 209,59 217,56 190,52 179,52"/>
+ <polygon fill="#ffa152" fill-opacity="0.48169827" points="333,159 333,143 362,94 368,191"/>
+ <polygon fill="#000000" fill-opacity="0.33340448" points="148,134 106,141 48,152 33,177 177,38"/>
+ <polygon fill="#000000" fill-opacity="0.1347596" points="364,41 331,41 333,67 331,90 297,64 350,43 314,62 102,41"/>
+ <polygon fill="#ffffb9" fill-opacity="0.25467294" points="49,208 53,252 52,277 6,290 53,248 53,303 234,158 230,57"/>
+ <polygon fill="#aa755c" fill-opacity="0.86340076" points="160,87 317,127 277,82 269,63 269,96 286,107 310,135 345,136"/>
+ <polygon fill="#822e00" fill-opacity="0.4633736" points="290,205 318,107 322,125 348,148 328,114 325,126 333,101 376,171"/>
+ <polygon fill="#511f00" fill-opacity="0.6408951" points="216,202 193,143 180,200 310,219 310,186 264,159 242,202"/>
+ <polygon fill="#7e5c10" fill-opacity="0.50091064" points="153,122 185,103 197,103 153,93"/>
+ <polygon fill="#000000" fill-opacity="0.22361201" points="125,33 174,79 223,41 264,48 275,97 360,163 151,163 408,291"/>
+ <polygon fill="#ee6e12" fill-opacity="0.27617073" points="263,43 79,139 -28,179 -100,231 115,368 221,318"/>
+ <polygon fill="#d99c54" fill-opacity="0.28790647" points="470,285 470,324 470,72 151,338 470,324"/>
+ <polygon fill="#fffff2" fill-opacity="0.12382007" points="6,72 191,248 347,326 32,324 39,324 347,314 33,324 33,324"/>
+ <polygon fill="#fdfce7" fill-opacity="0.26583302" points="380,299 327,188 372,191 381,188"/>
+ <polygon fill="#ffffcb" fill-opacity="0.113075554" points="-3,299 253,310 15,126 162,347 59,289 20,333 -3,330"/>
+ <polygon fill="#672500" fill-opacity="0.56383306" points="221,146 302,146 305,192 309,199 322,228 324,230 341,264"/>
+ <polygon fill="#000000" fill-opacity="0.11486113" points="128,183 148,208 12,162 221,77 336,61 336,42 159,45 124,45"/>
+ <polygon fill="#f3ffcf" fill-opacity="0.33500075" points="186,361 149,336 81,258 67,307 103,236 120,236 134,246 159,242"/>
+ <polygon fill="#daffff" fill-opacity="0.15978974" points="139,19 198,19 224,69 224,116 158,116 204,138 204,119 235,76"/>
+ <polygon fill="#a36437" fill-opacity="0.31795716" points="219,223 256,262 195,202 121,221 248,225 248,251 128,230 126,222"/>
+ <polygon fill="#170900" fill-opacity="0.52245176" points="378,227 378,207 403,218 379,214 368,208 363,215 362,220 352,245"/>
+ <polygon fill="#9d99c8" fill-opacity="0.16114193" points="130,39 201,60 162,63 158,83 158,87 139,68 112,70 168,134"/>
+ <polygon fill="#ffffff" fill-opacity="0.0647136" points="313,143 335,177 250,180 208,199 235,245 240,209 279,126"/>
+ <polygon fill="#510700" fill-opacity="0.097892046" points="161,270 381,230 200,127 130,164 119,154 136,110 79,104 79,147"/>
+ <polygon fill="#faffda" fill-opacity="0.12685406" points="15,221 96,299 171,229 184,299 182,315"/>
+ <polygon fill="#ffffff" fill-opacity="0.36848116" points="354,162 364,176 362,184 353,203 350,224 356,224 598,-144 332,-85"/>
+ <polygon fill="#000300" fill-opacity="0.5917844" points="121,135 96,140 85,142 94,141 85,140 87,110 121,86"/>
+ <polygon fill="#000000" fill-opacity="0.23749721" points="71,146 101,76 177,113 149,116 144,72 157,100 130,131 121,136"/>
+ <polygon fill="#0f1100" fill-opacity="0.3117844" points="192,185 278,223 278,235 243,276 224,286 204,308 192,323"/>
+ <polygon fill="#5a3617" fill-opacity="0.58997613" points="184,188 185,233 314,182 348,182 273,124 258,94 242,73 166,163"/>
+ <polygon fill="#dec29b" fill-opacity="0.8515653" points="334,88 357,88 361,30 374,42 372,92 376,104 423,74 344,113"/>
+ <polygon fill="#c9e2ff" fill-opacity="0.70030797" points="191,54 166,64 144,34 168,34 186,20 190,39 191,63 190,9"/>
+ <polygon fill="#e6e8ec" fill-opacity="0.40786898" points="22,3 -3,4 1,36 1,42 67,16 105,39 58,58 31,51"/>
+ <polygon fill="#d05110" fill-opacity="0.06990051" points="230,304 258,216 221,196 192,188 192,157 25,157"/>
+ <polygon fill="#000000" fill-opacity="0.0043471456" points="28,105 28,187 65,187 22,187 -14,55"/>
+ <polygon fill="#759656" fill-opacity="0.01852101" points="125,128 125,224 128,236 176,240 309,313 143,324 280,257 298,322"/>
+ <polygon fill="#d88524" fill-opacity="0.15533537" points="117,138 138,332 207,328 194,326 210,306 250,277 304,258 410,279"/>
+ <polygon fill="#444a5c" fill-opacity="0.7085782" points="313,44 270,18 272,19 248,20"/>
+ <polygon fill="#4e2c00" fill-opacity="0.19875598" points="39,102 56,88 85,94 97,97 66,97 264,199 411,275 183,78"/>
+ <polygon fill="#ffda9b" fill-opacity="0.57648677" points="276,91 293,91 299,79 302,66 295,63 289,47 262,57"/>
+ <polygon fill="#1e0d00" fill-opacity="0.49710917" points="389,262 380,264 374,266 370,264 301,143 301,263 326,261"/>
+ <polygon fill="#ebfcff" fill-opacity="0.37674516" points="81,6 97,-1 109,-10 171,-10 198,19 120,102 62,102 -24,28"/>
+ <polygon fill="#9c540b" fill-opacity="0.070512235" points="450,46 517,77 278,75 269,150 264,210 410,171 436,64 408,64"/>
+ <polygon fill="#000000" fill-opacity="0.062126398" points="411,59 449,59 422,46 422,83 442,89 483,110 490,82"/>
+ <polygon fill="#d3010c" fill-opacity="0.041155994" points="1,93 304,88 301,84 462,46 513,80 478,175 469,323 1,323"/>
+ <polygon fill="#bea182" fill-opacity="0.5317186" points="390,324 381,259 436,260 436,304 350,310 292,228 266,228 266,238"/>
+ <polygon fill="#000000" fill-opacity="0.12615573" points="341,250 371,249 383,299 328,251 328,233 386,245 264,14 238,22"/>
+ <polygon fill="#000000" fill-opacity="0.04653144" points="464,193 470,324 388,324 420,324 399,313 470,253"/>
+ <polygon fill="#101c00" fill-opacity="0.048211575" points="390,239 434,230 434,265 459,285 434,309 473,345 432,286 390,289"/>
+ <polygon fill="#000000" fill-opacity="0.018554866" points="306,313 278,321 180,303 216,264 216,89 8,89 -19,104 8,80"/>
+ <polygon fill="#faac56" fill-opacity="0.062212765" points="108,72 117,255 185,318 201,236 130,137 100,138 79,155 407,112"/>
+ <polygon fill="#ffd48d" fill-opacity="0.38519156" points="415,80 359,102 315,108 308,141 296,114 315,93 350,58 350,47"/>
+ <polygon fill="#000000" fill-opacity="0.06068635" points="412,92 339,102 312,102 325,164 347,193 325,174 318,174 336,250"/>
+ <polygon fill="#6f99b0" fill-opacity="0.31693667" points="185,67 187,34 161,69 147,78 147,94 141,64"/>
+ <polygon fill="#080100" fill-opacity="0.024145305" points="401,113 401,179 427,183 406,203 468,221 459,260 392,260 15,84"/>
+ <polygon fill="#73e148" fill-opacity="0.019940436" points="293,167 324,67 319,115 361,120 373,121 351,97 398,120"/>
+ <polygon fill="#f7ffff" fill-opacity="0.26214814" points="314,214 319,214 324,193 332,187 368,187 376,203 372,222 372,214"/>
+ <polygon fill="#f5e6b1" fill-opacity="0.14688665" points="395,306 268,316 264,264 251,199"/>
+ <polygon fill="#000000" fill-opacity="0.14319438" points="170,58 167,85 160,73 159,71 146,47"/>
+ <polygon fill="#000000" fill-opacity="0.038362622" points="155,84 372,250 358,261 396,222 424,252 440,239 432,228 405,260"/>
+ <polygon fill="#504314" fill-opacity="0.03915" points="220,255 192,134 182,226 328,212 323,122"/>
+ <polygon fill="#ff1500" fill-opacity="0.06828815" points="213,59 363,59 364,72 351,111 375,127 364,131 302,110 186,122"/>
+ <polygon fill="#bb9d7a" fill-opacity="0.85007524" points="470,42 363,184 374,212 366,212 439,237 470,212 470,146"/>
+ <polygon fill="#000a00" fill-opacity="0.25605148" points="-42,113 104,97 14,89"/>
+ <polygon fill="#ffde88" fill-opacity="0.25229156" points="248,90 341,82 353,82 370,118 358,140 353,142 334,110 317,140"/>
+ <polygon fill="#ffffff" fill-opacity="0.10444862" points="180,74 315,133 328,133 314,134 294,135 294,154 329,132 170,74"/>
+ <polygon fill="#64320b" fill-opacity="0.9593671" points="242,172 247,213 242,226 253,266 241,251 263,254 288,221"/>
+ <polygon fill="#703f1d" fill-opacity="0.41409415" points="223,64 283,120 296,68 267,64"/>
+ <polygon fill="#471900" fill-opacity="0.051044524" points="446,267 423,267 460,286 460,166 425,252 357,182 463,137 386,135"/>
+ <polygon fill="#e2bf98" fill-opacity="0.13885677" points="443,271 465,261 465,283 466,290 443,288 443,267 266,236"/>
+ <polygon fill="#fdb263" fill-opacity="0.24476027" points="340,198 330,227 316,221 298,198 358,198 370,182 367,135 342,91"/>
+ <polygon fill="#000000" fill-opacity="0.046295464" points="13,93 84,93 112,90 87,107 50,129 73,132 69,144 162,116"/>
+ <polygon fill="#060000" fill-opacity="0.13041395" points="142,87 288,87 295,133 305,215 390,267 310,194 345,264 307,246"/>
+ <polygon fill="#ffffff" fill-opacity="0.008375585" points="265,191 361,135 258,135"/>
+ <polygon fill="#000c3d" fill-opacity="0.16584623" points="125,82 145,93 133,72 135,99 132,110 109,99"/>
+ <polygon fill="#27220e" fill-opacity="0.6331648" points="114,103 122,103 141,104 141,93 101,93"/>
+ <polygon fill="#daffff" fill-opacity="0.0748896" points="44,53 44,86 174,97 153,113 135,85 211,85 234,112 211,100"/>
+ <polygon fill="#ae2d00" fill-opacity="0.111530185" points="328,30 328,79 373,100 350,82"/>
+ <polygon fill="#ffff82" fill-opacity="0.030464709" points="344,227 361,227 367,263 367,268"/>
+ <polygon fill="#ca7e4c" fill-opacity="0.19840413" points="391,215 420,242 370,208 376,201"/>
+ <polygon fill="#000000" fill-opacity="0.113248765" points="97,58 114,62 218,58 246,36 272,46 302,89 329,63 302,104"/>
+ <polygon fill="#000000" fill-opacity="0.0979681" points="469,179 417,134 450,136 470,136"/>
+ <polygon fill="#000000" fill-opacity="0.08985716" points="231,241 254,164 254,152 267,121 267,180 283,214 283,195 284,256"/>
+ <polygon fill="#001e1e" fill-opacity="0.021299064" points="43,0 206,0 206,150 125,260 268,125 384,30 412,16 277,0"/>
+ <polygon fill="#def6ff" fill-opacity="0.24450558" points="382,55 405,55 503,46 518,24 524,17 441,-18 439,-32 -16,-3"/>
+ <polygon fill="#d7ad72" fill-opacity="0.54910266" points="140,301 132,350 124,373 -21,388 16,188"/>
+ <polygon fill="#905304" fill-opacity="0.30523753" points="179,326 187,293 196,282 217,282 216,280 196,272 191,259 221,316"/>
+ <polygon fill="#000000" fill-opacity="0.15912992" points="293,99 287,99 287,92 270,78 315,25 267,35 204,39 293,69"/>
+ <polygon fill="#ffd9ac" fill-opacity="0.08433437" points="148,244 141,261 138,282 153,280 159,236 166,232 181,207 133,140"/>
+ <polygon fill="#dedaff" fill-opacity="0.046844423" points="64,126 -1,108 68,92 65,89 12,103 -13,37 46,6 17,6"/>
+ <polygon fill="#606c33" fill-opacity="0.07698125" points="15,192 31,169 15,145 -26,197 22,210 68,187 67,141 40,156"/>
+ <polygon fill="#ffffff" fill-opacity="0.0049428344" points="87,314 103,314 79,314 59,316 -5,314 10,218 10,247 14,218"/>
+ <polygon fill="#000000" fill-opacity="0.080904126" points="380,48 442,59 485,33 484,172 380,167 397,216 380,98 220,19"/>
+ <polygon fill="#e82746" fill-opacity="0.021128416" points="57,0 64,7 33,19 20,12 0,0 0,50 91,76 131,0"/>
+ <polygon fill="#d9ecff" fill-opacity="0.5839389" points="250,23 235,34 226,37 202,-19 308,10 284,-18 250,23 250,-6"/>
+ <polygon fill="#440800" fill-opacity="0.08236086" points="167,316 192,355 192,293 228,292 239,197 166,200 215,283 228,299"/>
+ <polygon fill="#ffdba5" fill-opacity="0.10881251" points="309,304 393,294 437,279 434,248 423,239 417,214 413,194"/>
+ <polygon fill="#000000" fill-opacity="0.031101346" points="365,197 456,155 446,131 365,107"/>
+ <polygon fill="#695854" fill-opacity="0.2708851" points="341,188 330,236 305,185 322,185 301,177 232,62"/>
+ <polygon fill="#f9c185" fill-opacity="0.18055272" points="453,144 480,145 470,167 444,145 348,145 354,148 354,223 424,204"/>
+ <polygon fill="#ad723a" fill-opacity="0.81568307" points="292,113 345,113 347,148"/>
+ <polygon fill="#370000" fill-opacity="0.10897964" points="172,250 175,190 189,190"/>
+ <polygon fill="#7e4b00" fill-opacity="0.38725728" points="365,28 365,42 275,95 338,56 326,56 326,81 377,70"/>
+ <polygon fill="#ffffff" fill-opacity="0.10839617" points="260,279 333,211 359,218 338,211 329,224 303,233"/>
+ <polygon fill="#e7908d" fill-opacity="0.066817045" points="94,127 63,141 63,173 74,96"/>
+ <polygon fill="#72492c" fill-opacity="0.53495353" points="176,83 187,84 151,107 227,131 209,85 203,74 182,62 176,57"/>
+ <polygon fill="#000000" fill-opacity="0.018321455" points="141,169 275,108 275,271 90,254 282,136 370,234 344,262"/>
+ <polygon fill="#ffffff" fill-opacity="0.03383094" points="449,332 428,332 425,309 357,265 357,243 458,199 461,142 339,160"/>
+ <polygon fill="#a51c00" fill-opacity="0.0860495" points="-24,42 0,242 12,269 14,269 23,242 37,258 8,101"/>
+ <polygon fill="#ba2bb8" fill-opacity="0.0090433955" points="51,250 58,242 94,158 141,94 151,161 125,173 56,193"/>
+ <polygon fill="#caae8f" fill-opacity="0.66622055" points="423,272 397,261 357,258 328,283 310,342 370,352 411,319 361,319"/>
+ <polygon fill="#000000" fill-opacity="0.031088173" points="392,135 422,135 391,135 379,132 243,136 178,139 138,66 300,1"/>
+ <polygon fill="#003f69" fill-opacity="0.08294445" points="279,11 349,54 349,69"/>
+ <polygon fill="#dbd1db" fill-opacity="0.034356713" points="135,130 127,147 132,195 158,124 175,151 165,150 127,120 47,13"/>
+ <polygon fill="#05d4fd" fill-opacity="0.06126052" points="153,66 225,66 201,36 178,53 178,85 181,53 123,45"/>
+ <polygon fill="#5d4905" fill-opacity="0.117522895" points="274,110 189,110 188,62 265,38"/>
+ <polygon fill="#dcc19f" fill-opacity="0.5575286" points="212,329 317,280 289,261 331,271 343,281 311,250 296,221 249,261"/>
+ <polygon fill="#ffffff" fill-opacity="0.04146564" points="248,102 248,70 217,59 231,115 188,32"/>
+ <polygon fill="#49afe0" fill-opacity="0.012871683" points="164,117 198,304 236,324 250,324 190,324 231,299"/>
+ <polygon fill="#ffffff" fill-opacity="0.031357825" points="367,271 345,313 267,313 292,288 268,292 256,288 247,308 237,280"/>
+ <polygon fill="#ffffff" fill-opacity="0.06698239" points="93,92 67,130 67,140 13,174 46,100 -28,147 0,120 7,115"/>
+ <polygon fill="#ddffff" fill-opacity="0.017745316" points="138,17 40,1 5,57 35,127 40,147 63,147 58,135 110,104"/>
+ <polygon fill="#000000" fill-opacity="0.072627604" points="318,265 372,261 369,236 376,230 225,168 225,89 183,32"/>
+ <polygon fill="#ffffff" fill-opacity="0.03013122" points="232,110 219,128 167,129 175,111 214,118 192,118 201,122 176,88"/>
+ <polygon fill="#080000" fill-opacity="0.089942396" points="79,323 80,345 106,336 106,324 106,343 114,316 133,304 85,304"/>
+ <polygon fill="#ffe8cb" fill-opacity="0.13625515" points="210,286 304,213 300,219 312,263 332,274 313,269"/>
+ <polygon fill="#280300" fill-opacity="0.26059645" points="277,126 232,82 190,106 278,93"/>
+ <polygon fill="#4d2c2f" fill-opacity="0.08690667" points="206,234 206,123 243,97 253,198 264,209 256,268 192,234 132,238"/>
+ <polygon fill="#000000" fill-opacity="0.05538374" points="-14,121 -11,126 4,117 -14,91 10,91 37,101 47,112 52,130"/>
+ <polygon fill="#ffffff" fill-opacity="0.021703362" points="178,165 123,165 129,99 141,108 141,93 187,106 171,40 91,16"/>
+ <polygon fill="#fffaec" fill-opacity="0.19360161" points="421,200 402,210 351,219 340,213 331,211 417,136"/>
+ <polygon fill="#000000" fill-opacity="0.066627026" points="141,68 225,68 154,63 181,49 211,33 141,100"/>
+ <polygon fill="#2c1300" fill-opacity="0.057570934" points="387,24 397,47 422,38 428,31 424,21 383,21"/>
+ <polygon fill="#ef954d" fill-opacity="0.028531313" points="17,259 -1,197 199,81 209,150 234,314 234,349 283,349 255,166"/>
+ <polygon fill="#cab896" fill-opacity="0.60942274" points="409,55 394,60 368,59 351,119 368,105 393,113 380,111 406,111"/>
+ <polygon fill="#6d3706" fill-opacity="0.23118299" points="221,221 240,273 240,277 270,244 274,241 290,225"/>
+ <polygon fill="#654627" fill-opacity="0.40263844" points="288,48 231,59 214,46 211,71 237,94 237,123 259,115"/>
+ <polygon fill="#ffffea" fill-opacity="0.10693008" points="299,168 323,231 332,241 323,235 386,253 375,280 365,256 346,256"/>
+ <polygon fill="#ffffff" fill-opacity="0.03755641" points="7,29 220,219 256,219 251,180 192,180 185,160 58,18 4,-8"/>
+ <polygon fill="#ffffff" fill-opacity="0.24423474" points="376,212 370,227 342,207 335,184 399,215 399,227"/>
+ <polygon fill="#ffffff" fill-opacity="0.02070868" points="133,324 133,281 151,290 174,251 185,297"/>
+ <polygon fill="#ff6330" fill-opacity="0.018283784" points="182,226 43,226 147,161 207,139 160,199"/>
+ <polygon fill="#421512" fill-opacity="0.08323306" points="369,206 398,227 404,208 422,200 419,160"/>
+ <polygon fill="#000800" fill-opacity="0.062416017" points="301,46 333,41 262,83 262,86 255,46"/>
+ <polygon fill="#947037" fill-opacity="0.13695014" points="113,155 102,176 202,176 202,167 248,158 248,181 223,181 211,167"/>
+ <polygon fill="#f2d38d" fill-opacity="0.13318634" points="306,172 305,174 292,154 316,154"/>
+ <polygon fill="#ffebab" fill-opacity="0.0306831" points="109,98 137,143 137,84 203,92 98,149 179,175 179,133 179,113"/>
+ <polygon fill="#d4b490" fill-opacity="0.43477756" points="365,184 383,211 421,253 338,289 386,214 412,237 412,222 373,103"/>
+ <polygon fill="#762f19" fill-opacity="0.14023775" points="-9,293 16,242 78,214 54,171 23,171 -10,172 0,185 0,228"/>
+ <polygon fill="#ffffff" fill-opacity="0.07236028" points="249,264 210,295 182,324 171,324 224,324"/>
+ <polygon fill="#8c3c00" fill-opacity="0.16301388" points="94,211 157,161 173,167 187,167 189,167 179,144 136,164 94,161"/>
+ <polygon fill="#000000" fill-opacity="0.024082959" points="348,55 348,82 338,78 322,70 337,87 318,87 336,179 121,55"/>
+ <polygon fill="#ff996b" fill-opacity="0.16860056" points="303,95 298,110 298,126 364,121 361,99 329,68 329,91 294,74"/>
+ <polygon fill="#ffffe4" fill-opacity="0.1346429" points="401,142 361,142 361,167 373,178 401,167"/>
+ <polygon fill="#411e00" fill-opacity="0.049181044" points="407,116 407,123 401,108 385,91 393,92 422,91"/>
+ <polygon fill="#d29a61" fill-opacity="0.4440707" points="46,182 90,227 87,230 77,228 72,206 159,234 111,196 85,181"/>
+ <polygon fill="#ffffef" fill-opacity="0.053626895" points="87,198 101,232 108,232 102,216 77,213 29,203 94,288 140,227"/>
+ <polygon fill="#ffffff" fill-opacity="0.02230531" points="330,198 332,215 324,250 324,223 294,147"/>
+ <polygon fill="#26252a" fill-opacity="0.06278539" points="133,171 193,177 244,167 201,128"/>
+ <polygon fill="#000000" fill-opacity="0.08523989" points="263,140 312,86 305,38 312,39 166,98 157,61 159,61 314,9"/>
+ <polygon fill="#fffff2" fill-opacity="0.1124984" points="343,75 404,80 394,80 377,64 389,60 392,8"/>
+ <polygon fill="#ffffdf" fill-opacity="0.07059479" points="450,145 499,155 470,121 501,218 449,196 367,204 347,210 311,204"/>
+ <polygon fill="#91d6fb" fill-opacity="0.09535599" points="87,101 120,87 72,87 79,109 78,111 93,100 88,103"/>
+ <polygon fill="#ffffff" fill-opacity="0.011391938" points="357,269 382,269 397,249 394,237 405,228 362,233"/>
+ <polygon fill="#ffffff" fill-opacity="0.13043314" points="316,192 316,208 322,217 326,220 339,213 342,211 298,192 321,192"/>
+ <polygon fill="#000000" fill-opacity="0.058129787" points="118,167 118,177 110,162 161,162 142,180 126,203"/>
+ <polygon fill="#ffffff" fill-opacity="0.012235284" points="57,130 108,152 83,160 60,229 72,298 127,257 132,229"/>
+ <polygon fill="#ffffff" fill-opacity="0.009196579" points="172,60 270,153 180,53 193,144"/>
+ <polygon fill="#ffffe5" fill-opacity="0.066455066" points="66,255 88,293 105,304 105,259 69,247 69,210 88,201 151,219"/>
+ <polygon fill="#000000" fill-opacity="0.009460449" points="241,245 306,249 246,277 288,277 267,294 260,286 260,307 312,273"/>
+ <polygon fill="#000000" fill-opacity="0.0054525137" points="407,107 390,101 362,131 381,159"/>
+ <polygon fill="#ffffff" fill-opacity="0.00309515" points="118,163 210,234 206,285 194,227 214,214 254,158 254,228 261,237"/>
+ <polygon fill="#260000" fill-opacity="0.24559623" points="181,93 180,103 189,116"/>
+ <polygon fill="#1c0000" fill-opacity="0.21757454" points="359,36 376,36 356,92 351,92"/>
+ <polygon fill="#ffffbd" fill-opacity="0.17088944" points="287,225 306,216 292,241"/>
+ <polygon fill="#c28225" fill-opacity="0.13851821" points="84,156 208,247 208,261 181,278 163,256 140,255"/>
+ <polygon fill="#000000" fill-opacity="0.0031815767" points="334,44 352,58 334,101 217,80 359,129 323,44"/>
+ <polygon fill="#9c6c30" fill-opacity="0.18898815" points="213,315 213,246 237,272 216,251 216,266 285,227"/>
+ <polygon fill="#ffefa7" fill-opacity="0.047575533" points="267,95 224,132 208,132 191,132 148,160 148,139 191,103"/>
+ <polygon fill="#fff1d3" fill-opacity="0.062444568" points="162,168 184,221 152,221 152,258 149,224 145,187"/>
+ <polygon fill="#f8cdba" fill-opacity="0.08065504" points="351,46 453,197 397,171 399,196 418,146"/>
+ <polygon fill="#c0dca0" fill-opacity="0.08787936" points="214,231 217,206 217,196 219,199 234,202 241,268"/>
+ <polygon fill="#000b00" fill-opacity="0.02463466" points="381,70 380,36 383,37 395,29 395,15 409,20 409,24 408,52"/>
+ <polygon fill="#000000" fill-opacity="0.009862959" points="239,228 258,269 277,269 287,239 317,284 258,265 239,265"/>
+ <polygon fill="#a45721" fill-opacity="0.050682724" points="322,185 322,147 375,132 434,104 434,45 200,190 152,97"/>
+ <polygon fill="#ffda86" fill-opacity="0.146447" points="334,159 333,147 330,107 330,127 363,207"/>
+ <polygon fill="#ffd97d" fill-opacity="0.0650506" points="120,278 167,273 180,241 164,241 207,228 154,201"/>
+ <polygon fill="#000000" fill-opacity="0.00947839" points="41,246 27,190 104,190 92,218 92,255 107,276 89,253 47,246"/>
+ <polygon fill="#000000" fill-opacity="0.045844376" points="367,252 380,258 380,246 403,246 361,259 340,259"/>
+ <polygon fill="#ffffff" fill-opacity="0.06800187" points="221,248 222,259 240,237 237,237 237,280"/>
+ <polygon fill="#000000" fill-opacity="0.013790548" points="433,22 385,72 372,82 391,103 377,15 349,33 295,5 346,9"/>
+ <polygon fill="#ffbe66" fill-opacity="0.07413441" points="115,182 126,182 126,276 81,292 32,292 32,203"/>
+ <polygon fill="#000000" fill-opacity="0.14280027" points="305,58 348,77 298,88"/>
+ <polygon fill="#8f5b28" fill-opacity="0.11054301" points="88,193 88,163 73,193"/>
+ <polygon fill="#ceffff" fill-opacity="0.056531847" points="294,177 346,205 319,236 322,206 294,193"/>
+ <polygon fill="#62412f" fill-opacity="0.76795864" points="274,47 284,47 268,84"/>
+ <polygon fill="#ffffff" fill-opacity="0.04750657" points="152,338 93,338 124,303 156,303"/>
+ <polygon fill="#ffffff" fill-opacity="0.008048177" points="318,17 327,156 346,175 316,33"/>
+ <polygon fill="#ffffff" fill-opacity="0.020448565" points="109,108 410,110 380,133 442,159 418,159 429,135 452,137 439,110"/>
+ <polygon fill="#7e3500" fill-opacity="0.20096749" points="254,80 299,143 345,187 300,202 300,195 301,185 281,143 279,148"/>
+ <polygon fill="#ffffff" fill-opacity="0.15638012" points="272,62 272,79 265,72 270,57 279,42 283,42"/>
+ <polygon fill="#ffffff" fill-opacity="0.009616017" points="303,84 277,177 269,170 269,135 398,81"/>
+ <polygon fill="#f39624" fill-opacity="0.027787566" points="261,19 358,197 379,217 379,212 366,208 487,334"/>
+ <polygon fill="#ffffff" fill-opacity="0.0047195554" points="322,110 276,100 313,100 316,182"/>
+ <polygon fill="#000000" fill-opacity="0.010494709" points="158,157 149,130 149,167 119,155 117,140"/>
+ <polygon fill="#90aa73" fill-opacity="0.04716617" points="212,84 235,96 218,66 233,81 245,59 246,84"/>
+ <polygon fill="#d3e71b" fill-opacity="0.032743454" points="357,292 357,267 402,261"/>
+ <polygon fill="#000000" fill-opacity="0.028299153" points="342,108 308,87 326,116 308,151"/>
+ <polygon fill="#ffffff" fill-opacity="0.048326552" points="314,75 355,59 328,76 345,50 321,74"/>
+ <polygon fill="#53e0fb" fill-opacity="0.024039328" points="105,103 107,108 152,93 73,46 137,60 147,68 107,96"/>
+ </g>
+</svg>
Property changes on: trunk/polycasso/htdocs/polypony.svg
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|