polycasso-commit Mailing List for polycasso (Page 5)
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...> - 2009-12-07 05:06:03
|
Revision: 150
http://polycasso.svn.sourceforge.net/polycasso/?rev=150&view=rev
Author: dbrosius
Date: 2009-12-07 05:05:52 +0000 (Mon, 07 Dec 2009)
Log Message:
-----------
add saver strings
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2009-12-07 05:05:34 UTC (rev 149)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolycassoBundle.java 2009-12-07 05:05:52 UTC (rev 150)
@@ -36,6 +36,10 @@
File("pc.file"),
PaintImage("pc.paintimage"),
CompleteImage("pc.completeimage"),
+ SaveAs("pc.saveas"),
+ PNG("pc.png"),
+ SVG("pc.svg"),
+ JAVA("pc.java"),
Quit("pc.quit"),
Edit("pc.edit"),
Settings("pc.settings"),
@@ -49,7 +53,8 @@
MaximumPolygonPoints("pc.maxpolygonpoints"),
MaximumPointMovement("pc.maximumpointmovement"),
MaximumColorChange("pc.maximumcolorchange"),
- BadSetting("pc.badsetting");
+ BadSetting("pc.badsetting"),
+ SaveFailure("pc.savefailure");
String id;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-07 05:05:42
|
Revision: 149
http://polycasso.svn.sourceforge.net/polycasso/?rev=149&view=rev
Author: dbrosius
Date: 2009-12-07 05:05:34 +0000 (Mon, 07 Dec 2009)
Log Message:
-----------
add saver strings
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-12-07 05:05:07 UTC (rev 148)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/resource.properties 2009-12-07 05:05:34 UTC (rev 149)
@@ -23,6 +23,10 @@
pc.file = File
pc.paintimage = Start Generating Image
pc.completeimage = Complete Image
+pc.saveas = Save as
+pc.png = PNG
+pc.svg = SVG
+pc.java = Java class
pc.quit = Quit
pc.edit = Edit
pc.settings = Settings
@@ -37,3 +41,4 @@
pc.maximumpointmovement = Maximum Point Movement
pc.maximumcolorchange = Maximum Color Change
pc.badsetting = The setting specified was too small to properly function
+pc.savefailure = Failed saving file: {0}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-07 05:05:15
|
Revision: 148
http://polycasso.svn.sourceforge.net/polycasso/?rev=148&view=rev
Author: dbrosius
Date: 2009-12-07 05:05:07 +0000 (Mon, 07 Dec 2009)
Log Message:
-----------
stub in specific savers
Added Paths:
-----------
trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java
trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java 2009-12-07 05:05:07 UTC (rev 148)
@@ -0,0 +1,33 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009 MeBigFatGuy.com
+ * Copyright 2009 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.io.IOException;
+
+public class JavaSaver implements Saver {
+
+ @Override
+ public void save(String fileName, Dimension imageSize, PolygonData[] data)
+ throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/JavaSaver.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java 2009-12-07 05:05:07 UTC (rev 148)
@@ -0,0 +1,33 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009 MeBigFatGuy.com
+ * Copyright 2009 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.io.IOException;
+
+public class PNGSaver implements Saver {
+
+ @Override
+ public void save(String fileName, Dimension imageSize, PolygonData[] data)
+ throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/PNGSaver.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java 2009-12-07 05:05:07 UTC (rev 148)
@@ -0,0 +1,33 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009 MeBigFatGuy.com
+ * Copyright 2009 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.io.IOException;
+
+public class SVGSaver implements Saver {
+
+ @Override
+ public void save(String fileName, Dimension imageSize, PolygonData[] data)
+ throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/SVGSaver.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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...> - 2009-12-07 04:52:10
|
Revision: 147
http://polycasso.svn.sourceforge.net/polycasso/?rev=147&view=rev
Author: dbrosius
Date: 2009-12-07 04:52:03 +0000 (Mon, 07 Dec 2009)
Log Message:
-----------
add getBestData method
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 2009-12-07 04:47:57 UTC (rev 146)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-12-07 04:52:03 UTC (rev 147)
@@ -79,6 +79,16 @@
}
/**
+ * 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.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-07 04:48:07
|
Revision: 146
http://polycasso.svn.sourceforge.net/polycasso/?rev=146&view=rev
Author: dbrosius
Date: 2009-12-07 04:47:57 +0000 (Mon, 07 Dec 2009)
Log Message:
-----------
an interface for saving polygon data
Added Paths:
-----------
trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java 2009-12-07 04:47:57 UTC (rev 146)
@@ -0,0 +1,27 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009 MeBigFatGuy.com
+ * Copyright 2009 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.io.IOException;
+
+public interface Saver {
+
+ void save(String fileName, Dimension imageSize, PolygonData[] data) throws IOException;
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/Saver.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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...> - 2009-12-07 04:29:27
|
Revision: 145
http://polycasso.svn.sourceforge.net/polycasso/?rev=145&view=rev
Author: dbrosius
Date: 2009-12-07 04:29:18 +0000 (Mon, 07 Dec 2009)
Log Message:
-----------
an enum for save as filetypes
Added Paths:
-----------
trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java 2009-12-07 04:29:18 UTC (rev 145)
@@ -0,0 +1,36 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009 MeBigFatGuy.com
+ * Copyright 2009 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 FileType {
+
+ PNG(".png"),
+ SVG(".svg"),
+ Java(".java");
+
+ private String extension;
+
+ FileType(String ext) {
+ extension = ext;
+ }
+
+ public String getExtension() {
+ return extension;
+ }
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/FileType.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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...> - 2009-12-07 03:56:27
|
Revision: 144
http://polycasso.svn.sourceforge.net/polycasso/?rev=144&view=rev
Author: dbrosius
Date: 2009-12-07 03:56:10 +0000 (Mon, 07 Dec 2009)
Log Message:
-----------
go to next version
Modified Paths:
--------------
trunk/polycasso/build.xml
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2009-12-06 03:59:32 UTC (rev 143)
+++ trunk/polycasso/build.xml 2009-12-07 03:56:10 UTC (rev 144)
@@ -35,7 +35,7 @@
<property name="javac.deprecation" value="on"/>
<property name="javac.debug" value="on"/>
- <property name="polycasso.version" value="1.0.0"/>
+ <property name="polycasso.version" value="1.1.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...> - 2009-12-06 03:59:41
|
Revision: 143
http://polycasso.svn.sourceforge.net/polycasso/?rev=143&view=rev
Author: dbrosius
Date: 2009-12-06 03:59:32 +0000 (Sun, 06 Dec 2009)
Log Message:
-----------
tag version 1.0.0
Added Paths:
-----------
tags/v1_0_0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-06 03:53:41
|
Revision: 142
http://polycasso.svn.sourceforge.net/polycasso/?rev=142&view=rev
Author: dbrosius
Date: 2009-12-06 03:53:30 +0000 (Sun, 06 Dec 2009)
Log Message:
-----------
move to 1.0.0
Modified Paths:
--------------
trunk/polycasso/build.xml
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2009-12-05 15:55:23 UTC (rev 141)
+++ trunk/polycasso/build.xml 2009-12-06 03:53:30 UTC (rev 142)
@@ -35,7 +35,7 @@
<property name="javac.deprecation" value="on"/>
<property name="javac.debug" value="on"/>
- <property name="polycasso.version" value="0.5.0"/>
+ <property name="polycasso.version" value="1.0.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...> - 2009-12-05 16:42:55
|
Revision: 141
http://polycasso.svn.sourceforge.net/polycasso/?rev=141&view=rev
Author: dbrosius
Date: 2009-12-05 15:55:23 +0000 (Sat, 05 Dec 2009)
Log Message:
-----------
go to dev version 0.5.0
Modified Paths:
--------------
trunk/polycasso/build.xml
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2009-12-05 06:23:37 UTC (rev 140)
+++ trunk/polycasso/build.xml 2009-12-05 15:55:23 UTC (rev 141)
@@ -35,7 +35,7 @@
<property name="javac.deprecation" value="on"/>
<property name="javac.debug" value="on"/>
- <property name="polycasso.version" value="0.4.0"/>
+ <property name="polycasso.version" value="0.5.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...> - 2009-12-05 06:23:44
|
Revision: 140
http://polycasso.svn.sourceforge.net/polycasso/?rev=140&view=rev
Author: dbrosius
Date: 2009-12-05 06:23:37 +0000 (Sat, 05 Dec 2009)
Log Message:
-----------
use ImageSizer to get height and width
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2009-12-05 06:22:56 UTC (rev 139)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PainterFrame.java 2009-12-05 06:23:37 UTC (rev 140)
@@ -124,7 +124,8 @@
Image targetImage = RandomImageFinder.findImage();
panel.setTarget(targetImage);
- Dimension size = new Dimension(targetImage.getWidth(PainterFrame.this), targetImage.getHeight(PainterFrame.this));
+ ImageSizer sizer = new ImageSizer(targetImage);
+ Dimension size = new Dimension(sizer.getWidth(), sizer.getHeight());
Dimension wSize = new Dimension(size);
wSize.height += 2 * PainterFrame.this.getJMenuBar().getHeight();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-05 06:23:06
|
Revision: 139
http://polycasso.svn.sourceforge.net/polycasso/?rev=139&view=rev
Author: dbrosius
Date: 2009-12-05 06:22:56 +0000 (Sat, 05 Dec 2009)
Log Message:
-----------
a class to wait for the loading of width/height values of an image.
Added Paths:
-----------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java
Added: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java (rev 0)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java 2009-12-05 06:22:56 UTC (rev 139)
@@ -0,0 +1,103 @@
+/*
+ * polycasso - Cubism Artwork generator
+ * Copyright 2009 MeBigFatGuy.com
+ * Copyright 2009 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.Image;
+import java.awt.image.ImageObserver;
+
+/**
+ * ensures that the fetching of the width or height of an image will always return a non negative number
+ */
+public class ImageSizer implements ImageObserver {
+
+ private Object lock = new Object();
+ private Image image;
+ private int imageWidth = -1;
+ private int imageHeight = -1;
+
+ /**
+ * constructs an image sizer for the specified image
+ *
+ * @param loadedImage the image to get the width and height of
+ */
+ public ImageSizer(Image loadedImage) {
+ image = loadedImage;
+ imageWidth = image.getWidth(this);
+ imageHeight = image.getHeight(this);
+ }
+
+ /**
+ * implements the callback to collect the width and height of the image
+ *
+ * @param img the image that is being loaded
+ * @param infoflags flags specifying what has changed
+ * @param x the horizontal position
+ * @param y the vertical position
+ * @param width the width of the image
+ * @param height the height of the image
+ *
+ * @return whether further processing is desired
+ */
+ @Override
+ public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
+ synchronized(lock) {
+ if ((infoflags & ImageObserver.WIDTH) != 0)
+ imageWidth = width;
+ if ((infoflags & ImageObserver.HEIGHT) != 0)
+ imageHeight = height;
+
+ lock.notifyAll();
+ return (imageWidth < 0) || (imageHeight < 0);
+ }
+ }
+
+ /**
+ * get the width of the image, waiting if necessary
+ *
+ * @return the width of the image
+ */
+ public int getWidth() {
+ synchronized(lock) {
+ try {
+ while (imageWidth < 0) {
+ lock.wait();
+ }
+ } catch (InterruptedException ie) {
+ }
+ return imageWidth;
+ }
+ }
+
+ /**
+ * get the height of the image, waiting if necessary
+ *
+ * @return the height of the image
+ */
+ public int getHeight() {
+ synchronized(lock) {
+ try {
+ while (imageHeight < 0) {
+ lock.wait();
+ }
+ } catch (InterruptedException ie) {
+ }
+ return imageHeight;
+ }
+ }
+}
Property changes on: trunk/polycasso/src/com/mebigfatguy/polycasso/ImageSizer.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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...> - 2009-12-03 14:54:18
|
Revision: 138
http://polycasso.svn.sourceforge.net/polycasso/?rev=138&view=rev
Author: dbrosius
Date: 2009-12-03 14:54:01 +0000 (Thu, 03 Dec 2009)
Log Message:
-----------
tag version 0.4.0
Added Paths:
-----------
tags/v0_4_0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-03 14:43:18
|
Revision: 137
http://polycasso.svn.sourceforge.net/polycasso/?rev=137&view=rev
Author: dbrosius
Date: 2009-12-03 14:43:08 +0000 (Thu, 03 Dec 2009)
Log Message:
-----------
get ready for the 0.4.0 release
Modified Paths:
--------------
trunk/polycasso/build.xml
Modified: trunk/polycasso/build.xml
===================================================================
--- trunk/polycasso/build.xml 2009-12-03 05:15:43 UTC (rev 136)
+++ trunk/polycasso/build.xml 2009-12-03 14:43:08 UTC (rev 137)
@@ -35,7 +35,7 @@
<property name="javac.deprecation" value="on"/>
<property name="javac.debug" value="on"/>
- <property name="polycasso.version" value="0.3.0"/>
+ <property name="polycasso.version" value="0.4.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...> - 2009-12-03 05:15:54
|
Revision: 136
http://polycasso.svn.sourceforge.net/polycasso/?rev=136&view=rev
Author: dbrosius
Date: 2009-12-03 05:15:43 +0000 (Thu, 03 Dec 2009)
Log Message:
-----------
try to push add polygon to create more localized polygons, and weight it, so that small polys are created more often.
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2009-12-03 04:03:57 UTC (rev 135)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/PolygonData.java 2009-12-03 05:15:43 UTC (rev 136)
@@ -23,6 +23,7 @@
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Polygon;
+import java.awt.Rectangle;
import java.util.Random;
/**
@@ -92,17 +93,51 @@
public static PolygonData randomPoly(Dimension size, int maxPoints) {
Random r = new Random();
Polygon polygon = new Polygon();
+ Rectangle polyRect = getPolyBounds(r, size);
+
int numPoints = r.nextInt(maxPoints - 3) + 3;
-
for (int i = 0; i < numPoints; i++) {
- polygon.addPoint(r.nextInt(size.width), r.nextInt(size.height));
+ polygon.addPoint(polyRect.x + r.nextInt(polyRect.width), polyRect.y + r.nextInt(polyRect.height));
}
Color c = new Color(r.nextFloat(), r.nextFloat(), r.nextFloat());
return new PolygonData(c, r.nextFloat(), polygon);
}
+
+ /**
+ * returns a rectangle that new polygons should points out of. It attempts to allow
+ * for creating localized polygons, so that small areas will be generated more likely.
+ *
+ * @param r a random generator object
+ * @param maxSize the max size of the image
+ *
+ * @return a rectangle to pick polygon points out of
+ */
+ private static Rectangle getPolyBounds(Random r, Dimension maxSize) {
+ Rectangle bounds = new Rectangle();
+
+ int polySize = r.nextInt(12);
+ if (polySize < 3) {
+ bounds.width = 2 + (maxSize.width / 7);
+ bounds.height = 2 + (maxSize.height / 7);
+ } else if (polySize < 6) {
+ bounds.width = 2 + (maxSize.width / 5);
+ bounds.height = 2 + (maxSize.height / 5);
+ } else if (polySize < 9) {
+ bounds.width = 2 + (maxSize.width / 3);
+ bounds.height = 2 + (maxSize.height / 3);
+ } else {
+ bounds.width = maxSize.width;
+ bounds.height = maxSize.height;
+ }
+
+ bounds.x = r.nextInt(maxSize.width - bounds.width + 1) - 1;
+ bounds.y = r.nextInt(maxSize.height - bounds.height + 1) - 1;
+ return bounds;
+ }
+
/**
* clones this polygon data data
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-03 04:04:07
|
Revision: 135
http://polycasso.svn.sourceforge.net/polycasso/?rev=135&view=rev
Author: dbrosius
Date: 2009-12-03 04:03:57 +0000 (Thu, 03 Dec 2009)
Log Message:
-----------
remove unused
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 2009-12-02 05:52:59 UTC (rev 134)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-12-03 04:03:57 UTC (rev 135)
@@ -194,7 +194,6 @@
String message = null;
boolean wasSuccessful = false;
- boolean newBest = false;
synchronized(lock) {
attempt++;
if (delta < candidateScore) {
@@ -211,7 +210,6 @@
if (candidateScore < bestScore) {
bestData = candidateData;
bestScore = candidateScore;
- newBest = true;
fireImageGenerated(candidateImage);
}
candidateStart = attempt;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-02 05:53:08
|
Revision: 134
http://polycasso.svn.sourceforge.net/polycasso/?rev=134&view=rev
Author: dbrosius
Date: 2009-12-02 05:52:59 +0000 (Wed, 02 Dec 2009)
Log Message:
-----------
need to cache the candidateImage, and need to fire the event synchronously
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 2009-12-01 15:31:35 UTC (rev 133)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-12-02 05:52:59 UTC (rev 134)
@@ -42,6 +42,7 @@
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;
@@ -200,6 +201,7 @@
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();
@@ -210,6 +212,7 @@
bestData = candidateData;
bestScore = candidateScore;
newBest = true;
+ fireImageGenerated(candidateImage);
}
candidateStart = attempt;
}
@@ -220,8 +223,7 @@
System.out.println(message);
}
- if (newBest) {
- fireImageGenerated(image);
+ if (wasSuccessful) {
image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
g2d = (Graphics2D)image.getGraphics();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-01 15:31:48
|
Revision: 133
http://polycasso.svn.sourceforge.net/polycasso/?rev=133&view=rev
Author: dbrosius
Date: 2009-12-01 15:31:35 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
oops, candidate stuff needs to be sync
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 2009-12-01 15:23:52 UTC (rev 132)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-12-01 15:31:35 UTC (rev 133)
@@ -204,17 +204,17 @@
if (Polycasso.DEBUG)
message = "Attempt: " + attempt + " CandidateScore: " + candidateScore + " BestScore: " + bestScore + " type: " + type.name();
}
+
+ if ((candidateStart + settings.getNumCompetingImages()) <= attempt) {
+ if (candidateScore < bestScore) {
+ bestData = candidateData;
+ bestScore = candidateScore;
+ newBest = true;
+ }
+ candidateStart = attempt;
+ }
}
-
- if ((candidateStart + settings.getNumCompetingImages()) <= attempt) {
- if (candidateScore < bestScore) {
- bestData = candidateData;
- bestScore = candidateScore;
- newBest = true;
- }
- candidateStart = attempt;
- }
-
+
if (Polycasso.DEBUG) {
if (message != null)
System.out.println(message);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-01 15:23:59
|
Revision: 132
http://polycasso.svn.sourceforge.net/polycasso/?rev=132&view=rev
Author: dbrosius
Date: 2009-12-01 15:23:52 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
use candidates
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 2009-12-01 15:23:33 UTC (rev 131)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-12-01 15:23:52 UTC (rev 132)
@@ -200,20 +200,21 @@
wasSuccessful = true;
candidateData = data.toArray(new PolygonData[data.size()]);
candidateScore = delta;
+
if (Polycasso.DEBUG)
message = "Attempt: " + attempt + " CandidateScore: " + candidateScore + " BestScore: " + bestScore + " type: " + type.name();
}
-
- if ((candidateStart + settings.getNumCompetingImages()) <= attempt) {
- if (candidateScore < bestScore) {
- bestData = candidateData;
- bestScore = candidateScore;
- newBest = true;
- }
- candidateStart = attempt;
- }
}
+ if ((candidateStart + settings.getNumCompetingImages()) <= attempt) {
+ if (candidateScore < bestScore) {
+ bestData = candidateData;
+ bestScore = candidateScore;
+ newBest = true;
+ }
+ candidateStart = attempt;
+ }
+
if (Polycasso.DEBUG) {
if (message != null)
System.out.println(message);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-01 15:23:41
|
Revision: 131
http://polycasso.svn.sourceforge.net/polycasso/?rev=131&view=rev
Author: dbrosius
Date: 2009-12-01 15:23:33 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
default competing images = 20 by default now
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-12-01 15:21:13 UTC (rev 130)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-12-01 15:23:33 UTC (rev 131)
@@ -39,7 +39,7 @@
public Settings() {
maxImageSize = new Dimension(800, 600);
maxPolygons = 50;
- numCompetingImages = 10;
+ numCompetingImages = 20;
maxPoints = 8;
maxPtMovement = 20;
maxColorChange = 40;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-01 15:21:25
|
Revision: 130
http://polycasso.svn.sourceforge.net/polycasso/?rev=130&view=rev
Author: dbrosius
Date: 2009-12-01 15:21:13 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
comment out debug
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2009-12-01 15:05:56 UTC (rev 129)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2009-12-01 15:21:13 UTC (rev 130)
@@ -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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-01 15:06:06
|
Revision: 129
http://polycasso.svn.sourceforge.net/polycasso/?rev=129&view=rev
Author: dbrosius
Date: 2009-12-01 15:05:56 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
batch up improvement attempts into numCompetingImage batches, and only pick the best one to improve the image -- an attempt to help remove local maximas.
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 2009-12-01 15:00:12 UTC (rev 128)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImageGenerator.java 2009-12-01 15:05:56 UTC (rev 129)
@@ -42,6 +42,9 @@
private BufferedImage targetImage;
private PolygonData[] bestData;
private double bestScore = Double.MAX_VALUE;
+ private PolygonData[] candidateData;
+ private double candidateScore = Double.MAX_VALUE;
+ private int candidateStart = 0;
private Dimension imageSize;
private Feedback feedback;
private Thread[] t = null;
@@ -159,7 +162,8 @@
/**
* the runnable interface implementation to repeatedly improve upon the image and check to
- * see if it is closer to the target image.
+ * 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 {
@@ -188,16 +192,26 @@
double delta = feedback.calculateDelta(image);
String message = null;
+ boolean wasSuccessful = false;
boolean newBest = false;
synchronized(lock) {
attempt++;
- if (delta < bestScore) {
- bestData = data.toArray(new PolygonData[data.size()]);
- bestScore = delta;
+ if (delta < candidateScore) {
+ wasSuccessful = true;
+ candidateData = data.toArray(new PolygonData[data.size()]);
+ candidateScore = delta;
if (Polycasso.DEBUG)
- message = "Attempt: " + attempt + " BestScore: " + bestScore + " type: " + type.name();
- newBest = true;
+ message = "Attempt: " + attempt + " CandidateScore: " + candidateScore + " BestScore: " + bestScore + " type: " + type.name();
}
+
+ if ((candidateStart + settings.getNumCompetingImages()) <= attempt) {
+ if (candidateScore < bestScore) {
+ bestData = candidateData;
+ bestScore = candidateScore;
+ newBest = true;
+ }
+ candidateStart = attempt;
+ }
}
if (Polycasso.DEBUG) {
@@ -210,7 +224,7 @@
image = new BufferedImage(imageSize.width, imageSize.height, BufferedImage.TYPE_4BYTE_ABGR);
g2d = (Graphics2D)image.getGraphics();
}
- improver.typeWasSuccessful(type, newBest);
+ improver.typeWasSuccessful(type, wasSuccessful);
}
} catch (Exception e) {
e.printStackTrace();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-01 15:00:19
|
Revision: 128
http://polycasso.svn.sourceforge.net/polycasso/?rev=128&view=rev
Author: dbrosius
Date: 2009-12-01 15:00:12 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
up MAX_FAILURE_RUN to 100
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2009-12-01 14:59:27 UTC (rev 127)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/ImprovementTypeStats.java 2009-12-01 15:00:12 UTC (rev 128)
@@ -29,7 +29,7 @@
*/
public class ImprovementTypeStats {
- private static final int MAX_FAILURE_RUN = 50;
+ private static final int MAX_FAILURE_RUN = 100;
private static class Stats {
public int successes = 1;
public int totals = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-01 14:59:35
|
Revision: 127
http://polycasso.svn.sourceforge.net/polycasso/?rev=127&view=rev
Author: dbrosius
Date: 2009-12-01 14:59:27 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
set default competing images to 10
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-12-01 14:32:31 UTC (rev 126)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Settings.java 2009-12-01 14:59:27 UTC (rev 127)
@@ -39,7 +39,7 @@
public Settings() {
maxImageSize = new Dimension(800, 600);
maxPolygons = 50;
- numCompetingImages = 100;
+ numCompetingImages = 10;
maxPoints = 8;
maxPtMovement = 20;
maxColorChange = 40;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-01 14:32:38
|
Revision: 126
http://polycasso.svn.sourceforge.net/polycasso/?rev=126&view=rev
Author: dbrosius
Date: 2009-12-01 14:32:31 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
set numcompetingimages on OK
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-12-01 14:31:12 UTC (rev 125)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/SettingsDialog.java 2009-12-01 14:32:31 UTC (rev 126)
@@ -215,6 +215,7 @@
public void actionPerformed(ActionEvent ae) {
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.
|